On Thursday 19 July 2007 21:37, Alexander Shishkin wrote:
> On 7/19/07, Tito <[EMAIL PROTECTED]> wrote:
> > Hi,
> Hi,
>
> > attached you will find a drop in replacement
> > for chpasswd.c with some more busyboxification
> > (use of getopt32 and syslogging capabilities of
> > bb_*_msg_* functions) and some things it seems to me that
> > need to be fixed (this could be done to me being in hurry
> > and not understanding you code... in this case ignore it).
> > This code is only compile tested and needs more care and love. ;-)
> Thanks for pointing these things out! I've done some more tweaking on
> the applet. Attached please find an updated patch.
Question: why malformed line without password results in warning,
but invalid username aborts?
bb_error_msg("missing new password");
continue;
}
*pass++ = '\0';
if (!getpwnam(name))
bb_error_msg_and_die("unknown user %s", name);
Seems inconsistent to me.
Btw, do we need to check that user exists? Without such check,
nonexistent users are just ignored and code is smaller.
Testing it. Nice:
echo -e "guest:qqqq\ntest:qqqq" | ./busybox chpasswd
and crypt_make_salt() generates same salt for both! :))
Bunch of other bugs too: shadow passwords check is backwards,...
Applied to svn. Enjoy/test.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox