summaryrefslogtreecommitdiff
path: root/login-utils
AgeCommit message (Collapse)AuthorFilesLines
2007-12-17shutdown: use _PATH_MOUNTED instead of _PATH_MTABStepan Kasal1-2/+2
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-11-28agetty: non-linux support (use pathnames.h)Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-28include: cleanup pathnames.hKarel Zak2-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-28build-sys: cleanup usage of linux/major.hSamuel Thibault1-0/+8
The utils like fdisk or login are usable on non-linux systems. This patch allows to compile on systems without linux/major.h. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2007-11-26wall: cleanup MAXHOSTNAMELENKarel Zak1-0/+8
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-26agetty: cleanup MAXHOSTNAMELENKarel Zak1-19/+9
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-26agetty: ungettextize several debugging messages.Benno Schulenberg2-15/+15
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2007-10-26docs: tweak a few messages for clarityBenno Schulenberg1-2/+2
Add a missing period, a missing space, a comma and a word for clarity, plus a period and an uppercase letter to match surrounding messages. Further add a missing call to gettext, and undo an unneeded linewrap. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2007-10-16mesg: replace errs.h with libc err.hKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-04chfn: add pam_end() call and cleanup PAM codeKarel Zak1-23/+32
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-10-04chsh: should use pam_end function to terminate the PAM transactionYu Zhiguo1-24/+33
chsh will use PAM transaction if macros 'REQUIRE_PASSWORD' and 'HAVE_SECURITY_PAM_MISC_H' are defined, but there is no pam_end function be used when the PAM transaction be terminated. This patch also cleanup PAM code in chsh(1). Signed-off-by: Yu Zhiguo <yuzg@cn.fujitsu.com> Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-09-21login: login segfaults on EOF (rh#298461)Karel Zak1-2/+2
Stupid bug in audit code: $ login login: ^D login: ^D Segmentation fault Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-14build-sys: add --disable-makeinstall-chownKarel Zak1-3/+3
A chown-like operations are unexpected when you execute "make install" as non-root user. For example RPM defines owner+permissions in .spec file -- you needn't to use root account to create useful RPM package. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-14chsh: don't use empty shell field in /etc/passwdKarel Zak1-2/+5
chsh(1) uses empty shell setting (pw->pw_shell="") as a synonym for /bin/sh. This convention is silly and unnecessary. (The vsftpd server will not run if the shell assigned to user "ftp" is a null string -- according to bug rh#103004). Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-14login: replace /usr/spool/mail with /var/spool/main in man pageKarel Zak1-2/+2
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-25agetty: fix short malloc in initstring handlingLaMont Jones1-1/+1
Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
2007-07-25agetty: 8 bit characters on the Linux console lead to input corruptionMoritz Muehlenhoff2-6/+14
8 bit characters on the Linux console lead to input corruption (e.g. German umlauts). This is easily reproducable by inserting a login name with umlaut and typing backspace afterwards. agetty supports tty parity, which leads to getty treating these characters as a 7bit char with set parity. This patch by Samuel Thibault adds a new option -8 which disables parity detection for ttys not used for serial logins. | Note: With this patch, 8bit characters are just silently dropped (that's | the expected getty behavior), this is quite neat since you then don't | even need to backspace your 8bit characters :) Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
2007-07-17login-utils: remove deprecated sigsetmask() from wallKarel Zak1-1/+3
The sigsetmask() is deprecated in favor of sigprocmask(). Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-16login-utils: remove unwanted newlines from wallKarel Zak1-1/+2
Prevent wall from adding an empty newline to every new line. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-03man pages: add "AVAILABILITY" sectionKarel Zak11-10/+37
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-07-02wall: fix O_NONBLOCK usageKarel Zak1-2/+3
From: Alan Curry <pacman@TheWorld.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-29agetty: check gethostname() return valueKarel Zak1-12/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-06-29agetty: add 'O' escape code to display domain nameKarel Zak2-1/+41
This patch add a new 'O' escape code to display domain name by issue-file (/etc/issue) output. (Based on an Gentoo patch.) Signed-off-by: Karel Zak <kzak@redhat.com>
2007-05-16build-sys: move -D flags to *_CPPFLAGSStepan Kasal1-1/+1
Preprocessor options belong to *_CPPFLAGS; add $(AM_CPPFLAGS) as we want to amend it, not override. Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-05-16build-sys: do not build convenience libraries in lib/Stepan Kasal1-7/+9
Build lib/*.c individually for each project which uses it, so that the right set of flags is applied each time. Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-05-16build-sys: add SUID_LDFLAGSStepan Kasal1-0/+4
Programs which are usually installed with the setuid bit do need their own CFLAGS and LDFLAGS. SUID_LDFLAGS is analogic to SUID_CFLAGS. Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-05-16build-sys: do not kick off AM_CFLAGS by SUID_CFLAGSStepan Kasal1-3/+3
SUID_CFLAGS are not meant to override the makefile-wide AM_CFLAGS. (We do not use AM_CFLAGS currently, but we will.) Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-04-25build-sys: add SUID_CFLAGSKarel Zak1-0/+4
The patch allows to define special CFLAGS for typical suid programs (like mount, umount, chfn, ...). Some distributions use for example "-fpic" for suid binaries. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-21newgrp: add support for /etc/gshadowKarel Zak1-7/+43
The original newgrp command doesn't expect group pasword in /etc/gshadow although almost all distributions use this file (and the gpasswd command). The newgrp from util-linux is deprecated and better is use shadow-utils only. Unfortunately, shadow-utils are broken too (see RH version where is bugfix). In this case it's better fix util-linux version at least... Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-21newgrp: check result from getgrnam() more carefullyKarel Zak1-1/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-12login: remove triiling white-spacesKarel Zak1-92/+92
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-12login: add audit supportKarel Zak2-0/+37
The login command reports AUDIT_USER_LOGIN message to audit system (depends on --with-audit). Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-10login: add IPv6 supportKarel Zak4-40/+156
This support includes: * non-PAM version supports IPv6 ranges in /etc/usertty * utmp records with IPv6 addresses Based on patch by: Milan Zazrivec <mzazrivec@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-09login: add regression test for IP address checking codeKarel Zak2-0/+64
The hnmatch() in checktty.c is checking IP addresses if the login util is compiled without PAM support. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-08login: update 32bit utmp correctly on 64bit systemKarel Zak1-2/+8
On 64-bit platforms such as x86_64, glibc is usually built with 32-bit compatibility for various structures. One of them is utmp. What this means is that gettimeofday(&ut.ut_tv, NULL) on x86_64 will end up overwriting the first parts of ut_addr_v6, leading to garbage in the utmp file. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-08login: omits PAM account validation when auth is skipped (CVE-2006-7108)Karel Zak1-6/+12
The login omits pam_acct_mgmt & chauth_tok when authentication is skipped. Authentication may be skipped, for example, during krlogin because Kerberos already took care of it. The problem with skipping pam_acct_mgmt is that it allows users to use the system when maybe they should not be allowed, such that if they have a Kerberos ticket, the other checks do not apply. If a user had to use password authentication, pam_acct_mgmt may reject the user for several reasons: not allowed to use the system at this time, not allowed to use this system, user's account has been disabled, etc. Why should these tests be skipped just because the user has a ticket? Same with pam_chauthtok: the user may have a valid ticket, but if their password has expired, they need to enter a new one right now. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-08login: attempt to run if it has no read/write access to its terminalKarel Zak1-1/+2
If you manage to exec login with a userid other than root, and its input / output directed to a terminal for which it does not have read/write access, it will attempt to proceed (and can potentially hang forever -- but this hang has been fixed in a previous commit). It's better to check if we have permissions for terminal rather than do any useless things. From: Jason Vas Dias <jvdias@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-08login: keep syslog useful for end of PAM session.Karel Zak1-0/+1
The PAM session modules typically write to syslog when leaving the session. The openlog() is way how define a "ident" for syslog messages. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-08login: login's timeout can failKarel Zak1-0/+1
Login tries to set a timeout in main() by SIGALARM. If any restartable system call is entered, such system calls can block indefinitely and will NOT be interrupted by the SIGALRM. The bug appears when the login program is run for a terminal for which it doens't have read or write permission. In that case, login hung until manually killed by the administrator in its tcsetattr(...) call at login.c, line 460: /* Kill processes left on this tty */ tcsetattr(0,TCSAFLUSH,&ttt); This may possibly be a kernel bug - instead of returning EIO / EPERM, the kernel continously sends an infinite number of SIGTTOU signals to the process . An 80MB strace log file was generated, consisting of >1,000,000 repetitions of : 4964 11:00:18 ioctl(0, SNDCTL_TMR_CONTINUE or TCSETSF, {c_iflags=0x106, c_oflags=0x1805, c_cflags=0x800000be, c_lflags=0x3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"}) = ? ERESTARTSYS (To be restarted) 4964 11:00:18 --- SIGTTOU (Stopped (tty output)) @ 0 (0) --- 4964 11:00:18 --- SIGTTOU (Stopped (tty output)) @ 0 (0) --- Login's alarm signal handler DOES get the SIGALRM after the 60 second timeout, and timedout() is called; but then timedout2 calls ioctl(0, TCSETA, &ti), which also blocks, because the ioctl(0, TCSETSF...) of tcsetattr is in progress, and the exit() call of timedout2 is never reached, and the tcsetattr call is restarted. From: Jason Vas Dias <jvdias@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-08login: improve work with signalsKarel Zak1-12/+69
The login cannot ignore signals, because: * SIGHUP is only way how inform session leader that controlling tty goes away. The leader has to inform others processes in same process group about the signal. * SIGHUP/SIGTERM cannot kill wait(2)-ing login, we have to wait as long as any child process exists. The PAM session has to be closed correctly. * The child process (before setsid()) has to call exit() if a controlling tty goes away. This patch is inspired by patch from Red Hat that is very well tested for last 4 years in all Red Hat distros. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-07login: close PAM session after failed pam_setcredKarel Zak1-0/+2
If for some reason the pam set credential call fails, it does not close the pam session. pam open can mount drives, so calling pam close is important. From: Steve Grubb <sgrubb@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2007-03-07chsh: remove tailing wihit-spaces and use PATH_BSHELLKarel Zak1-5/+6
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-02-15vipw: fix permissions (600->400) for edited /etc/[g]shodow filesKarel Zak1-3/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04execl() should be use NULL not 0Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-04build-sys: add missing filesKarel Zak1-9/+14
This patch add all missing headers, man pages and README files to automake stuff and "make dist-gzip" produces useful tarball now. Signed-off-by: Karel Zak <kzak@redhat.com>
2007-01-03build-sys: remove generated autotools stuff from gitKarel Zak1-858/+0
The generated autotools stuff shouldn't be maintained by SCM. After check out from git use ./autogen.sh. For more details see README.devel. Signed-off-by: Karel Zak <kzak@redhat.com>
2006-12-07Imported from util-linux-2.13-pre6 tarball.Karel Zak1-1/+1
2006-12-07Imported from util-linux-2.13-pre4 tarball.Karel Zak2-38/+34
2006-12-07Imported from util-linux-2.13-pre3 tarball.Karel Zak2-4/+4
2006-12-07Imported from util-linux-2.13-pre2 tarball.Karel Zak2-234/+110