Commit Graph

220 Commits

Author SHA1 Message Date
Marcelo Araujo
6a3f9a213a Use NULL instead of 0.
strtok(3) will return NULL when no more tokens remain.

MFC after:	2 weeks.
2016-04-18 05:26:32 +00:00
Xin LI
60b0aa6a8f login.c doesn't really need libutil.h, don't include it.
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
2015-09-10 22:25:40 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Neel Natu
06224a9492 Remove LOG_ODELAY because it does nothing.
Reviewed by:	jilles
CR:		https://reviews.freebsd.org/D611
2014-08-17 19:06:26 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Jilles Tjoelker
07426f1f0a login: Remove broken dialup log message.
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.
2014-04-19 13:47:32 +00:00
Jilles Tjoelker
2482c270bb login: Clean up PAM and audit, then exit, on SIGHUP and SIGTERM.
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
2014-01-26 22:49:24 +00:00
Ed Schouten
e83ebd8d19 Fix whitespace. 2013-11-13 20:35:10 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Dag-Erling Smørgrav
7aa2051e40 None of these programs actually use auth.conf.
MFC after:	1 week
2012-06-11 16:18:39 +00:00
Kevin Lo
01bd93ce1c Remove unnecessary cast 2012-02-14 10:11:45 +00:00
Ulrich Spörlein
487ac9ac21 Spelling fixes for usr.bin/ 2011-12-30 11:02:40 +00:00
Doug Rabson
ba675b4176 Call pam_setcred() before login_getpwclass to support home directories
on GSS-API authenticated NFS where the kerberos credentials need to be
saved so that the kernel can authenticate to the NFS server.
2011-05-03 10:18:27 +00:00
Joel Dahl
da52b4caaf Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with:	imp, rwatson
2010-12-11 08:32:16 +00:00
Ed Schouten
587250b286 Get rid of hand-rolled closefrom(3). 2010-10-20 19:53:29 +00:00
Ed Maste
905571c031 Remove copyright strings printed at login time via login(1) or sshd(8).
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)
2010-09-28 20:57:14 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ed Schouten
ef636796f6 ANSIfy various tools in usr.bin/.
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.
2010-01-02 10:09:20 +00:00
Xin LI
821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Xin LI
6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Robert Watson
781202d7fd Pass int arguments to auditon(2)'s A_GETCOND API rather than long
arguments.  This change should be MFC'd with OpenBSM 1.1 since they
are interdependent.

MFC after:	2 weeks
Obtained from:	TrustedBSD Project
Sponsored by:	Apple, Inc.
2009-04-19 23:34:22 +00:00
Ed Schouten
95e7b94a05 Don't strip TTY device name to the last '/'.
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
2009-03-27 19:13:36 +00:00
Philip Paeps
db3dfd0efa Add a cross-reference to newgrp(1).
Every time I need newgrp, I forget its name but I remember it's like
login for groups - newgrp(1) already cross-references login(1).

MFC after:	2 days
2007-11-30 11:02:36 +00:00
Kevin Lo
8bcd62f2ff Use NULL instead of 0 for the return value of fopen().
Approved by: re (kensmith)
2007-09-21 01:55:11 +00:00
Sean Farley
2966d28c32 Significantly reduce the memory leak as noted in BUGS section for
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)
2007-07-04 00:00:41 +00:00
David Malone
bc7e443092 Fix some warnings by making things const, adding missing headers,
removing some unused variables and making a variable unsigned.

MFC after:	3 weeks
2007-05-07 11:01:36 +00:00
Andrey A. Chernov
ba174a5e38 Back out all POSIXified *env() changes.
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.
2007-05-01 16:02:44 +00:00
Andrey A. Chernov
8673ed1565 Slightly tune previous fix: free memory if !export 2007-04-30 12:54:02 +00:00
Andrey A. Chernov
2efaac818f Prepare for upcoming POSIXed putenv() rewrite:
don't free memory after putenv()
2007-04-30 12:44:04 +00:00
Christian S.J. Peron
0c59c145ed Teach login(1) about the make.conf NO_AUDIT variable. This allows us to
conditionally build in audit support.

Submitted by:	bz
MFC after:	1 week
2006-12-13 06:13:32 +00:00
Ruslan Ermilov
cb29445a92 Markup fixes. 2006-09-29 15:20:48 +00:00
Joel Dahl
3e1f331553 Remove references to the pam(8) manual page. It does not exist.
Requested by:	novel
Discussed with:	brueffer, simon
2006-09-13 17:46:20 +00:00
Ruslan Ermilov
e4a9274404 Add missing library dependencies. 2006-04-13 12:49:24 +00:00
Olivier Houchard
8f9370b050 Don't call audit_logout() if pwd is NULL, as audit_logout() attempts to
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
2006-03-28 15:30:42 +00:00
Ruslan Ermilov
e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
Yaroslav Tykhiy
ebf3356a26 Managing login.access is no longer a responsibility of login(1).
Therefore give a xref, not details.

MFC after:	3 days
2006-03-06 13:07:17 +00:00
Yaroslav Tykhiy
d072921b75 Remove the last reference to LOGIN_ACCESS from login(1).
MFC after:	3 days
2006-03-06 12:56:35 +00:00
Yaroslav Tykhiy
700c87c3db login.access.5 and login_access.c are no longer used
in usr.bin/login because the login.access feature has
moved to PAM completely.

Their counterparts in lib/libpam/modules/pam_login_access
have been found to be in sync with, and even in better shape
than, login.access.5 and login_access.c here.

Therefore cvs rm login.access.5 and login_access.c from
usr.bin/login so that nobody will waste their time on fixing
or developing the files here.

MFC after:	3 days
2006-03-06 12:54:03 +00:00
Yaroslav Tykhiy
e65f3545ff login(1) no longer handles /etc/login.access by itself,
it's PAM's job.

MFC after:	3 days
2006-03-06 12:38:42 +00:00