mdev : bug corrected (patch attached)

Renaud Cerrato renaud at toutsimplement.org
Fri Jun 1 13:15:10 UTC 2007


Dear,

Using mdev, we noticed that some devices were not attached to /dev/ using
"mdev -s".
Looking at the source code, the function which walk through the /sys/ tree
make use of lstat, but the /sys tree can use symlink as seen here :

$ ls -l /sys/class/misc/
lrwxrwxrwx    1 root     root            0 Jan  1  1970 watchdog ->
../../devices/platform/at91sam9x_wdt/watchdog

Doing so, the function can't walk through symbolic links. By replacing lstat
by stat, the problem is corrected.
To avoid infinite loop, we added a walking through depth limit to 2 (see
udevstart.c).

Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070601/9281b495/attachment-0002.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdev.patch
Type: text/x-patch
Size: 1681 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070601/9281b495/attachment-0002.bin 


More information about the busybox mailing list