Bug 61354 - login(1) prints last login time for 'hushlogin' configuration
Summary: login(1) prints last login time for 'hushlogin' configuration
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 5.2-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-14 09:20 UTC by Eugene Grosbein
Modified: 2004-01-26 20:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Grosbein 2004-01-14 09:20:19 UTC
		
	login(1) man page says that login prints nothing when
	"hushlogin" option is used. That is true for 4.x
	and not true for 5.2-CURRENT (15 Dec 2003): it prints
	last login time. It can break non-human applications.

Fix: 

Unknown.
How-To-Repeat: 
	touch ~$USER/.hushlogin
	login $USER
Comment 1 Eugene Grosbein 2004-01-14 09:42:39 UTC
Hi!

Here is a patch:

--- login.c.orig        Wed Jan 14 16:21:58 2004
+++ login.c     Wed Jan 14 16:37:16 2004
@@ -356,8 +356,6 @@
        lc = login_getpwclass(pwd);
 
        quietlog = login_getcapbool(lc, "hushlogin", 0);
-       if (!quietlog)
-               pam_silent = 0;
 
        /*
         * Switching needed for NFS with root access disabled.
@@ -385,6 +383,8 @@
        (void)setegid(egid);
        if (!quietlog)
                quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0;
+       if (!quietlog)
+               pam_silent = 0;
 
        shell = login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell);
        if (*pwd->pw_shell == '\0')


Eugene Grosbein
Comment 2 Max Khon freebsd_committer freebsd_triage 2004-01-26 20:06:53 UTC
State Changed
From-To: open->closed

I committed slightly modified version of this fix. Please test. 
Thanks for the report!