Comment 3 for bug 591807

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

I seem to have forgotten my usual umask() diligence around this block (it's there in every other, e.g. just above it) - I guess because this was rushed at the last minute.

The code should almost certainly read:

+ mask = umask (0022);
                        mkdir ("/dev/.udev", 0755);
                        mkdir ("/dev/.udev/rules.d", 0755);
                        rules = fopen ("/dev/.udev/rules.d/root.rules", "w");
                        if (rules) {
                                fprintf (rules, ("SUBSYSTEM==\"block\", "
                                                 "ENV{MAJOR}==\"%d\", "
                                                 "ENV{MINOR}==\"%d\", "
                                                 "SYMLINK+=\"root\"\n"),
                                         major (root->mounted_dev),
                                         minor (root->mounted_dev));
                                fclose (rules);
                        }
+ umask (mask);