From: Karel Zak Date: Wed, 27 Mar 2013 13:50:52 +0000 (+0100) Subject: sulogin: don't run if not found passww entry [coverity scan] X-Git-Tag: v2.23-rc2~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad85c7bad93613fd4b3110b6dac7fd2fea7295f3;p=thirdparty%2Futil-linux.git sulogin: don't run if not found passww entry [coverity scan] sulogin(8) should not run if there is no /etc/{passwd,shadow} entry and --force command line option is no specified otherwise NULL pointer dereference is possible. Signed-off-by: Karel Zak --- diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c index 621df1e4fc..71308583c3 100644 --- a/login-utils/sulogin.c +++ b/login-utils/sulogin.c @@ -877,6 +877,7 @@ int main(int argc, char **argv) if ((pwd = getrootpwent(opt_e)) == NULL) { warnx(_("cannot open password database.")); sleep(2); + return EXIT_FAILURE; } /*