[PATCH] reminder: adduser is broken in 1.6.x
Denis Vlasenko
vda.linux at googlemail.com
Sat Jul 14 22:47:06 UTC 2007
On Saturday 14 July 2007 21:21, Natanael Copa wrote:
> 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.
Applied to svn and added to 1.6.1 hot fixes directory.
Thanks.
--
vda
More information about the busybox
mailing list