[BusyBox] Re: login buggy also in 1.00pre5

Stewart Brodie stewart at metahusky.net
Tue Jan 6 14:34:12 UTC 2004


Friedrich Lobenstock <fl at fl.priv.at> wrote:

> Tito wrote on 06.01.2004 15:38 MET:
> > 2) and a suspicious line at 221
> > 	if ( check_nologin ( pw-> pw_uid == 0 ))
> > 		return EXIT_FAILURE;
> > Should it not be ?
> > 	if ( check_nologin ( pw-> pw_uid ) == 0 )
> > 		return EXIT_FAILURE;
> 
> NO, that breaks it even more - it will not even work in cases
> it worked before.
> 
> The "( pw-> pw_uid == 0 )" produces a true only if the current
> user is root because he is allowed to login every time. So the
> code is correct.
> 
> The code would probably be more readable if the check_nologin
> function itself would compare the pw-> pw_uid (or an integer
> parameter user) against zero.

Perhaps it would be sensible to do a similar thing to the Linux kernel and
introduce a function which determines whether or not you are a superuser and
use that instead of getting and comparing UIDs with 0.

-- 
Stewart Brodie



More information about the busybox mailing list