Commit Graph

161 Commits

Author SHA1 Message Date
Bruce Evans
77585df415 Fixed style bugs in previous commit (.ifndef instead of .if defined(),
and tab lossage).

Garbage-collected NEED_LIBNAMES.
2004-02-29 06:39:11 +00:00
Dag-Erling Smørgrav
76e4339aa7 I am a moron. 2004-02-27 19:00:41 +00:00
Dag-Erling Smørgrav
13ae56f84d Re-add the setuid bit, conditional on NO_SETUID_LOGIN being undefined. 2004-02-27 17:50:59 +00:00
Dag-Erling Smørgrav
c9d0616d93 Cut through the bikeshed and remove login(1)'s setuid bit. It has no
business trying to impersonate su(1), and it does not need to be setuid
to function properly when invoked by getty(8) or telnetd(8).
2004-02-27 08:39:16 +00:00
Ruslan Ermilov
3826278409 GC (now unused here) -lcrypt. 2004-02-02 18:00:06 +00:00
Max Khon
71f4a30d59 Fix ~/.hushlogin handling.
PR:		61354
Submitted by:	Eugeny Grosbein <eugen (at) kuzbass.ru>
2004-01-26 20:04:47 +00:00
Daniel Harris
d47b06fccf Remove utmp references, no longer done by login(1) in 5.x.
PR:		54201
Submitted by:	mdg <mdg@secureworks.net>
2003-07-08 13:01:28 +00:00
Robert Watson
a2ba8df6c4 When the tty chown() fails, report a chown() failure rather than a
chmod() failure.
2003-04-26 02:51:03 +00:00
Dag-Erling Smørgrav
5c4b7a56c6 The documented login.conf variable for setting the login prompt is
"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
2003-04-25 11:57:20 +00:00
Dag-Erling Smørgrav
d477c0ca56 Back out previous commit, I wasn't thinking clearly. 2003-02-15 23:20:04 +00:00
Dag-Erling Smørgrav
b9c5354345 Set PAM_RHOST to "localhost" if no remote host was specified. This allows
pam_opieaccess() to work as expected for local logins.
2003-02-15 23:16:41 +00:00
Dag-Erling Smørgrav
fea1e414df Use waitpid() instead of wait() since we know the pid of the process we
are waiting for, and we don't want to reap the wrong process.
2003-02-08 16:11:20 +00:00
Dag-Erling Smørgrav
2517862ed9 Change the process title as soon as possible to mask information passed on
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
2002-12-04 15:00:10 +00:00
Philippe Charnier
e72bbdf42e Do not reuse flag name in its definition. Remove inadequate sentence. 2002-10-16 15:17:38 +00:00
Poul-Henning Kamp
0845b8fa43 Be consistent about functions being static.
Spotted by:	FlexeLint
2002-10-15 18:24:31 +00:00
Warner Losh
84bbb6cab3 When login tries to do the chmod/chflags on a read only file system,
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
2002-08-19 20:54:00 +00:00
David Malone
81b4504baa Don't reuse a const char * when we really want a char *. 2002-07-28 16:17:38 +00:00
Andrey A. Chernov
55f0377c44 Simplify TERM handling since now libutil not overwrites existen TERM for "term" 2002-06-28 22:56:31 +00:00
Andrey A. Chernov
79a20d3b58 Overwrite "term" from login.conf(5) for any known TERM 2002-06-28 04:59:39 +00:00
Dag-Erling Smørgrav
c51edfb77d Drive-by whitespace cleanup. 2002-05-28 06:46:37 +00:00
Dag-Erling Smørgrav
05da55ee50 Don't use PAM_SILENT unless hushlogin is set (perforce change 10123)
Sponsored by:	DARPA, NAI Labs
2002-04-22 06:27:16 +00:00
Bruce Evans
85549fe96b Fixed some style bugs ("From:" in vendor id line, disordered MAN line, and
blank lines).

Not unapproved of by:	markm
2002-04-21 12:43:14 +00:00
Philippe Charnier
e8937ba009 Use `The .Nm utility' 2002-04-20 12:18:28 +00:00
Dag-Erling Smørgrav
b897c4dfe0 Remove unused #define. 2002-04-16 22:07:15 +00:00
Ruslan Ermilov
f2f306b622 Align for const poisoning in -lutil. 2002-04-08 11:07:51 +00:00
Warner Losh
f1bb2cd2aa remove __P 2002-03-22 01:22:50 +00:00
Garance A Drosehn
3be0f8f038 Simple fix so the 'LOGIN FAILURE' message send to syslog will include
the correct userid, instead of random garbage.  This bug does not
exist in -stable.

Reviewed by:	freebsd-audit
2002-03-12 19:48:32 +00:00
Dag-Erling Smørgrav
519b6a4c8f Switch to OpenPAM. Bump library version. Modules are now versioned, so
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
2002-03-05 21:56:25 +00:00
Mark Murray
e35f9517d6 Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3. 2002-02-08 23:07:37 +00:00
Dag-Erling Smørgrav
c60ed00a43 Still with asbestos longjohns on, completely PAMify login(1) and remove
code made redundant by various PAM modules (primarily pam_unix(8)).

Sponsored by:	DARPA, NAI Labs
2002-01-30 19:10:21 +00:00
Dag-Erling Smørgrav
554b9a6e8e Back out rev 1.78, which is incorrect now that the PAM modules have been
fixed to accept a NULL PAM_RHOST.
2002-01-29 23:27:54 +00:00
Dag-Erling Smørgrav
f2c44ccec8 When running on a local terminal, set PAM_RHOST to the local hostname.
Sponsored by:	DARPA, NAI Labs
2002-01-21 16:19:38 +00:00
Andrey A. Chernov
07977587ab Back out PAM_CRED_ERR addition 2002-01-19 18:06:05 +00:00
Andrey A. Chernov
3e4f7c7f99 Add PAM_CRED_ERR as valid failure case 2002-01-19 09:01:17 +00:00
David Malone
9f5b04e925 Style improvements recommended by Bruce as a follow up to some
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.
2001-12-10 21:13:08 +00:00
Mark Murray
1a8b24c257 Use __FBSDID(). Also do a bit of cosmetic #if and header-order
cleaning-up.
2001-12-02 20:54:57 +00:00
Mark Murray
a9648779a5 Sort includes. 2001-12-02 00:06:22 +00:00
Mark Murray
d2f6cd8fd5 Style fixups.
Sort function declarations, includes. Make consistent WRT use of _P()
macro (ugh!)

Inspired by:	bde
2001-12-01 21:12:04 +00:00
Bruce Evans
42f9157b63 Work around world breakage in previous commit. The bug is in
<security/pam_misc.h>.  It declares a function parameter named 'send',
so nothing that includes both <unistd.h> (which declares send(2)) and
<security/pam_misc.h> be compiled with WARNS=2 unless NO_WERRROR is
set.

Fixed order of WARNS.
2001-12-01 19:48:59 +00:00
Mark Murray
e317b97026 WARNS=2 fixes.
Reviewed by:	bde (a while back)
2001-12-01 17:46:46 +00:00
Robert Watson
0e80e8b216 o Add support for a 'nocheckmail' capability, which (if true) prevents
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.
2001-11-16 04:39:16 +00:00
Robert Watson
0cd9461353 o Restore previous inconsistent style to login_fbtab.c, following its
modification to add glob support.  The submitted patch used a degraded
  form of KNF.

Reviewed by:	bde
2001-10-28 22:54:16 +00:00
Robert Watson
4983b09404 o Modify format of /etc/fbtab to accept glob matching patterns for
target devices, not just individual devices and directories.  This
  permits activities such as:

	ttyv0		0600	/dev/dsp*

  Whereas previously that was not supported.  This change is
  backwards-compatible, except where device names included globbing
  characters, which is not the case for any devices listed in MAKEDEV.

Submitted by:	Maxime Henrion <mux@qualys.com>
MFC after:	3 weeks
2001-10-25 20:45:47 +00:00
Robert Watson
2c19b38f62 o Modify NFS rights comment to note that the early credential changes
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.
2001-09-15 17:09:39 +00:00
Ruslan Ermilov
cda2a9b2f0 Set BINOWN=root explicitly for setuid root binaries.
This is not "useless", as one may have non-default
setting for BINOWN in make.conf, and we still want
these to be installed setuid root in this case.
2001-09-13 06:48:18 +00:00
Ruslan Ermilov
63462b0c3a mdoc(7) police: tighten label width. 2001-09-04 10:24:52 +00:00
Mark Murray
142277ce04 Like su(1), make PAM use mandatory. Remove parts of the authentication
logic that are handled by PAM. Fix documentation to reflect this.
2001-08-30 11:27:36 +00:00
Mike Barcroft
ede8b1c50a Fix some bogus strncpy(3) to strlcpy(3) changes I made in the previous
revision.  <utmp.h> structures don't leave room for a NUL character.
Also fix "UNKNOWN" which should have just been UNKNOWN.

Pointed out by:	bde
2001-08-13 05:56:27 +00:00
Mike Barcroft
9ab4f41231 o Replace occurrences of strncpy(3) with strlcpy(3); most of
the uses of it were wrong anyway.
o Always check for NULL returns on strdup(3).
o Fix a possible buffer overflow in strcpy(3).
o Fix a format string vulnerability.
o t->ty_type in stypeof() could be NULL and eventually cause
  a segmentation fault in setenv(3), so check for that.

Eyeballed by:	kris
Reviewed by:	murray
MFC after:	3 days
2001-08-12 17:54:49 +00:00
Mark Murray
9567ba9dda Fix the environment handling:
However, there's still a bug in login.c
because you copy the environment *before* the call to pam_open_session,
which won't set the necessary variables set by /usr/ports/security/pam_ssh.

Submitted by:	Volker Stolz <stolz@hyperion.informatik.rwth-aachen.de>
2001-07-28 19:53:10 +00:00