login: don't print motd if .hushlogin exists in users home
authorSören Tempel <soeren@soeren-tempel.net>
Mon, 24 Aug 2015 20:16:48 +0000 (22:16 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 24 Aug 2015 20:16:48 +0000 (22:16 +0200)
function                                             old     new   delta
login_main                                           978     996     +18

Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/login.c

index b9d910331e0a97bae3e91cc77f9cc1006730ee79..1700cfcb568a47a8e42fe890f28d0ef272fda646 100644 (file)
@@ -489,7 +489,8 @@ int login_main(int argc UNUSED_PARAM, char **argv)
        }
 #endif
 
-       motd();
+       if (access(".hushlogin", F_OK) != 0)
+               motd();
 
        if (pw->pw_uid == 0)
                syslog(LOG_INFO, "root login%s", fromhost);