]> err.no Git - systemd/commitdiff
[PATCH] complete removal of explicit udev permissions config file
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Sat, 18 Dec 2004 10:34:17 +0000 (11:34 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:17:47 +0000 (23:17 -0700)
17 files changed:
FAQ
Makefile
docs/rh_udev_for_dev.txt
etc/udev/udev.conf.in
namedev.c
namedev.h
namedev_parse.c
test/devd_test
test/net_test
test/replace_test
test/udev-test.pl
test/udev.permissions [deleted file]
udev.8.in
udev.c
udev.h
udev.spec
udev_config.c

diff --git a/FAQ b/FAQ
index 45337bf635174adb2d1d2cc53d17653439614396..bd9d63a4d50ef7e54f8b7041aeb1f8587d146b63 100644 (file)
--- a/FAQ
+++ b/FAQ
@@ -72,10 +72,6 @@ A: udev is entirely in userspace.  If the kernel supports a greater number
 Q: Will udev support symlinks?
 A: Yes, It now does.  Multiple symlinks per device node too.
 
-Q: How will udev support changes to device permissions?
-A: On shutdown, udev will save the state of existing device permissions to
-   its database, and then used the on the next boot time.
-
 Q: How will udev handle the /dev filesystem?
 A: /dev can be a ramfs, or a backing filesystem.  udev does not care what
    kind of filesystem it runs on.
index 4fc6ce72ef637a23e7e6b6d4c0bfcf608552a808..52c1d47b2d76ab1126f34bab7c5f1c8480d1dc76 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -284,7 +284,6 @@ udev_version.h:
        @echo \#define UDEV_CONFIG_DIR          \"$(configdir)\" >> $@
        @echo \#define UDEV_CONFIG_FILE         \"$(configdir)/udev.conf\" >> $@
        @echo \#define UDEV_RULES_FILE          \"$(configdir)/rules.d\" >> $@
-       @echo \#define UDEV_PERMISSION_FILE     \"$(configdir)/permissions.d\" >> $@
        @echo \#define UDEV_LOG_DEFAULT         \"yes\" >> $@
        @echo \#define UDEV_BIN                 \"$(DESTDIR)$(sbindir)/udev\" >> $@
        @echo \#define UDEVD_BIN                \"$(DESTDIR)$(sbindir)/udevd\" >> $@
@@ -381,7 +380,6 @@ small_release: $(DISTFILES) spotless
 
 install-config:
        $(INSTALL) -d $(DESTDIR)$(configdir)/rules.d
-       $(INSTALL) -d $(DESTDIR)$(configdir)/permissions.d
        @if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \
                echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \
                $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \
@@ -390,10 +388,6 @@ install-config:
                echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.rules $(DESTDIR)$(configdir)/rules.d/50-udev.rules; \
                $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.rules $(DESTDIR)$(configdir)/rules.d/50-udev.rules; \
        fi
-       @if [ ! -r $(DESTDIR)$(configdir)/permissions.d/50-udev.permissions ]; then \
-               echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir)/permissions.d/50-udev.permissions; \
-               $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.permissions $(DESTDIR)$(configdir)/permissions.d/50-udev.permissions; \
-       fi
 
 install-dev.d:
        $(INSTALL) -d $(DESTDIR)$(dev_ddir)/default
@@ -444,10 +438,8 @@ endif
 uninstall: uninstall-man uninstall-dev.d
        - rm $(hotplugdir)/10-udev.hotplug
        - rm $(configdir)/rules.d/50-udev.rules
-       - rm $(configdir)/permissions.d/50-udev.permissions
        - rm $(configdir)/udev.conf
        - rmdir $(configdir)/rules.d
-       - rmdir $(configdir)/permissions.d
        - rmdir $(configdir)
        - rm $(sbindir)/$(ROOT)
        - rm $(sbindir)/$(DAEMON)
index 1a21c0e59b35a38e5ee15bf4bf324bc3e7c440c9..0b66868d7968325415b0a99ebc9327f256b7ce84 100644 (file)
@@ -12,19 +12,13 @@ Q.  I login as my normal self from the login screen and RH just hangs on an
     empty blue screen.  What's wrong?
 
 A.  You have some wrong permissions.  I'm guessing you can probably log in as root
