chiark / gitweb /
[PATCH] remove default_* permissions from udev.conf file
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Tue, 21 Dec 2004 05:10:57 +0000 (06:10 +0100)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 06:19:09 +0000 (23:19 -0700)
With the "permissions only rules" we can just place:

   MODE="0660", OWNER="root", GROUP="root"

at the beginning of the rules file and get exactly the same behavior.
If no values are given the compiled-in defaults are used.

etc/udev/udev.conf.in
test/udev-test.pl
udev.8.in
udev.h
udev_config.c
udev_utils.c

index a4a79ad5c2aab266a6b126854df284d8941f493b..72e25ed48269525d49eea511ce99cc06ab1fcd48 100644 (file)
@@ -14,18 +14,6 @@ udev_db="@udevdir@/.udevdb"
 # udev_rules - The name and location of the udev rules file
 udev_rules="@configdir@/rules.d"
 
 # udev_rules - The name and location of the udev rules file
 udev_rules="@configdir@/rules.d"
 
-# default_mode - set the default mode for all nodes that have no
-#                permissions specified
-default_mode="0660"
-
-# default_owner - set the default owner for all nodes that have no
- #                permissions specified
-default_owner="root"
-
-# default_group - set the default group for all nodes that have no
- #                permissions specified
-default_group="root"
-
 # udev_log - set to "yes" if you want logging, else "no"
 udev_log="yes"
 
 # udev_log - set to "yes" if you want logging, else "no"
 udev_log="yes"
 
index b50554ceb9b35f297f3c3d0a531951ee7f3ec3f5..67c06727597614670f706932088fe3e384a12fcf 100644 (file)
@@ -1255,9 +1255,6 @@ 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_root=\"$udev_root\"\n";
 print CONF "udev_db=\"$udev_db\"\n";
 print CONF "udev_rules=\"$conf_tmp\"\n";
-print CONF "default_mode=\"0660\"\n";
-print CONF "default_owner=\"root\"\n";
-print CONF "default_group=\"root\"\n";
 close CONF;
 
 my $test_num = 1;
 close CONF;
 
 my $test_num = 1;
index 0cc2f939e3fa77dc924263273e16386e4d1384cb..4b8691f84265ab109ad402d13753dd6bef0c3d4b 100644 (file)
--- a/udev.8.in
+++ b/udev.8.in
@@ -59,22 +59,6 @@ All rule files are read in lexical order. The default value is
 The switch to enable/disable logging of udev information
 The default value is
 .IR yes .
 The switch to enable/disable logging of udev information
 The default value is
 .IR yes .
-.TP
-.B default_mode
-The default mode for all nodes where no explicit value is given by a rule.
-The default value is
-.IR 0660 .
-.TP
-.B default_owner
-The default owner for all nodes where no explicit value is given by a rule.
-The default value is
-.IR root .
-.TP
-.B default_group
-The default group for all nodes where no explicitly value is given by a rule.
-The default value is
-.IR root .
-.br
 .P
 .RI "A sample " udev.conf " file might look like this:
 .sp
 .P
 .RI "A sample " udev.conf " file might look like this:
 .sp
@@ -91,18 +75,6 @@ udev_rules="/etc/udev/rules.d/"
 
 # udev_log - set to "yes" if you want logging, else "no"
 udev_log="yes"
 
 # udev_log - set to "yes" if you want logging, else "no"
 udev_log="yes"
-
-# default_mode - set the default mode for all nodes that have no
-#                permissions specified
-default_mode="0660"
-
-# default_owner - set the default owner for all nodes that have no
-#                 permissions specified
-default_owner="root"
-
-# default_group - set the default group for all nodes that have no
-#                 permissions specified
-default_group="root"
 .fi
 .P
 The rules for device naming are read from the files located in the
 .fi
 .P
 The rules for device naming are read from the files located in the
