chiark / gitweb /
[PATCH] complete removal of explicit udev permissions config file
[elogind.git] / namedev.c
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;
-}