[PATCH] reminder: adduser is broken in 1.6.x

Natanael Copa natanael.copa at gmail.com
Sat Jul 14 20:21:55 UTC 2007


Denis,

Maybe you missed this while you were away so I send again.

Adduser fails to create the user when ENABLE_FEATURE_CLEAN_UP is
disabled.

The reason is that adduser will exec passwd without first flushing the
previously written /etc/passwd (and /etc/shadow). passwd will fail
because the user does not exist until files are flushed. But the flush
never comes because the buffered file handles are lost in the exec
operation.

Attatched patch fixes this by flushing all file handles before exiting.

Alternative fix would be to close the files regardless FEATURE_CLEAN_UP
but we save a few bytes with one fflush(NULL) over 2 fclose() (in case
shadow passwords are enabled)

Please add this to 1.6.1 fixes.

Natanael Copa

-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.6.1-adduser.patch
Type: text/x-patch
Size: 502 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070714/1a1d6470/attachment-0002.bin 


More information about the busybox mailing list