summaryrefslogtreecommitdiffstats
path: root/login-utils
Commit message (Collapse)AuthorAgeFilesLines
* mesg: Use EXIT_* and discard K&R style declaration.Marek Polacek2010-12-021-24/+22Star
| | | | | | | | [kzak@redhat.com: - use return rather than exit() in main() - more verbose error messages] Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* newgrp: Use err() and EXIT_*Marek Polacek2010-12-021-28/+19Star
| | | | | | | | Use err() or errx() where appropriate. Also use EXIT_* macros instead of 0/1. All error messages shall start with lowercase. Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* last: use xalloc libDavidlohr Bueso2010-11-301-12/+4Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* login: use xalloc libDavidlohr Bueso2010-11-301-7/+2Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* wall: use xalloc libDavidlohr Bueso2010-11-301-4/+3Star
| | | | Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-3011-22/+22
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib: [strutils] general purpose string handling functionsDavidlohr Bueso2010-11-238-8/+8
| | | | | | | | | | | | | This patch replaces a few functions used throughout the source: * Renames getnum (from schedutils) to strtol_or_err * Moves strtosize (from lib/strtosize.c) * Moves xstrncpy (from include/xstrncpy.h) * Adds strnlen, strnchr and strndup if not available (remove it from libmount utils) A few Makefile.am files were modified to compile accordingly along with trivial renaming in schedutils source code. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* agetty: use nl_langinfo()Karel Zak2010-11-152-9/+7Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* use _exit() instead of exit() in sighandlersMarek Polacek2010-10-292-2/+2
| | | | Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
* agetty: fix -s option (baud rate setup)Karel Zak2010-10-261-7/+26
| | | | | | | | | | | | | | | | | | The problem is pretty visible in strace output: broken version: ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 [...] ioctl(0, SNDCTL_TMR_START or TCSETS, {B0 -opost -isig -icanon -echo ...}) = 0 ^^^ fixed version: ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 [...] ioctl(0, SNDCTL_TMR_START or TCSETS, {B115200 -opost -isig -icanon -echo ...}) = 0 Reported-by: Jon Masters <jcm@redhat.com> Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=645640 Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: add -c to reuse cflagsKarel Zak2010-08-182-3/+12
| | | | | | | The agetty command resets terminal cflags setting. The -c option disables this behavior and serial setting from kernel is used. Signed-off-by: Karel Zak <kzak@redhat.com>
* aggety: don't wipe CLOCAL flagKarel Zak2010-08-181-1/+1
| | | | | | | | gettey should not clear the flag. It seems that the flag is automatically enabled for serial consoles tht don't use CD signal. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=598631 Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: add -s to reuse existing baud rateKarel Zak2010-08-182-19/+19
| | | | | | | | | | | | | For example: /sbin/agetty -s /dev/ttyS0 9600 will reuse the speed the kernel configured on the port. If the setting from kernel is useless (tty returns BREAK character) then the baud rate from command line (9600) is used. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=623685 Signed-off-by: Karel Zak <kzak@redhat.com>
* chsh: don't suggest ypchshKarel Zak2010-07-294-4/+10
| | | | | | | | | | $ chsh chsh: can only change local entries; use ypchsh instead. The 'ypchsh' is an external util that does not have to be installed. Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=497329 Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: fix typos, and rephrase some things for clarityBenno Schulenberg2010-06-141-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* build-sys: replace ../ with $top_srcdirKarel Zak2010-05-241-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: check that after tty reopen we still work with a terminalKarel Zak2010-01-281-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>
* login: use fd instead of pathname for update tty's owner and permissionsYann Droneaud2010-01-281-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>
* login: don't link PAMed version with libcryptKarel Zak2010-01-271-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>
* last: fix utmp.ut_time usageKarel Zak2009-11-201-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>
* initctl: fix strict-aliasing bugsKarel Zak2009-10-171-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* newgrp: use c.h, remove tailing whitespaceKarel Zak2009-10-161-11/+5Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Remove now unused <sys/ioctl.h> includesGuillem Jover2009-10-091-1/+0Star
| | | | | | Those became unused with the switch to the blkdev functions. Signed-off-by: Guillem Jover <guillem@hadrons.org>
* replace usleep() for systems that don't have themDaniel Mierswa2009-08-211-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>
* simpleinit.8: formattingPeter Breitenlohner2009-08-171-2/+4
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* shutdown.8: formattingPeter Breitenlohner2009-08-171-10/+32
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* newgrp.1: formattingPeter Breitenlohner2009-08-171-3/+5
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* mesg.1: formattingPeter Breitenlohner2009-08-171-1/+2
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* last.1: formattingPeter Breitenlohner2009-08-171-1/+1
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* initctl.8: formattingPeter Breitenlohner2009-08-171-5/+8
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* chsh.1: formattingPeter Breitenlohner2009-08-171-5/+10
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* chfn.1: formattingPeter Breitenlohner2009-08-171-10/+19
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* vipw.8: remove erroneous empty line, formattingPeter Breitenlohner2009-08-171-6/+5Star
| | | | Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
* replace bcopy,bzero,index and rindexDaniel Mierswa2009-08-175-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>
* build-sys: rename to _execdirKarel Zak2009-07-041-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>
* build-sys: fix exec/data install hooksKarel Zak2009-07-041-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* include: clean up _PATH_DEV_* macrosKarel Zak2009-06-301-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: IUCLC and OLCUC are Linux extensionsAurelien Jarno2009-04-231-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>
* login: use open(2) rather then access(2) for $HOME/.hushloginKarel Zak2009-04-101-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>
* login: use "remote" as a PAM service name for "login -h"Karel Zak2009-03-172-1/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: remove "switching users" nonsense from man pageKarel Zak2009-03-091-3/+1Star
| | | | | | For more details see the BUGS section in the man page. Signed-off-by: Karel Zak <kzak@redhat.com>
* simmpleinit: fix gcc warning (buffer size in read())Karel Zak2009-03-031-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>
* agetty: check for termios.c_line struct member by autoconfKarel Zak2009-02-051-1/+1
| | | | | Reported-by: Robert Millan <rmh@aybabtu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* refresh gitignoreKarel Zak2008-12-121-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* simpleinit: cleanup gettext calls, use snprintf()Karel Zak2008-12-121-16/+20
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chfn: several strings without gettext callsKarel Zak2008-12-121-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* TODO: add request to use nl_langinfo()Karel Zak2008-12-121-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Revert "login-utils: several strings without gettext calls"Karel Zak2008-12-124-19/+16Star
| | | | | | | This reverts commit 64fefaf5bffdd4041190f1e5ed4b5d0100638c0d. It does not make sense to localize config options (wdays in checktty.c) and debug messages (main() in checktty.c.
* login: cleanup includesKarel Zak2008-11-261-5/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: sys/types.h and time.h are included more than onceKarel Zak2008-11-261-2/+1Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>