Skip to contentSkip to conversation

uninitialized variable for mknod and friend

PATCH In review Olaf Hering 2 participants 2 messages Mar 18, 2004 – Mar 23, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uninitialized variable for mknod and friend

mknod gets an uninitialized variable, which leads to interesting file modes. the bug is in namedev, devices with no match must not use the uninitialized stuff were dev points to.

namedev.c 2004-03-18 16:31:41.000000000 +0000 renamed from namedev.c 2004-03-18 14:35:19.000000000 +0000 +1 -1
@@ -840,12 +840,12 @@ found:
        apply_format(udev, udev->symlink, sizeof(udev->symlink), class_dev, sysfs_device);
        udev->partitions = dev->partitions;
 
-done:  
        /* get permissions given in rule */
        set_empty_perms(udev, dev->mode,
                              dev->owner,
                              dev->group);
 
+done:  
        /* get permissions given in config file or set defaults */
        perm = find_perm(udev->name);
        if (perm != NULL) {
Signature · 14 lines
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op�k
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#1 lore raw
Quoted 4 lines · Olaf Hering

mknod gets an uninitialized variable, which leads to interesting file modes. the bug is in namedev, devices with no match must not use the uninitialized stuff were dev points to.

Good catch. Thanks, I've applied this.

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel