summaryrefslogtreecommitdiffstats
path: root/usr.bin/login/login.c
Commit message (Collapse)AuthorAgeFilesLines
* login.c doesn't really need libutil.h, don't include it.delphij2015-09-101-1/+0
| | | | | | | login_fbtab.c includes paths.h and pathnames.h, and pathnames.h includes paths.h. Eliminate the paths.h inclusion in login_fbtab.c. MFC after: 2 weeks
* Remove LOG_ODELAY because it does nothing.neel2014-08-171-1/+1
| | | | | Reviewed by: jilles CR: https://reviews.freebsd.org/D611
* login: Remove broken dialup log message.jilles2014-04-191-8/+0
| | | | | | | | | | For 10 years, the "DIALUP <tty>, <user>" message has required having a hostname (-h) instead of not having a hostname; therefore, it is never logged. Given that dialup is obsolete and this has not been fixed, remove the log message. Note that LOGALL, which is defined by default, logs a message for all logins, including dialup logins.
* login: Clean up PAM and audit, then exit, on SIGHUP and SIGTERM.jilles2014-01-261-18/+77
| | | | | | | | | | | | | | | | | This avoids leaving stale entries in utmpx after the connection is closed on an open login session. It also allows a clean way (SIGTERM) to forcibly terminate a user's terminal session. This does not affect the situation for "hung" processes after the connection is closed. The foreground process group receives SIGHUP and the tty becomes inaccessible. Also replace all use of the obsolete signal() function with sigaction() (not only the part where it is actually required: SIGHUP and SIGTERM must mask the other as well when caught). PR: misc/183495 Reviewed by: ed
* Fix whitespace.ed2013-11-131-8/+8
|
* Call pam_setcred() before login_getpwclass to support home directoriesdfr2011-05-031-2/+14
| | | | | on GSS-API authenticated NFS where the kerberos credentials need to be saved so that the kernel can authenticate to the NFS server.
* Get rid of hand-rolled closefrom(3).ed2010-10-201-2/+1
|
* Remove copyright strings printed at login time via login(1) or sshd(8).emaste2010-09-281-7/+0
| | | | | | | | | | It is not clear to what this copyright should apply, and this is in line with what other operating systems do. For ssh specifically, printing of the copyright string is not in the upstream version so this reduces our FreeBSD-local diffs. Approved by: core, des (ssh)
* ANSIfy various tools in usr.bin/.ed2010-01-021-4/+4
| | | | | Most of these tools properly build at WARNS=6, except for their K&R function declarations. Fix this, so we can bump WARNS as well.
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-131-1/+1
| | | | needed.
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-111-1/+1
| | | | Tested with: make universe
* Don't strip TTY device name to the last '/'.ed2009-03-271-2/+2
| | | | | | | | | | | | | We've seen this bug in other applications before: we have some applications that use strrchr(tty, '/') on the TTY device name. This isn't valid when using pts(4), because the device name will be stripped to "0" instead of "pts/0". This fixes issues with login(1) ignoring /etc/ttys and missing utmp records. Reported by: Barney Cordoba <barney_cordoba yahoo com> Reviewed by: rwatson
* Significantly reduce the memory leak as noted in BUGS section forscf2007-07-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith)
* Back out all POSIXified *env() changes.ache2007-05-011-2/+2
| | | | | | | | | Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs.
* Slightly tune previous fix: free memory if !exportache2007-04-301-2/+2
|
* Prepare for upcoming POSIXed putenv() rewrite:ache2007-04-301-1/+1
| | | | don't free memory after putenv()
* Teach login(1) about the make.conf NO_AUDIT variable. This allows us tocsjp2006-12-131-0/+16
| | | | | | | conditionally build in audit support. Submitted by: bz MFC after: 1 week
* Don't call audit_logout() if pwd is NULL, as audit_logout() attempts tocognet2006-03-281-1/+4
| | | | | | | | | | dereference it. This will happen if we ^D at the Login: prompt without having provided a valid login before. Set pwd to NULL on bad login attempts to prevent audit_logout() from being called for a user which didn't actually log on. Reported by: Jerome Magnin jethro at docisland dot org
* Make login audit-enabled, submitting audit records for the login and logoutwsalamon2006-02-041-0/+16
| | | | | | | | | events. The specifics of submitting the records is contained within login_audit.c. Document the auditing behavior in the man page. Obtained from: TrustedBSD Project, Apple Computer, Inc. Approved by: rwatson (mentor)
* o Teach login(1) to respect "hushlogin" and "nocheckmail" attributesmaxim2005-06-011-2/+7
| | | | | | | | defined in user's $HOME/.login_conf. PR: bin/75001 Submitted by: Rostislav Krasny MFC after: 2 weeks
* Fix ~/.hushlogin handling.fjoe2004-01-261-3/+4
| | | | | PR: 61354 Submitted by: Eugeny Grosbein <eugen (at) kuzbass.ru>
* When the tty chown() fails, report a chown() failure rather than arwatson2003-04-261-1/+1
| | | | chmod() failure.
* The documented login.conf variable for setting the login prompt isdes2003-04-251-1/+1
| | | | | | | | "login_prompt". This makes more sense than "prompt" which is what login actually used, so change the code to match the documentation. PR: docs/51396 MFC in: 3 days
* Back out previous commit, I wasn't thinking clearly.des2003-02-151-2/+1
|
* Set PAM_RHOST to "localhost" if no remote host was specified. This allowsdes2003-02-151-1/+2
| | | | pam_opieaccess() to work as expected for local logins.
* Use waitpid() instead of wait() since we know the pid of the process wedes2003-02-081-1/+2
| | | | are waiting for, and we don't want to reap the wrong process.
* Change the process title as soon as possible to mask information passed ondes2002-12-041-0/+3
| | | | | | | | the command line by getty(8). This is not a perfect fix, but drastically reduces the window of exposure. Approved by: re (rwatson) MFC after: 1 week
* Be consistent about functions being static.phk2002-10-151-4/+4
| | | | Spotted by: FlexeLint
* When login tries to do the chmod/chflags on a read only file system,imp2002-08-191-3/+12
| | | | | | | | | | | | | | | | | | | it complains that it can't do it because the filesystem is readonly. Assume that when the user has a readonly /dev that they don't care if login can't change the permissions/flags. While this does break a few things like msgs, we'll assume that the user setting up the read only system knows what they are doing. All this change does is to stop the complaint when the file system is read only. It also adds comments as to why EROFS and EOPNOTSUPP are ignored. This allows one to have a read-only / w/o a /dev MFS and have a relatively warning-free existence. /etc/rc still complains when it can't chown/chflags/chmod things, but that's easy to ignore/tweak. Reviewed by: roberto, phk Sponsored by: Timing Solutions
* Don't reuse a const char * when we really want a char *.dwmalone2002-07-281-5/+7
|
* Simplify TERM handling since now libutil not overwrites existen TERM for "term"ache2002-06-281-3/+1
|
* Overwrite "term" from login.conf(5) for any known TERMache2002-06-281-2/+9
|
* Drive-by whitespace cleanup.des2002-05-281-13/+13
|
* Don't use PAM_SILENT unless hushlogin is set (perforce change 10123)des2002-04-221-0/+2
| | | | Sponsored by: DARPA, NAI Labs
* Remove unused #define.des2002-04-161-5/+0
|
* Align for const poisoning in -lutil.ru2002-04-081-6/+7
|
* Simple fix so the 'LOGIN FAILURE' message send to syslog will includegad2002-03-121-1/+0
| | | | | | | the correct userid, instead of random garbage. This bug does not exist in -stable. Reviewed by: freebsd-audit
* Switch to OpenPAM. Bump library version. Modules are now versioned, sodes2002-03-051-3/+3
| | | | | | | | | applications linked with Linux-PAM will still work. Remove pam_get_pass(); OpenPAM has pam_get_authtok(). Remove pam_prompt(); OpenPAM has pam_{,v}{error,info,prompt}(). Remove pam_set_item(3) man page as OpenPAM has its own. Sponsored by: DARPA, NAI Labs
* Still with asbestos longjohns on, completely PAMify login(1) and removedes2002-01-301-529/+369
| | | | | | code made redundant by various PAM modules (primarily pam_unix(8)). Sponsored by: DARPA, NAI Labs
* Back out rev 1.78, which is incorrect now that the PAM modules have beendes2002-01-291-3/+2
| | | | fixed to accept a NULL PAM_RHOST.
* When running on a local terminal, set PAM_RHOST to the local hostname.des2002-01-211-2/+10
| | | | Sponsored by: DARPA, NAI Labs
* Back out PAM_CRED_ERR additionache2002-01-191-1/+0
|
* Add PAM_CRED_ERR as valid failure caseache2002-01-191-0/+1
|
* Style improvements recommended by Bruce as a follow up to somedwmalone2001-12-101-5/+6
| | | | | | | | of the recent WARNS commits. The idea is: 1) FreeBSD id tags should follow vendor tags. 2) Vendor tags should not be compiled (though copyrights probably should). 3) There should be no blank line between including cdefs and __FBSDIF.
* Use __FBSDID(). Also do a bit of cosmetic #if and header-ordermarkm2001-12-021-11/+5
| | | | cleaning-up.
* Sort includes.markm2001-12-021-4/+4
|
* Style fixups.markm2001-12-011-25/+26
| | | | | | | Sort function declarations, includes. Make consistent WRT use of _P() macro (ugh!) Inspired by: bde
* WARNS=2 fixes.markm2001-12-011-43/+58
| | | | Reviewed by: bde (a while back)
* o Add support for a 'nocheckmail' capability, which (if true) preventsrwatson2001-11-161-9/+12
| | | | | | | | | the 'You have mail.' check. This is useful for sites that rely on remote mail access, rather than a local mail spool. Due to the behavior of login_getcapbool(), the negated form is required so as to have appropriate results. o This behavior may have to be independently added to sshd due to redundant implementation.
* o Modify NFS rights comment to note that the early credential changesrwatson2001-09-151-1/+7
| | | | | | to test for a home directory don't set up the additional groups, and as such may limit users conservatively. This does not affect the eventual credentials selected.
OpenPOWER on IntegriCloud