-    but not as your normal user.  Basically you need to edit the
-    /etc/udev/udev.permissions file to set the correct permissions to the nodes
-    in /dev.  I added the following:
-
-    null:root:users:0666
-    urandom:root:users:0644
-
-    setting the correct permissions to null and urandom allowed me to login
-    as myself and not at root.
+    but not as your normal user.  Basically you need to set the right
+    permissions with a rule. Setting the correct permissions to null and urandom
+    allowed me to login as myself and not at root.
 
     While you are there you might want to set the permissions to ptmx as well
-    or you may have trouble getting a bash prompt in an xterm.  i.e.
-    ptmx:root:users:0666  Also refer to the next question.
+    or you may have trouble getting a bash prompt in an xterm. Also refer to the
+    next question.
 
 Q.  I'm having trouble getting a bash prompt from my xterm.  i.e. I bring up a
     terminal and all I have is a blank screen with a blinking cursor.
index bbbb1a93a243ea87f5e51f1f32b7a08770425ac6..295e39ffd2ac0417c138ffa2246368e5c3205c02 100644 (file)
@@ -14,19 +14,16 @@ udev_db="@udevdir@/.udevdb"
 # udev_rules - The name and location of the udev rules file
 udev_rules="@configdir@/rules.d"
 
-# udev_permissions - The name and location of the udev permission file
-udev_permissions="@configdir@/permissions.d"
-
 # default_mode - set the default mode for all nodes that have no
-#                explicit match in the permissions file
+#                permissions specified
 default_mode="0600"
 
 # default_owner - set the default owner for all nodes that have no
-#                 explicit match in the permissions file
+ #                permissions specified
 default_owner="root"
 
 # default_group - set the default group for all nodes that have no
-#                 explicit match in the permissions file
+ #                permissions specified
 default_group="root"
 
 # udev_log - set to "yes" if you want logging, else "no"
index 9cfc4283be12b8b4d57df85695ea308d1b1c2818..be7ae12cd599513dd7615fa657f7d586b8846aa2 100644 (file)
--- a/namedev.c
+++ b/namedev.c
 
 static struct sysfs_attribute *find_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, char *attr);
 
-LIST_HEAD(config_device_list);
-LIST_HEAD(perm_device_list);
-
-
 /* compare string with pattern (supports * ? [0-9] [!A-Z]) */
 static int strcmp_pattern(const char *p, const char *s)
 {
@@ -100,18 +96,6 @@ static int strcmp_pattern(const char *p, const char *s)
        return 1;
 }
 
-static struct perm_device *find_perm_entry(const char *name)
-{
-       struct perm_device *perm;
-
-       list_for_each_entry(perm, &perm_device_list, node) {
-               if (strcmp_pattern(perm->name, name))
-                       continue;
-               return perm;
-       }
-       return NULL;
-}
-
 /* extract possible {attr} and move str behind it */
 static char *get_format_attribute(char **str)
 {
@@ -694,7 +678,6 @@ int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_d
        struct sysfs_class_device *class_dev_parent;
        struct sysfs_device *sysfs_device = NULL;
        struct config_device *dev;
-       struct perm_device *perm;
        char *pos;
 
        udev->mode = 0;
@@ -792,18 +775,7 @@ int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_d
                goto exit;
 
 perms:
-       /* apply permissions from permissions file to empty fields */
-       perm = find_perm_entry(udev->name);
-       if (perm != NULL) {
-               if (udev->mode == 0000)
-                       udev->mode = perm->mode;
-               if (udev->owner[0] == '\0')
-                       strfieldcpy(udev->owner, perm->owner);
-               if (udev->group[0] == '\0')
-                       strfieldcpy(udev->group, perm->group);
-       }
-
-       /* apply permissions from config to empty fields */
+       /* apply default permissions to empty fields */
        if (udev->mode == 0000)
                udev->mode = default_mode;
        if (udev->owner[0] == '\0')
@@ -817,20 +789,3 @@ perms:
 exit:
        return 0;
 }
-
-int namedev_init(void)
-{
-       int retval;
-
-       retval = namedev_init_rules();
-       if (retval)
-               return retval;
-
-       retval = namedev_init_permissions();
-       if (retval)
-               return retval;
-
-       dump_config_dev_list();
-       dump_perm_dev_list();
-       return retval;
-}
index e29279243bca829838408d00582984bf140c7123..8a3569ec7cd92cd43d9e2712677c1ecdc69b3fa7 100644 (file)
--- a/namedev.h
+++ b/namedev.h
@@ -58,7 +58,6 @@ struct sysfs_class_device;
 #define MAX_SYSFS_PAIRS                5
 
 #define RULEFILE_SUFFIX                ".rules"
