mdev: handle string modes
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 26 Oct 2009 22:27:05 +0000 (23:27 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 27 Oct 2009 16:13:12 +0000 (17:13 +0100)
parse ugoa=rwxXst via bb_parse_mode (+5b)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/mdev.c

index d0aafac6e65674bb6fd8dcebc65459c1f2550b7e..e4bc6653d9aa3475e397ab555890efcdf7814fd9 100644 (file)
@@ -111,7 +111,7 @@ static void make_device(char *path, int delete)
 {
        char *device_name;
        int major, minor, type, len;
-       int mode;
+       mode_t mode;
        parser_t *parser;
 
        /* Try to read major/minor string.  Note that the kernel puts \n after
@@ -249,7 +249,8 @@ static void make_device(char *path, int delete)
                                bb_error_msg("unknown user/group %s", tokens[1]);
 
                        /* 3rd field: mode - device permissions */
-                       mode = strtoul(tokens[2], NULL, 8);
+                       /* mode = strtoul(tokens[2], NULL, 8); */
+                       bb_parse_mode(tokens[2], &mode);
 
                        val = tokens[3];
                        /* 4th field (opt): >|=alias */