From: Stefan Schweizer <sschweizer@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Bug#286040: please allow permissions.d to follow symlinks
Date: Fri, 17 Dec 2004 17:45:00 +0000 [thread overview]
Message-ID: <e796392204121709455af5a863@mail.gmail.com> (raw)
In-Reply-To: <20041217083115.GA4050@wonderland.linux.it>
[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]
On Fri, 17 Dec 2004 08:45:48 -0800, Greg KH <greg@kroah.com> wrote:
> Actually I was considering just dropping the permissions.d file
> entirely, as I think we don't need it anymore. But I have not had the
> time to determine if this is possible or not just yet.
This sounds cool, but it will also mean, that we have bigger rules, as
most of the rules will need a GROUP="" statement then.
> What about the fun interaction with pam that causes device nodes to
> "magically" assume other permissions. Are you objecting to that too?
>
That has nothing to do with udev, it only hided an udev bug for a while
If you look in your archives, you will see, that I first wanted to
make permissions.d follow symlinks as the proper way to handle it. As
I consider myself not a very good programmer and because someone
pointed out that I could use GROUP=, I made a workaround that has been
merged into udev now.
But I still think its abetter to make udev follow symlinks as that
will keep permissions in permissions.d and remove unnecessary grouping
code from symlink-scripts like cdsymlinks.sh.
> I have yet to see a patch that offers such an "improvement" in this
> thread. If you ever create one, I would love to see it posted on the
> list for everyone to evaluate. Until then, this argument is over.
>
I attached a rolled-up patch against the latest udev release for your pleasure.
It was taken from http://bugs.gentoo.org/show_bug.cgi?id=73064
You can credit Gregorio Guidi <g.guidi <at> sns.it> for it, when you merge it.
> Um, I have no control over the debian udev rules files, I just mirror in
> the udev tree what the maintainer gives to me.
>
I use gentoo, but why do we even have different rules.d files? Can we
not make as much as possible common in them? What are the differences
between the distributions?
With this system we have some rules missing in every distributions
rules file, because bugfixes and new features are commonly applied
only to one rules file.
Stefan Schweizer
Gentoo developer
http://dev.gentoo.org/~genstef
[-- Attachment #2: udev-match-symlink-perms.patch --]
[-- Type: application/octet-stream, Size: 1308 bytes --]
diff -uNr udev-049.orig/etc/udev/gentoo/udev.permissions udev-046/etc/udev/udev.permissions.gentoo
--- udev-049.orig/etc/udev/gentoo/udev.permissions 2004-11-18 20:39:15.000000000 +0100
+++ udev-049/etc/udev/gentoo/udev.permissions 2004-12-01 21:22:15.095677080 +0100
@@ -114,7 +114,6 @@
raw/*:root:disk:660
# disk devices
-hd*:root:disk:660
sd*:root:disk:660
dasd*:root:disk:660
ataraid*:root:disk:660
diff -uNr udev-049.orig/namedev.c udev-046/namedev.c
--- udev-049.orig/namedev.c 2004-11-18 20:39:15.000000000 +0100
+++ udev-049/namedev.c 2004-12-01 21:18:42.945928744 +0100
@@ -695,7 +695,9 @@
struct sysfs_device *sysfs_device = NULL;
struct config_device *dev;
struct perm_device *perm;
+ char linkname[NAME_SIZE];
char *pos;
+ int len;
udev->mode = 0;
dbg("class_dev->name='%s'", class_dev->name);
@@ -794,6 +796,18 @@
perms:
/* apply permissions from permissions file to empty fields */
perm = find_perm_entry(udev->name);
+ if (perm != NULL)
+ goto perms_found;
+
+ /* try to match the symlink name */
+ foreach_strpart(udev->symlink, " ", pos, len) {
+ strfieldcpymax(linkname, pos, len+1);
+ perm = find_perm_entry(linkname);
+ if (perm != NULL)
+ goto perms_found;
+ }
+
+perms_found:
if (perm != NULL) {
if (udev->mode == 0000)
udev->mode = perm->mode;
next prev parent reply other threads:[~2004-12-17 17:45 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-17 8:31 Bug#286040: please allow permissions.d to follow symlinks Marco d'Itri
2004-12-17 10:11 ` Stefan Schweizer
2004-12-17 10:48 ` martin f krafft
2004-12-17 13:24 ` Kay Sievers
2004-12-17 13:38 ` martin f krafft
2004-12-17 13:40 ` Marco d'Itri
2004-12-17 13:45 ` Kay Sievers
2004-12-17 13:47 ` Kay Sievers
2004-12-17 13:49 ` Marco d'Itri
2004-12-17 13:56 ` Kay Sievers
2004-12-17 13:58 ` martin f krafft
2004-12-17 14:13 ` Kay Sievers
2004-12-17 14:19 ` martin f krafft
2004-12-17 14:20 ` Kay Sievers
2004-12-17 14:35 ` martin f krafft
2004-12-17 14:36 ` Stefan Schweizer
2004-12-17 14:42 ` martin f krafft
2004-12-17 14:45 ` Kay Sievers
2004-12-17 14:52 ` martin f krafft
2004-12-17 15:50 ` Greg KH
2004-12-17 16:14 ` martin f krafft
2004-12-17 16:45 ` Greg KH
2004-12-17 17:10 ` martin f krafft
2004-12-17 17:45 ` Stefan Schweizer [this message]
2004-12-17 18:33 ` Greg KH
2004-12-17 18:40 ` martin f krafft
2004-12-17 23:25 ` Kay Sievers
2004-12-17 23:41 ` martin f krafft
2004-12-18 0:25 ` Lindsay Haisley
2004-12-18 0:53 ` martin f krafft
2004-12-18 1:18 ` martin f krafft
2004-12-18 3:04 ` Greg KH
2004-12-18 4:18 ` Lindsay Haisley
2004-12-18 4:21 ` martin f krafft
2004-12-18 9:48 ` Stefan Schweizer
2004-12-18 12:33 ` Tobias Klauser
2004-12-18 13:04 ` Marco d'Itri
2004-12-19 4:34 ` Randy.Dunlap
2004-12-20 9:39 ` martin f krafft
2004-12-20 17:56 ` Lindsay Haisley
2004-12-20 18:04 ` martin f krafft
2004-12-20 19:05 ` Lindsay Haisley
2004-12-21 8:04 ` martin f krafft
2004-12-21 16:11 ` Lindsay Haisley
2004-12-21 16:31 ` Lindsay Haisley
2004-12-21 16:38 ` martin f krafft
2004-12-21 16:48 ` Tobias Klauser
2004-12-21 16:54 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e796392204121709455af5a863@mail.gmail.com \
--to=sschweizer@gmail.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).