diff --git a/udev.h b/udev.h
index 80eafb0d46a25e7318b67f38fe0529c50ad789a6..07385ccec551930ce98a68fc9eb293c48cba4419 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -81,9 +81,6 @@ extern char udev_root[PATH_MAX];
 extern char udev_db_path[PATH_MAX+NAME_MAX];
 extern char udev_config_filename[PATH_MAX+NAME_MAX];
 extern char udev_rules_filename[PATH_MAX+NAME_MAX];
 extern char udev_db_path[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;
-extern char default_owner[USER_SIZE];
-extern char default_group[USER_SIZE];
 extern int udev_log;
 extern int udev_dev_d;
 extern int udev_hotplug_d;
 extern int udev_log;
 extern int udev_dev_d;
 extern int udev_hotplug_d;
index da8c676d04f9a49f455f02e2053101fe3f758425..21b62488c00ad2b59d8dfc390c9db7bebc801002 100644 (file)
@@ -45,9 +45,6 @@ char udev_root[PATH_MAX];
 char udev_db_path[PATH_MAX+NAME_MAX];
 char udev_rules_filename[PATH_MAX+NAME_MAX];
 char udev_config_filename[PATH_MAX+NAME_MAX];
 char udev_db_path[PATH_MAX+NAME_MAX];
 char udev_rules_filename[PATH_MAX+NAME_MAX];
 char udev_config_filename[PATH_MAX+NAME_MAX];
-mode_t default_mode;
-char default_owner[USER_SIZE];
-char default_group[USER_SIZE];
 int udev_log;
 int udev_dev_d;
 int udev_hotplug_d;
 int udev_log;
 int udev_dev_d;
 int udev_hotplug_d;
@@ -74,10 +71,6 @@ static void init_variables(void)
        strcpy(udev_config_filename, UDEV_CONFIG_FILE);
        strcpy(udev_rules_filename, UDEV_RULES_FILE);
 
        strcpy(udev_config_filename, UDEV_CONFIG_FILE);
        strcpy(udev_rules_filename, UDEV_RULES_FILE);
 
-       strcpy(default_owner, "root");
-       strcpy(default_group, "root");
-       default_mode = 0660;
-
        udev_log = string_is_true(UDEV_LOG_DEFAULT);
 
        udev_dev_d = 1;
        udev_log = string_is_true(UDEV_LOG_DEFAULT);
 
        udev_dev_d = 1;
@@ -169,21 +162,6 @@ static int parse_config_file(void)
                        continue;
                }
 
                        continue;
                }
 
-               if (strcasecmp(variable, "default_mode") == 0) {
-                       default_mode = strtol(value, NULL, 8);
-                       continue;
-               }
-
-               if (strcasecmp(variable, "default_owner") == 0) {
-                       strfieldcpy(default_owner, value);
-                       continue;
-               }
-
-               if (strcasecmp(variable, "default_group") == 0) {
-                       strfieldcpy(default_group, value);
-                       continue;
-               }
-
                if (strcasecmp(variable, "udev_log") == 0) {
                        udev_log = string_is_true(value);
                        continue;
                if (strcasecmp(variable, "udev_log") == 0) {
                        udev_log = string_is_true(value);
                        continue;
index fe18892de19fa2eeb3332ad526b8b5c533430cd9..3c5344a8f987782e23d432984f7ec2ac71ff5aa3 100644 (file)
@@ -57,9 +57,9 @@ void udev_init_device(struct udevice *udev, const char* devpath, const char *sub
        else if (strncmp(udev->devpath, "/class/", 7) == 0)
                udev->type = 'c';
 
        else if (strncmp(udev->devpath, "/class/", 7) == 0)
                udev->type = 'c';
 
-       udev->mode = default_mode;
-       strfieldcpy(udev->owner, default_owner);
-       strfieldcpy(udev->group, default_group);
+       udev->mode = 0660;
+       strcpy(udev->owner, "root");
+       strcpy(udev->group, "root");
 }
 
 int kernel_release_satisfactory(int version, int patchlevel, int sublevel)
 }
 
 int kernel_release_satisfactory(int version, int patchlevel, int sublevel)