summaryrefslogtreecommitdiff
path: root/login-utils
AgeCommit message (Collapse)AuthorFilesLines
2011-01-20use uint32_t instead of u_int32_tFabian Groffen1-5/+6
Solaris doesn't have u_int32_t, use standards uint32_t instead Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-01-17build-sys: improve check for cryptFabian Groffen6-10/+18
Check for crypt.h existence, and use it if available over using unistd.h for which a certain feature level has to be set to export a definition for crypt. On Solaris this set causes a standards conflict in the headers, because at the time of this check C99 mode is already enabled, which implies certain standards non-compatible with _XOPEN_SOURCE. 92 #define _XOPEN_SOURCE 93 #include <unistd.h> configure:16259: gcc -std=gnu99 -c -g -O2 conftest.c >&5 In file included from /usr/include/unistd.h:18, from conftest.c:93: /prefix/gentoo/usr/lib/gcc/i386-pc-solaris2.10/4.4.5/include-fixed/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications" configure.ac: improve crypt check login-utils/my_crypt.h: replace old GNU_LIBRARY check with autoconf define for crypt.h [kzak@redhat.com: - remove my_crypt.h] Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-17wall: add usage functionDavidlohr Bueso1-5/+8
Instead of using an ugly goto statement, we can add a proper usage function. This also adds the undocumented '-n' option to the output string. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-01-04agetty: use ignore_result() or write(1, ...)Karel Zak1-13/+15
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10mesg: change error exit code from 1 to >1Francesco Cosoleto1-9/+15
According to POSIX and mesg(1) error exit code should be >1. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-12-10simpleinit: move old init stuff to separate directoryKarel Zak13-2737/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10vipw: fix warn_unused_result gcc warningKarel Zak1-1/+3
vipw.c:194:6: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10fix __noreturn__ usageKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10chfn: Use EXIT_* and err()Marek Polacek1-82/+45
[kzak@redhat.com: - clean usage() calls and some error messages] Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10wall: fix coding styleKarel Zak1-12/+13
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10wall: remove prognameKarel Zak1-9/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10wall: Use EXIT_* and err()Marek Polacek1-25/+18
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10vipw: use EXIT_* and err()Marek Polacek1-22/+22
[kzak@redhat.com: - fix one error message] Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10simpleinit: Use EXIT_*Marek Polacek1-6/+6
[kzak@redhat.com: use the main() part of the patch] Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10shutdown: Use EXIT_*Marek Polacek1-36/+29
Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10login: fix "ignoring return value" errorsKarel Zak1-10/+26
login.c:542:8: warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result login.c:1013:11: warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result login.c: In function ‘dolastlog’: login.c:1452:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result login.c: In function ‘motd’: login.c:1391:7: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10login: use EXIT_* and err.h, clean up return codesMarek Polacek1-49/+41
[kzak@redhat.com: - cleanup return codes - use warn()] Signed-off-by: Marek Polacek <mmpolacek@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10last: Use EXIT_* and err()Marek Polacek1-19/+23
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-10login: use EXIT_* in checktty()Karel Zak1-5/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-10chsh: use EXIT_* and err.hKarel Zak1-95/+59
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-02build-sys: add mesg to .gitignoreKarel Zak1-0/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-02agetty: Use EXIT_* and add noreturn attributeMarek Polacek1-12/+10
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-12-02mesg: Use EXIT_* and discard K&R style declaration.Marek Polacek1-24/+22
[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>
2010-12-02newgrp: Use err() and EXIT_*Marek Polacek1-28/+19
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>
2010-11-30last: use xalloc libDavidlohr Bueso1-12/+4
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-30login: use xalloc libDavidlohr Bueso1-7/+2
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-30wall: use xalloc libDavidlohr Bueso1-4/+3
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2010-11-30rename util-linux-ng back to util-linuxKarel Zak11-22/+22
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-23lib: [strutils] general purpose string handling functionsDavidlohr Bueso8-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>
2010-11-15agetty: use nl_langinfo()Karel Zak2-9/+7
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-29use _exit() instead of exit() in sighandlersMarek Polacek2-2/+2
Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
2010-10-26agetty: fix -s option (baud rate setup)Karel Zak1-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>
2010-08-18agetty: add -c to reuse cflagsKarel Zak2-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>
2010-08-18aggety: don't wipe CLOCAL flagKarel Zak1-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>
2010-08-18agetty: add -s to reuse existing baud rateKarel Zak2-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>
2010-07-29chsh: don't suggest ypchshKarel Zak4-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>
2010-06-14textual: fix typos, and rephrase some things for clarityBenno Schulenberg1-2/+2
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
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>