[BusyBox] Re: login buggy also in 1.00pre5

Friedrich Lobenstock fl at fl.priv.at
Tue Jan 6 14:25:12 UTC 2004


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.

-- 
MfG / Regards
Friedrich Lobenstock




More information about the busybox mailing list