-#define PERMFILE_SUFFIX                ".permissions"
 
 struct sysfs_pair {
        char file[FILE_SIZE];
@@ -88,26 +87,12 @@ struct config_device {
        int config_line;
 };
 
-struct perm_device {
-       struct list_head node;
-
-       char name[NAME_SIZE];
-       char owner[USER_SIZE];
-       char group[USER_SIZE];
-       unsigned int mode;
-};
-
 extern struct list_head config_device_list;
-extern struct list_head perm_device_list;
 
 extern int namedev_init(void);
 extern int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_dev);
-extern int namedev_init_permissions(void);
-extern int namedev_init_rules(void);
 
 extern void dump_config_dev(struct config_device *dev);
 extern void dump_config_dev_list(void);
-extern void dump_perm_dev(struct perm_device *dev);
-extern void dump_perm_dev_list(void);
 
 #endif
index 5b8c5ab2d6989a32d8648b6ce048128116d8f144..7190cdd1a8702a538f5f454d96e3ca84a00f7b6f 100644 (file)
@@ -40,6 +40,7 @@
 #include "logging.h"
 #include "namedev.h"
 
+LIST_HEAD(config_device_list);
 
 static int add_config_dev(struct config_device *new_dev)
 {
@@ -74,53 +75,6 @@ void dump_config_dev_list(void)
                dump_config_dev(dev);
 }
 
-static int add_perm_dev(struct perm_device *new_dev)
-{
-       struct perm_device *dev;
-       struct perm_device *tmp_dev;
-
-       /* if we already have that entry, just update the values */
-       list_for_each_entry(dev, &perm_device_list, node) {
-               if (strcmp(new_dev->name, dev->name) != 0)
-                       continue;
-
-               /* don't overwrite values from earlier entries */
-               if (dev->mode == 0000)
-                       dev->mode = new_dev->mode;
-               if (dev->owner[0] == '\0')
-                       strfieldcpy(dev->owner, new_dev->owner);
-               if (dev->owner[0] == '\0')
-                       strfieldcpy(dev->group, new_dev->group);
-
-               return 0;
-       }
-
-       /* not found, add new structure to the perm list */
-       tmp_dev = malloc(sizeof(*tmp_dev));
-       if (!tmp_dev)
-               return -ENOMEM;
-
-       memcpy(tmp_dev, new_dev, sizeof(*tmp_dev));
-       list_add_tail(&tmp_dev->node, &perm_device_list);
-       /* dump_perm_dev(tmp_dev); */
-
-       return 0;
-}
-
-void dump_perm_dev(struct perm_device *dev)
-{
-       dbg_parse("name='%s', owner='%s', group='%s', mode=%#o",
-                 dev->name, dev->owner, dev->group, dev->mode);
-}
-
-void dump_perm_dev_list(void)
-{
-       struct perm_device *dev;
-
-       list_for_each_entry(dev, &perm_device_list, node)
-               dump_perm_dev(dev);
-}
-
 /* extract possible KEY{attr} */
 static char *get_key_attribute(char *str)
 {
@@ -143,7 +97,7 @@ static char *get_key_attribute(char *str)
        return NULL;
 }
 
-static int namedev_parse_rules(const char *filename, void *data)
+static int namedev_parse(const char *filename, void *data)
 {
        char line[LINE_SIZE];
        char *bufline;
@@ -362,124 +316,18 @@ error:
        return retval;
 }
 
