summaryrefslogtreecommitdiff
path: root/login-utils
AgeCommit message (Collapse)AuthorFilesLines
2010-05-24build-sys: replace ../ with $top_srcdirKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-28login: check that after tty reopen we still work with a terminalKarel Zak1-9/+13
* the login code assumes that stdin is a terminal, it's better to check (by isatty()) that after tty reopen we still have a terminal * this patch also removes very old obscure fallback for situations where ttyname() returns nothing (then ttyn = "/dev/tty??"). I guess that the fake string was originally for utmp records or so. Currently (in last 10 years...) code requires that the tty name is a real open-able file. It means the fake tty name is completely useless. Reported-by: Yann Droneaud <yann@droneaud.fr> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-28login: use fd instead of pathname for update tty's owner and permissionsYann Droneaud1-4/+4
To avoid some nasty races, use the only true tty: the one already opened, don't use the path. Signed-off-by: Yann Droneaud <yann@droneaud.fr>
2010-01-27login: don't link PAMed version with libcryptKarel Zak1-16/+16
The login, chsh and chfn utils don't need to be linked against libcrypt. The libcrypt library is necessary only when login utils are not liked with PAM. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=559196 Signed-off-by: Karel Zak <kzak@redhat.com>
2009-11-20last: fix utmp.ut_time usageKarel Zak1-6/+24
The utmp.ut_time is timeval.tv_sec (time_t) or int32_t. It's more robust not to use ctime() or time() directly. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-17initctl: fix strict-aliasing bugsKarel Zak1-2/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-16newgrp: use c.h, remove tailing whitespaceKarel Zak1-11/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-09Remove now unused <sys/ioctl.h> includesGuillem Jover1-1/+0
Those became unused with the switch to the blkdev functions. Signed-off-by: Guillem Jover <guillem@hadrons.org>
2009-08-21replace usleep() for systems that don't have themDaniel Mierswa1-0/+1
This function is marked obsolete in POSIX.1-2001 and removed in POSIX.1-2008. Conditionally replaced with nanosleep(). Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-08-17simpleinit.8: formattingPeter Breitenlohner1-2/+4
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17shutdown.8: formattingPeter Breitenlohner1-10/+32
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17newgrp.1: formattingPeter Breitenlohner1-3/+5
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17mesg.1: formattingPeter Breitenlohner1-1/+2
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17last.1: formattingPeter Breitenlohner1-1/+1
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17initctl.8: formattingPeter Breitenlohner1-5/+8
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17chsh.1: formattingPeter Breitenlohner1-5/+10
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17chfn.1: formattingPeter Breitenlohner1-10/+19
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17vipw.8: remove erroneous empty line, formattingPeter Breitenlohner1-6/+5
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17replace bcopy,bzero,index and rindexDaniel Mierswa5-8/+8
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in POSIX.1-2008. Replaced with memmove,memset,strchr and strrchr. Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-07-04build-sys: rename to _execdirKarel Zak1-10/+10
The variable name "usrlibexecdir" is very confusing (because we have /usr/libexec). The "exec" prefix is required for user-defined directories, see http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install This patch renames all usr*execdir variables to usr*_execdir. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04build-sys: fix exec/data install hooksKarel Zak1-0/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-30include: clean up _PATH_DEV_* macrosKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-23agetty: IUCLC and OLCUC are Linux extensionsAurelien Jarno1-0/+4
IUCLC and OLCUC are Linux extensions to termios. The same way it is already done for XCASE, they can be ignored if not supported. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-04-10login: use open(2) rather then access(2) for $HOME/.hushloginKarel Zak1-1/+16
As an NFS client with home directories on mounted NFS share - If the NFS server exports the share with default root squashed, login cannot access the filesystem to check for the existence of .hushlogin file. It seems better to use open(2) rather than access(2). Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-17login: use "remote" as a PAM service name for "login -h"Karel Zak2-1/+11
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-09login: remove "switching users" nonsense from man pageKarel Zak1-3/+1
For more details see the BUGS section in the man page. Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-03simmpleinit: fix gcc warning (buffer size in read())Karel Zak1-1/+1
simpleinit.c:846: /usr/include/bits/unistd.h:43 warning: call to ‘__read_chk_warn’ declared with attribute warning: read called with bigger length than size of the destination buffer Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-05agetty: check for termios.c_line struct member by autoconfKarel Zak1-1/+1
Reported-by: Robert Millan <rmh@aybabtu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12refresh gitignoreKarel Zak1-0/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12simpleinit: cleanup gettext calls, use snprintf()Karel Zak1-16/+20
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12chfn: several strings without gettext callsKarel Zak1-4/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12TODO: add request to use nl_langinfo()Karel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12Revert "login-utils: several strings without gettext calls"Karel Zak4-19/+16
This reverts commit 64fefaf5bffdd4041190f1e5ed4b5d0100638c0d. It does not make sense to localize config options (wdays in checktty.c) and debug messages (main() in checktty.c.
2008-11-26login: cleanup includesKarel Zak1-5/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-26agetty: sys/types.h and time.h are included more than onceKarel Zak1-2/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03login-utils: several strings without gettext callsPedro Ribeiro4-16/+19
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29login: fix compiler warning (int32 time() arg)Karel Zak1-1/+7
login.c: In function ‘dolastlog’: login.c:1438 warning: passing argument 1 of ‘time’ from incompatible pointer type Unfortunately, on-disk lastlog format is always 32bit, bits/utmp.h: struct lastlog { #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32 int32_t ll_time; #else __time_t ll_time; #endif Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-01login: fix warning "dereferencing type-punned pointer will break ↵Karel Zak1-4/+17
strict-aliasing rules" This patch fix problems with odd pam_get_iten( ..., void **) API. (tested by gcc-4.1.2-42.el5.i386) Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-28remove CVS keywordsmaximilian attems1-1/+0
this patch removes old CVS keywords from comments. mount(8) works for newer Linux then 0.99 ;) Signed-off-by: maximilian attems <max@stro.at>
2008-07-01selinux: is_selinux_enabled() returns 0, 1 and -1Karel Zak4-4/+4
Unfortunately, the current libselinux implementation of is_selinux_enabled() returns -1 on error. This behavior is undocumented. The proper solution is to use "if (is_selinux_enabled() > 0)". Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-21login: audit log injection attack via loginSteve Grubb1-7/+3
A while back I found a couple audit log injection attacks which became CVE-2007-3102. I forgot to look at login to see if its vulnerable and Mirek found that it is. To verify the problem, type: root addr=xyz.com for the account name while logging in. It will look like root logged in with an address of xyz.com. Signed-off-by: Steve Grubb <sgrubb@redhat.com>
2008-04-16build-sys: remove unnecessary check-local target from login-utils/Karel Zak1-3/+0
We have all tests in the tests/ directory. Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16chfn, chsh, login: collapsing three similar messages into a single oneBenno Schulenberg3-6/+6
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-04-14build-sys: update .gitignore filesKarel Zak1-0/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14build-sys: ignore a bunch of generated files, mostly binariesJames Youngman1-0/+4
Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14login: rewrite is_local() to remove limits on line lengthJames Youngman3-23/+91
Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08login-utils: cleanup strlen() and fgets() usageJames Youngman1-2/+2
The strlen() returns size_t, not int. The fgets() returns pointer, not int. Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20chfn: fix compiler warnings in selinux stuffKarel Zak1-1/+1
selinux_utils.c:16: warning: assignment discards qualifiers from pointer target type Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-12remove useless if-before-free tests.Jim Meyering2-3/+3
E.g., in this example, the "if (p)" test is useless. if (p) free (p); I've been removing such tests systematically. Here's where I proposed it to the git folks, along with justification for why it's ok to perform this transformation, these days (no one uses SunOS4 anymore): http://thread.gmane.org/gmane.comp.version-control.git/74187 Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-06agetty: make username-in-uppercase feature optional (off by default.)Hamish Coleman2-5/+14
The following patch makes the username-in-upper-case feature optional. I have chosen to make it default to off since this feature was designed to cater for serial terminals that were last sold almost 30 years ago, thus the likelyhood that anyone will need this feature turned on is vanishingly small. Addresses-Debian-Bug: 156242 Signed-off-by: Hamish Coleman <hamish@zot.org> Signed-off-by: LaMont Jones <lamont@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>