mdev : bug corrected (patch attached) - recursive_action version
Mike Frysinger
vapier at gentoo.org
Wed Jun 13 09:25:13 UTC 2007
On Monday 11 June 2007, Renaud Cerrato wrote:
> Here's the patch correcting mdev, using recursive_action :
>
> 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).
almost ... you introduced a little memory corruption there and that's no
good ;)
(notice how make_dev() requires the string be writable and that there be 64
bytes to spare at the end)
but otherwise, recursive_action() is good stuff
try out current svn now please
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070613/d3e9983e/attachment-0002.pgp
More information about the busybox
mailing list