-static int namedev_parse_permissions(const char *filename, void *data)
+int namedev_init(void)
 {
-       char line[LINE_SIZE];
-       char *bufline;
-       char *temp;
-       char *temp2;
-       char *buf;
-       size_t bufsize;
-       size_t cur;
-       size_t count;
-       int retval = 0;
-       struct perm_device dev;
-       int lineno;
+       struct stat stats;
+       int retval;
 
-       if (file_map(filename, &buf, &bufsize) == 0) {
-               dbg("reading '%s' as permissions file", filename);
-       } else {
-               dbg("can't open '%s' as permissions file", filename);
+       if (stat(udev_rules_filename, &stats) != 0)
                return -1;
-       }
-
-       /* loop through the whole file */
-       cur = 0;
-       lineno = 0;
-       while (cur < bufsize) {
-               count = buf_get_line(buf, bufsize, cur);
-               bufline = &buf[cur];
-               cur += count+1;
-               lineno++;
-
-               if (count >= LINE_SIZE) {
-                       info("line too long, rule skipped %s, line %d",
-                            filename, lineno);
-                       continue;
-               }
-
-               /* eat the whitespace */
-               while ((count > 0) && isspace(bufline[0])) {
-                       bufline++;
-                       count--;
-               }
-               if (count == 0)
-                       continue;
-
-               /* see if this is a comment */
-               if (bufline[0] == COMMENT_CHARACTER)
-                       continue;
-
-               strncpy(line, bufline, count);
-               line[count] = '\0';
-               dbg_parse("read '%s'", line);
-
-               /* parse the line */
-               memset(&dev, 0x00, sizeof(struct perm_device));
-               temp = line;
-
-               temp2 = strsep(&temp, ":");
-               if (!temp2) {
-                       dbg("cannot parse line '%s'", line);
-                       continue;
-               }
-               strfieldcpy(dev.name, temp2);
-
-               temp2 = strsep(&temp, ":");
-               if (!temp2) {
-                       dbg("cannot parse line '%s'", line);
-                       continue;
-               }
-               strfieldcpy(dev.owner, temp2);
 
-               temp2 = strsep(&temp, ":");
-               if (!temp2) {
-                       dbg("cannot parse line '%s'", line);
-                       continue;
-               }
-               strfieldcpy(dev.group, temp2);
-
-               if (!temp) {
-                       dbg("cannot parse line '%s'", line);
-                       continue;
-               }
-               dev.mode = strtol(temp, NULL, 8);
-
-               dbg_parse("name='%s', owner='%s', group='%s', mode=%#o",
-                         dev.name, dev.owner, dev.group, dev.mode);
-
-               retval = add_perm_dev(&dev);
-               if (retval) {
-                       dbg("add_perm_dev returned with error %d", retval);
-                       goto exit;
-               }
-       }
-
-exit:
-       file_unmap(buf, bufsize);
-       return retval;
-}
-
-int namedev_init_rules(void)
-{
-       struct stat stats;
-
-       stat(udev_rules_filename, &stats);
        if ((stats.st_mode & S_IFMT) != S_IFDIR)
-               return namedev_parse_rules(udev_rules_filename, NULL);
+               retval = namedev_parse(udev_rules_filename, NULL);
        else
-               return call_foreach_file(namedev_parse_rules, udev_rules_filename,
-                                        RULEFILE_SUFFIX, NULL);
-}
+               retval = call_foreach_file(namedev_parse, udev_rules_filename, RULEFILE_SUFFIX, NULL);
 
-int namedev_init_permissions(void)
-{
-       struct stat stats;
-
-       stat(udev_permissions_filename, &stats);
-       if ((stats.st_mode & S_IFMT) != S_IFDIR)
-               return namedev_parse_permissions(udev_permissions_filename, NULL);
-       else
-               return call_foreach_file(namedev_parse_permissions, udev_permissions_filename,
-                                        PERMFILE_SUFFIX, NULL);
+       return retval;
 }
index 6e4c206352f8fb18fede00b22cab291c192c6145..269c2b11da8911f17ff80d2e13966f417eba6f57 100644 (file)
@@ -16,7 +16,6 @@ cat > $CONFIG << EOF
 udev_root="$PWD/udev/"
 udev_db="$PWD/udev/.udevdb"
 udev_rules="$PWD/$RULES"
-udev_permissions="$PWD/udev.permissions"
 EOF
 
 mkdir udev
index ec0dea46422581519c3c92b7ce9d6912fd74cf00..9686f99258371e5ed386f2513360f627490b0a45 100644 (file)
@@ -15,7 +15,6 @@ cat > $CONFIG << EOF
 udev_root="$PWD/udev/"
 udev_db="$PWD/udev/.udevdb"
 udev_rules="$PWD/$RULES"
-udev_permissions="$PWD/udev.permissions"
 EOF
 
 mkdir udev
index 9445b7262a18cd007dcb3a87deb82e653cfa6201..19260765ba2c733e60ccd65c57436fdd6bcc62d3 100644 (file)
@@ -15,7 +15,6 @@ cat > $CONFIG << EOF
 udev_root="$PWD/udev/"
 udev_db="$PWD/udev/.udevdb"
 udev_rules="$PWD/$RULES"
-udev_permissions="$PWD/udev.permissions"
 EOF
 
 mkdir udev
