All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] rules: add ID_EXTERNAL_PORT and ID_MODEM
@ 2011-07-14 17:24 Linus Walleij
  2011-07-14 18:03 ` Kay Sievers
  2011-07-14 18:07 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2011-07-14 17:24 UTC (permalink / raw)
  To: linux-hotplug

Distributions doing desktop spins or other single-user systems
may be interested in enabling access to the external ports (serial,
USB-to-serial dongle etc) and modems for the logged-in user.

To help with this, mark external serial ports with
ID_EXTERNAL_PORT and modems with ID_MODEM. This way a distributor
can create a 60-desktop-acl.rules (or similarly named) file like
this:

ENV{ID_EXTERNAL_PORT}="*?", TAG+="udev-acl"
ENV{ID_MODEM}="*?", TAG+="udev-acl"

To enable local access to external ports and modems on these
specific distributions.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 rules/rules.d/50-udev-default.rules |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules
index 7684ea9..2ad08e9 100644
--- a/rules/rules.d/50-udev-default.rules
+++ b/rules/rules.d/50-udev-default.rules
@@ -9,16 +9,16 @@ KERNEL="vcs|vcs[0-9]*|vcsa|vcsa[0-9]*", GROUP="tty"
 
 # external serial ports - these may or may not be connected to modems,
 # we assume they are connected to modems for security reasons
-KERNEL="tty[A-Z]*[0-9]|ircomm[0-9]*", GROUP="dialout"
+KERNEL="tty[A-Z]*[0-9]|ircomm[0-9]*", GROUP="dialout", ENV{ID_EXTERNAL_PORT}="1"
 
 # bluetooth TTY links - not always possible to use for dialout but we
 # assume so anyway for security reasons
-KERNEL="rfcomm[0-9]*", GROUP="dialout"
+KERNEL="rfcomm[0-9]*", GROUP="dialout", ENV{ID_EXTERNAL_PORT}="1"
 
 # modems
-KERNEL="pppox[0-9]*|noz[0-9]*", GROUP="dialout"
-KERNEL="mwave",		GROUP="dialout"
-KERNEL="hvc*|hvsi*",		GROUP="dialout"
+KERNEL="pppox[0-9]*|noz[0-9]*", GROUP="dialout", ENV{ID_MODEM}="1"
+KERNEL="mwave",		GROUP="dialout", ENV{ID_MODEM}="1"
+KERNEL="hvc*|hvsi*",		GROUP="dialout", ENV{ID_MODEM}="1"
 
 # virtio serial / console ports
 KERNEL="vport*", ATTR{name}="?*", SYMLINK+="virtio-ports/$attr{name}"
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] rules: add ID_EXTERNAL_PORT and ID_MODEM
  2011-07-14 17:24 [PATCH 2/2] rules: add ID_EXTERNAL_PORT and ID_MODEM Linus Walleij
@ 2011-07-14 18:03 ` Kay Sievers
  2011-07-14 18:07 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2011-07-14 18:03 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Jul 14, 2011 at 19:24, Linus Walleij <linus.walleij@linaro.org> wrote:
> Distributions doing desktop spins or other single-user systems
> may be interested in enabling access to the external ports (serial,
> USB-to-serial dongle etc) and modems for the logged-in user.

Almost all distributions with desktop focus run a system-wide service
like ModemManager on connman, which hook into udev and probes and
classifies modems, and tags them in a more reliable way. The users
usually talk to these services not to the devices directly.

> ENV{ID_EXTERNAL_PORT}="*?", TAG+="udev-acl"

We really don't want to get into the external/internal business ever,
that can not be reliable determined.

Kay

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/2] rules: add ID_EXTERNAL_PORT and ID_MODEM
  2011-07-14 17:24 [PATCH 2/2] rules: add ID_EXTERNAL_PORT and ID_MODEM Linus Walleij
  2011-07-14 18:03 ` Kay Sievers
@ 2011-07-14 18:07 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-07-14 18:07 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Jul 14, 2011 at 8:03 PM, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Thu, Jul 14, 2011 at 19:24, Linus Walleij <linus.walleij@linaro.org> wrote:
>> ENV{ID_EXTERNAL_PORT}="*?", TAG+="udev-acl"
>
> We really don't want to get into the external/internal business ever,
> that can not be reliable determined.

I used ID_SERIAL first, but that was taken by serial numbers...
ID_SERIAL_PORT is maybe smarter.

But I'll drop that patch anyway, so nevermind.

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-14 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 17:24 [PATCH 2/2] rules: add ID_EXTERNAL_PORT and ID_MODEM Linus Walleij
2011-07-14 18:03 ` Kay Sievers
2011-07-14 18:07 ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.