mdev : bug corrected (patch attached) - recursive_action version

Renaud Cerrato renaud at toutsimplement.org
Wed Jun 13 10:04:52 UTC 2007


Damned. I was too hurry (too much job in same time!). Thanks for noticing.
Heres the correction.


2007/6/13, Mike Frysinger <vapier at gentoo.org>:
>
> 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 --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070613/1601eded/attachment-0002.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdev.patch
Type: text/x-patch
Size: 2776 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070613/1601eded/attachment-0002.bin 


More information about the busybox mailing list