index 3f9a848490297777e6b55ec6ecee21c48554f3d8..8ee8ba5414698f35ce9846584e1bdf27e1dd7268 100644 (file)
@@ -31,7 +31,6 @@ my $sysfs     = "sys/";
 my $udev_bin  = "../udev";
 my $udev_root = "udev-root/"; # !!! directory will be removed !!!
 my $udev_db   = ".udevdb";
-my $perm      = "udev.permissions";
 my $main_conf = "udev-test.conf";
 my $conf_tmp  = "udev-test.rules";
 
@@ -503,167 +502,17 @@ BUS="scsi", SYSFS{whitespace_test}="WHITE  SPACE   ", NAME="matched-with-space"
 EOF
        },
        {
-               desc            => "permissions test",
-               subsys          => "block",
-               devpath         => "/block/sda",
-               exp_name        => "node",
-               exp_perms       => "5000::0444",
-               conf            => <<EOF
-BUS="scsi", KERNEL="sda", NAME="node", OWNER="5000", MODE="0444"
-EOF
-       },
-       {
-               desc            => "permissions ttyUSB0:root:uucp:0660",
-               subsys          => "tty",
-               devpath         => "/class/tty/ttyUSB0",
-               exp_name        => "ttyUSB0",
-               exp_perms       => "0:14:0660",
-               conf            => <<EOF
-KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n"
-EOF
-       },
-       {
-               desc            => "permissions tty0::root:0444",
-               subsys          => "tty",
-               devpath         => "/class/tty/tty0",
-               exp_name        => "tty0",
-               exp_perms       => "0:0:0444",
-               conf            => <<EOF
-KERNEL="tty0", NAME="tty0"
-EOF
-       },
-       {
-               desc            => "permissions tty1:root::0555",
-               subsys          => "tty",
-               devpath         => "/class/tty/tty1",
-               exp_name        => "tty1",
-               exp_perms       => "0:0:0555",
-               conf            => <<EOF
-KERNEL="tty1", NAME="tty1"
-EOF
-       },
-       {
-               desc            => "permissions tty2:::0777",
-               subsys          => "tty",
-               devpath         => "/class/tty/tty2",
-               exp_name        => "tty2",
-               exp_perms       => "0:0:0777",
-               conf            => <<EOF
-KERNEL="tty2", NAME="tty2"
-EOF
-       },
-       {
-               desc            => "permissions tty3::: (default mode applied)",
-               subsys          => "tty",
-               devpath         => "/class/tty/tty3",
-               exp_name        => "tty3",
-               exp_perms       => "0:0:600",
-               conf            => <<EOF
-KERNEL="tty3", NAME="tty3"
-EOF
-       },
-       {
-               desc            => "permissions i2c-300:root:sys:0744",
-               subsys          => "i2c-dev",
-               devpath         => "/class/i2c-dev/i2c-300",
-               exp_name        => "i2c-300",
-               exp_perms       => "0:3:0744",
-               conf            => <<EOF
-KERNEL="i2c-300", NAME="i2c-300"
-EOF
-       },
-       {
-               desc            => "permissions i2c-fake1:root:7:0007",
-               subsys          => "i2c-dev",
-               devpath         => "/class/i2c-dev/i2c-fake1",
-               exp_name        => "i2c-fake1",
-               exp_perms       => "0:7:0007",
-               conf            => <<EOF
-KERNEL="i2c-fake1", NAME="i2c-fake1"
-EOF
-       },
-       {
-               desc            => "permissions ttyS[01]:0:5:0700",
-               subsys          => "tty",
-               devpath         => "/class/tty/ttyS1",
-               exp_name        => "ttyS1",
-               exp_perms       => "0:5:0700",
-               conf            => <<EOF
-KERNEL="ttyS1", NAME="ttyS1"
-EOF
-       },
-       {
-               desc            => "permissions ttyS[4-9]:tty:5:0060",
-               subsys          => "tty",
-               devpath         => "/class/tty/ttyS7",
-               exp_name        => "ttyS7",
-               exp_perms       => "0:5:0060",
-               conf            => <<EOF
-KERNEL="ttyS7", NAME="ttyS7"
-EOF
-       },
-       {
-               desc            => "permissions tty4:0:5:0707",
-               subsys          => "ttyS4",
-               devpath         => "/class/tty/tty4",
-               exp_name        => "tty4",
-               exp_perms       => "0:5:0707",
-               conf            => <<EOF
-KERNEL="tty4", NAME="tty4"
-EOF
-       },
-       {
-               desc            => "permissions tty4?:0:5:0007",
-               subsys          => "tty",
-               devpath         => "/class/tty/tty44",
-               exp_name        => "tty44",
-               exp_perms       => "0:5:0007",
-               conf            => <<EOF
-KERNEL="tty44", NAME="tty44"
-EOF
-       },
-       {
-               desc            => "permissions tty3[!3]:::0467",
-               subsys          => "tty",
-               devpath         => "/class/tty/tty35",
-               exp_name        => "tty35",
-               exp_perms       => "0:0:0467",
-               conf            => <<EOF
-KERNEL="tty35", NAME="tty35"
-EOF
-       },
-       {
-               desc            => "permissions tty33:bad:name:0500",
+               desc            => "permissions USER=bad GROUP=name",
                subsys          => "tty",
                devpath         => "/class/tty/tty33",
                exp_name        => "tty33",
-               exp_perms       => "0:0:0500",
-               conf            => <<EOF
-KERNEL="tty33", NAME="tty33"
-EOF
-       },
-       {
-               desc            => "permissions rtc:0:users:0600",
-               subsys          => "misc",
-               devpath         => "/class/misc/rtc",
-               exp_name        => "misc/rtc",
-               exp_perms       => "0:100:0600",
+               exp_perms       => "0:0:0600",
                conf            => <<EOF
-KERNEL="rtc", NAME="misc/rtc"
+KERNEL="tty33", NAME="tty33", OWNER="bad", GROUP="name"
 EOF
        },
        {
-               desc            => "permissions misc:0:users:0600",
-               subsys          => "misc",
-               devpath         => "/class/misc/psaux",
-               exp_name        => "misc/psaux",
-               exp_perms       => "0:100:0600",
-               conf            => <<EOF
-KERNEL="psaux", NAME="misc/psaux"
-EOF
-       },
-       {
-               desc            => "permissions set OWNER=5000",
+               desc            => "permissions OWNER=5000",
                subsys          => "block",
                devpath         => "/block/sda",
                exp_name        => "node",
@@ -673,7 +522,7 @@ BUS="scsi", KERNEL="sda", NAME="node", OWNER="5000"
 EOF
        },
        {
-               desc            => "permissions set GROUP=100",
+               desc            => "permissions GROUP=100",
                subsys          => "block",
                devpath         => "/block/sda",
                exp_name        => "node",
@@ -683,7 +532,7 @@ BUS="scsi", KERNEL="sda", NAME="node", GROUP="100"
 EOF
        },
        {
-               desc            => "permissions set mode=0777",
+               desc            => "permissions MODE=0777",
                subsys          => "block",
                devpath         => "/block/sda",
                exp_name        => "node",
@@ -693,7 +542,7 @@ BUS="scsi", KERNEL="sda", NAME="node", MODE="0777"
 EOF
        },
        {
-               desc            => "permissions set OWNER=5000 GROUP=100 MODE=0777",
+               desc            => "permissions OWNER=5000 GROUP=100 MODE=0777",
                subsys          => "block",
                devpath         => "/block/sda",
                exp_name        => "node",
@@ -703,37 +552,37 @@ BUS="scsi", KERNEL="sda", NAME="node", OWNER="5000", GROUP="100", MODE="0777"
 EOF
        },
        {
-               desc            => "permissions override OWNER to 5000",
+               desc            => "permissions OWNER to 5000",
                subsys          => "tty",
                devpath         => "/class/tty/ttyUSB0",
                exp_name        => "ttyUSB0",
-               exp_perms       => "5000:14:0660",
+               exp_perms       => "5000::",
                conf            => <<EOF
 KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n", OWNER="5000"
 EOF
        },
        {
-               desc            => "permissions override GROUP to 100",
+               desc            => "permissions GROUP to 100",
                subsys          => "tty",
                devpath         => "/class/tty/ttyUSB0",
                exp_name        => "ttyUSB0",
-               exp_perms       => ":100:0660",
+               exp_perms       => ":100:0600",
                conf            => <<EOF
 KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n", GROUP="100"
 EOF
        },
        {
-               desc            => "permissions override MODE to 0060",
+               desc            => "permissions MODE to 0060",
                subsys          => "tty",
                devpath         => "/class/tty/ttyUSB0",
                exp_name        => "ttyUSB0",
-               exp_perms       => ":14:0060",
+               exp_perms       => "::0060",
                conf            => <<EOF
 KERNEL="ttyUSB[0-9]*", NAME="ttyUSB%n", MODE="0060"
 EOF
        },
        {
-               desc            => "permissions override OWNER, GROUP, MODE",
+               desc            => "permissions OWNER, GROUP, MODE",
                subsys          => "tty",
                devpath         => "/class/tty/ttyUSB0",
                exp_name        => "ttyUSB0",
@@ -1336,7 +1185,9 @@ open CONF, ">$main_conf" || die "unable to create config file: $main_conf";
 print CONF "udev_root=\"$udev_root\"\n";
 print CONF "udev_db=\"$udev_db\"\n";
 print CONF "udev_rules=\"$conf_tmp\"\n";
-print CONF "udev_permissions=\"$perm\"\n";
+print CONF "default_mode=\"0600\"\n";
+print CONF "default_owner=\"root\"\n";
+print CONF "default_group=\"root\"\n";
 close CONF;
 
 my $test_num = 1;
diff --git a/test/udev.permissions b/test/udev.permissions
deleted file mode 100644 (file)
index b7baeea..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#name:user:group:mode
-ttyUSB0:root:uucp:0660
-ttyUSB1:root:uucp:0666
-visor:500:500:0666
-dsp1:::0666
-boot_disk?:::0666
-
-#used for permissions tests in udev-test.pl
-tty0::root:0444
-tty1:root::0555
-tty2:::0777
-tty3:::
-rtc:0:6:0770
-misc/*:0:users:0600
-i2c-fake1:root:7:0007
-i2c*:root:sys:0744
-ttyS[01]:0:5:0700
-ttyS[5-9]:root:5:0060
-tty4::tty:0707
-tty4?::tty:0007
-tty3[!3]:::0467
-tty33:bad:name:0500
index 328f602e031708640023afbe938a4a39ce1b938b..90b7d833093b0d0653258df94100a58faf6f9062 100644 (file)
--- a/udev.8.in
+++ b/udev.8.in
@@ -55,13 +55,6 @@ The name of the udev rules file or directory to look for files with the suffix
 All rule files are read in lexical order. The default value is
 .IR /etc/udev/rules.d/ .
 .TP
-.B udev_permissions
-The name of the udev permission file or directory to look for files with the
-suffix
-.IR .permissions .
-All permission files are read in lexical order. The default value is
-.IR /etc/udev/permissions.d/ .
-.TP
 .B udev_log
 The switch to enable/disable logging of udev information
 The default value is
@@ -96,10 +89,6 @@ udev_db="/udev/.udevdb"
                for files with the suffix .rules
 udev_rules="/etc/udev/rules.d/"
 
-# udev_permissions - The name of the udev permission file or directory
-                     to look for files with the suffix .permissions
-udev_permissions="/etc/udev/udev.permissions"
-
 # udev_log - set to "yes" if you want logging, else "no"
 udev_log="yes"
 
@@ -214,8 +203,8 @@ separate rules file, while the device nodes are maintained by the
 distribution provided rules file.
 .TP
 .B OWNER, GROUP, MODE
-The permissions for this device. Every specified value overwrites the value
-given in the permissions file.
+The permissions for this device. Every specified value overwrites the default
+value specified in the config file.
 .P
 .RB "The " NAME " ," SYMLINK " and " PROGRAM
 fields support simple printf-like string substitutions:
@@ -299,29 +288,6 @@ KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom",
   NAME="%k", SYMLINK="cdrom%e"
 .fi
 .P
-The permissions and ownership of the created device file are read from
-the files located in the
-.I /etc/udev/permissions.d/
-directory, or at the location specified by the
-.I udev_permission
-value in the
-.I /etc/udev/udev.conf
-file.
-.br
-Every line lists a device name followed by owner, group and permission
-mode. All values are separated by colons. The name field may contain a
-pattern to apply the values to a whole class of devices.
-.sp
-.RI "A sample " udev.permissions " file might look like this:"
-.sp
-.nf
-#name:user:group:mode
-input/*:root:root:644
-ttyUSB1:0:8:0660
-video*:root:video:0660
-dsp1:::0666
-.fi
-.P
 A number of different fields in the above configuration files support a simple
 form of shell style pattern matching. It supports the following pattern characters:
 .TP
diff --git a/udev.c b/udev.c
index 0895e437ba76d6077c30ab5d685c7fca1be8bef7..e5d7800ecf73f5d3173d71f791e0c6ee614a6f83 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -187,7 +187,7 @@ int main(int argc, char *argv[], char *envp[])
 
                        wait_for_class_device(class_dev, &error);
 
-                       /* init rules, permissions */
+                       /* init rules */
                        namedev_init();
 
                        /* name, create node, store in db */
diff --git a/udev.h b/udev.h
index 7038376b3c23ab44ea4b83e69e705e5010fa428e..0111644efffd5612f77b37e99962f82ba0b2c844 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -80,7 +80,6 @@ extern void udev_multiplex_directory(struct udevice *udev, const char *basedir,
 extern char sysfs_path[SYSFS_PATH_MAX];
 extern char udev_root[PATH_MAX];
 extern char udev_db_path[PATH_MAX+NAME_MAX];
-extern char udev_permissions_filename[PATH_MAX+NAME_MAX];
 extern char udev_config_filename[PATH_MAX+NAME_MAX];
 extern char udev_rules_filename[PATH_MAX+NAME_MAX];
 extern mode_t default_mode;
index c0aacc954c04d98b53c33b49fc775d8eea746515..46eaf698f86537c86bec6e0f304f2ac6e092f876 100644 (file)
--- a/udev.spec
+++ b/udev.spec
@@ -98,7 +98,6 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 %doc COPYING README TODO ChangeLog HOWTO* docs/*
 %doc etc/udev/udev.rules.{examples,gentoo,redhat}
-%doc etc/udev/udev.permissions.{gentoo,redhat}
 %attr(755,root,root) /sbin/udev
 %attr(755,root,root) /usr/bin/udevinfo
 %attr(755,root,root) /sbin/udevsend
@@ -109,9 +108,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %dir /etc/udev/
 %config(noreplace) %attr(0644,root,root) /etc/udev/udev.conf
 %attr(755,root,root) %dir /etc/udev/rules.d/
-%attr(755,root,root) %dir /etc/udev/permissions.d/
 %config(noreplace) %attr(0644,root,root) /etc/udev/rules.d/50-udev.rules
-%config(noreplace) %attr(0644,root,root) /etc/udev/permissions.d/50-udev.permissions
 %attr(-,root,root) /etc/hotplug.d/default/udev.hotplug
 %attr(755,root,root) /etc/init.d/udev
 %attr(0644,root,root) %{_mandir}/man8/udev*.8*
index 62eb728ea3283ec5c322bf7542699b1879e9b1fd..a5f64677482199466392abbd5156d905b14913f0 100644 (file)
@@ -43,7 +43,6 @@
 char sysfs_path[SYSFS_PATH_MAX];
 char udev_root[PATH_MAX];
 char udev_db_path[PATH_MAX+NAME_MAX];
-char udev_permissions_filename[PATH_MAX+NAME_MAX];
 char udev_rules_filename[PATH_MAX+NAME_MAX];
 char udev_config_filename[PATH_MAX+NAME_MAX];
 mode_t default_mode;
@@ -74,7 +73,6 @@ static void init_variables(void)
        strcpy(udev_db_path, UDEV_DB);
        strcpy(udev_config_filename, UDEV_CONFIG_FILE);
        strcpy(udev_rules_filename, UDEV_RULES_FILE);
-       strcpy(udev_permissions_filename, UDEV_PERMISSION_FILE);
 
        strcpy(default_owner, "root");
        strcpy(default_group, "root");
@@ -206,12 +204,6 @@ static int parse_config_file(void)
                        continue;
                }
 
-               if (strcasecmp(variable, "udev_permissions") == 0) {
-                       strfieldcpy(udev_permissions_filename, value);
-                       no_trailing_slash(udev_permissions_filename);
-                       continue;
-               }
-
                if (strcasecmp(variable, "default_mode") == 0) {
                        default_mode = strtol(value, NULL, 8);
                        continue;
@@ -267,7 +259,6 @@ static void get_dirs(void)
        dbg_parse("udev_config_filename = %s", udev_config_filename);
        dbg_parse("udev_db_path = %s", udev_db_path);
        dbg_parse("udev_rules_filename = %s", udev_rules_filename);
-       dbg_parse("udev_permissions_filename = %s", udev_permissions_filename);
        dbg_parse("udev_log = %d", udev_log);
 
        parse_config_file();
@@ -276,7 +267,6 @@ static void get_dirs(void)
        dbg("udev_config_filename = %s", udev_config_filename);
        dbg("udev_db_path = %s", udev_db_path);
        dbg("udev_rules_filename = %s", udev_rules_filename);
-       dbg("udev_permissions_filename = %s", udev_permissions_filename);
        dbg("udev_log = %d", udev_log);
 }