Fix makedevs to allow longer path names
authorJulian Lunz <git@jlunz.de>
Sun, 8 Apr 2012 10:32:51 +0000 (12:32 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Sun, 8 Apr 2012 17:46:52 +0000 (19:46 +0200)
Makedevs path name is currently limited to 40, changed it to
PATH_MAX 4096 from linux/include/linux/limits.h
Signed-off-by: Julian Lunz <git@jlunz.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/makedevs/makedevs.c

index 5d5668de6e1565b83732e0d610dbcafcb95cf166..ab90b93b19076ae16a44e7acd469adea213c587c 100644 (file)
@@ -410,7 +410,7 @@ int main(int argc, char **argv)
                unsigned int count = 0;
                unsigned int increment = 0;
                unsigned int start = 0;
-               char name[41];
+               char name[4096];
                char user[41];
                char group[41];
                char *full_name;
@@ -419,7 +419,7 @@ int main(int argc, char **argv)
 
                linenum++;
 
-               if ((2 > sscanf(line, "%40s %c %o %40s %40s %u %u %u %u %u", name,
+               if ((2 > sscanf(line, "%4095s %c %o %40s %40s %u %u %u %u %u", name,
                                                &type, &mode, user, group, &major,
                                                &minor, &start, &increment, &count)) ||
                                ((major | minor | start | count | increment) > 0xfffff))