summaryrefslogtreecommitdiffstats
path: root/login-utils
Commit message (Collapse)AuthorAgeFilesLines
* lslogins: add FAILED-LOGIN to pretty outputKarel Zak2014-05-161-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: sync man page and usage()Karel Zak2014-05-162-79/+81
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: improve pretty outputKarel Zak2014-05-161-28/+44
| | | | | | | | * use Yes/No * print all available information (columns) * cleanup code Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: NLS for all messagesKarel Zak2014-05-161-27/+28
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: conding style changesKarel Zak2014-05-161-343/+340Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: improve supplementary groups code, add SUPP-GIDSKarel Zak2014-05-161-98/+55Star
| | | | | | | | * don't build list, but directly create a string * don't mix IDs and group names on output * add SUPP-GIDS to print only IDs Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: align to right 0|1 columnsKarel Zak2014-05-151-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: cleanup status[] usageKarel Zak2014-05-151-42/+25Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: cleanup fill_table()Karel Zak2014-05-151-62/+36Star
| | | | | | | * check xasprintf() return code is unnecessary * just check all scols_line_set_data() return codes on one place Signed-off-by: Karel Zak <kzak@redhat.com>
* lslogins: mention --time-format in usageOndrej Oprala2014-05-151-1/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: fix option exclusivityOndrej Oprala2014-05-151-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: add option --time-formatOndrej Oprala2014-05-151-0/+31
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: comment-in an expensive reallocOndrej Oprala2014-05-151-1/+2
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: add option --isoOndrej Oprala2014-05-151-9/+10
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: add support for multiple time formatsOndrej Oprala2014-05-151-34/+74
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: pretty printing and extended -l,-gOndrej Oprala2014-05-152-68/+147
|
* lslogins: make it workOndrej Oprala2014-05-151-270/+344
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: use thread-safe functionsOndrej Oprala2014-05-151-27/+43
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: store users in a treeOndrej Oprala2014-05-151-170/+190
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: add functionalityOndrej Oprala2014-05-156-87/+887
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* login: extract get_hushlogin_statusOndrej Oprala2014-05-153-118/+124
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* lslogins: move to login-utilsOndrej Oprala2014-05-153-0/+514
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* agetty: beside virtual consoles support xvc and hvc device lines as wellWerner Fink2014-05-131-5/+12
| | | | | | | | For this approach do not use the ioctl TIOCMGET anymore as this is for real serial lines only. But switch over to use the ioctl KDGKBMODE as this is unique to the virtual console lines only. Signed-off-by: Werner Fink <werner@suse.de>
* agetty: better support of the special system consoles on S390Werner Fink2014-05-131-1/+7
| | | | | | | | | | | | | | | | | That is that there are several consoles, the /dev/ttyS0 which is type of ibm3215 and a dumb terminal, then there is the device /dev/3270/tty1 which can handle ANSI color escape sequences and is a ibm327x terminal, and the /dev/ttyS1 which is a vt220 terminal. The macro is_speed() in agetty.c allows to distinguish between the terminal line (/dev)3270/tty1 and the speed options on the command line used in /run/systemd/generator/getty.target.wants/serial-getty@3270-tty1.service which is a symbolic link to /usr/lib/systemd/system/serial-getty@.service Signed-off-by: Werner Fink <werner@suse.de>
* sulogin: find a suitable console device Werner Fink2014-05-131-2/+4
| | | | | | | Enable sulogin to find a suitable console device even if the first line in /proc/consoles does not have any major and minor number. Signed-off-by: Werner Fink <werner@suse.de>
* agetty: avoid that agetty nor sulogin are fooled by a running plymouthWerner Fink2014-05-131-1/+50
| | | | | | | | The nowadays used plymouth locks the devices used for the system console which causes that agetty as well as sulogin can not modify the termios settings of e.g. the serial devices of the systenm console. Signed-off-by: Werner Fink <werner@suse.de>
* last: avoid leading "-" before "no logout"Ruediger Meier2014-05-101-1/+4
| | | | | | This affects option --time-format=notime. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* last: minor cleanup if statementsRuediger Meier2014-05-081-6/+6
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* last: --time-format=full should do the same like -FRuediger Meier2014-05-081-8/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | For no reason "full" did something else than "iso" or -F as you see here: $ ./last -f ../tests/ts/last/wtmp.LE --time-format=full | grep -A2 "no logout" torvalds linux hobby Mon Aug 26 02:57:08 1991 gone - no logout reboot system boot system-name Wed Aug 28 20:00:00 2013 still running reboot system boot system-name Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013 (01:00) $ ./last -f ../tests/ts/last/wtmp.LE --time-format=iso | grep -A2 "no logout" torvalds linux hobby 1991-08-26T02:57:08+0200 gone - no logout reboot system boot system-name 2013-08-28T20:00:00+0200 still running reboot system boot system-name 2013-08-28T18:00:00+0200 - 2013-08-28T19:00:00+0200 (01:00) $ ./last -f ../tests/ts/last/wtmp.LE -F | grep -A2 "no logout" torvalds linux hobby Mon Aug 26 02:57:08 1991 gone - no logout reboot system boot system-name Wed Aug 28 20:00:00 2013 still running reboot system boot system-name Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013 (01:00) Also note the useless leading space before "gone" The only thing which matters is fmt->out width when printing these strings like "still running". Now ctl->fulltime flag is unsused and removed. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* last: fix uninitialized lengthRuediger Meier2014-05-071-2/+3
| | | | | | length was unset when using "last --time-format=iso" Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* lib/timeutils: remove get_boot_time from libcommonKarel Zak2014-05-062-2/+3
| | | | | | | | clock_gettime() needs -lrt, so let's keep this stuff outside libcommon.la Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* chsh: Improve the typesetting of the manualBjarni Ingi Gislason2014-05-061-2/+2
| | | | | | | | Protect a full stop (.), that begins or ends a string, with \& Change '-' to '\-', if it indicates an option Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* chfn: Improve the typesetting of the manualBjarni Ingi Gislason2014-05-061-4/+4
| | | | | | | | | | | | | | Change comma (,) to a period (.) as it is the control character Use macro RB instead of the reverse one (BR) Add missing [ in front of an (optional) option Protect a full stop (.), that begins or ends a string, with \& Change '-' to '\-', if it indicates an option Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
* last: fix is_phantom() detectionSami Kerola2014-05-041-4/+11
| | | | | | | | | | | | | The /proc/<pid>/loginuid is not always available, and when so a running session should not be determined to be gone. This is a regression from commit mentioned in reference. Sessions that have started before previous system boot, and did not log out meanwhile, will be marked as gone. It is fair to say that these sessions are most likely result of a wtmp corruption. Reference: 404fa3f93c00c7e130f5a0ec963b2dc6a3743986 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* vipw: minor man page improvementsOndrej Oprala2014-04-141-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* nologin: minor man page improvementsOndrej Oprala2014-04-141-5/+5
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* utmpdump: minor man page improvementsOndrej Oprala2014-04-141-12/+12
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* sulogin: minor man page improvementsOndrej Oprala2014-04-141-1/+1
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* su: fix minor typos in the man pageOndrej Oprala2014-04-141-10/+10
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* runuser: fix minor typos in the man pageOndrej Oprala2014-04-141-14/+14
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* last: fix minor typos in the man pageOndrej Oprala2014-04-141-16/+16
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* login: fix minor typos in the man pageOndrej Oprala2014-04-071-16/+16
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* include/carefulputc: cleanup and add fputs_{quoted,nonblank}()Karel Zak2014-04-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: don't use kill(0, ...) when propagate signalKarel Zak2014-02-171-1/+1
| | | | | | | | | | | The current code uses kill(0, caught_signal) after regular signal cleanup and before exit (all just to make shells happy). Unfortunately, kill(0, ...) is a bad idea. It seems better to use kill(getpid(), ...) otherwise we kill our parent process too. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1063887 Signed-off-by: Karel Zak <kzak@redhat.com>
* last: make session gone determination more robustSami Kerola2014-02-101-3/+22
| | | | | | | | | | | | Earlier determination that used kill with signal zero to pid was prone to false positive reports, due reuse of pid space and unrelated processes. New function is_phantom() tries do a little bit better job, but fails to be perfect. It seems linking to gether utmp session start time or terminal id with /proc/<pid>/ information is not as simple as one might hope. Reported-by: Karel Zak <kzak@redhat.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/c.h: prefer nanosleep() over usleep()Karel Zak2014-01-241-2/+2
| | | | | | | | | | | | | | Let's use nanosleep() although if usleep() exists. The nanosleep function does no interact with signals and other timers. The patch introduces xusleep() as replacement to libc (or our fallback) usleep(). Yes, we don't want to use struct timespec + nanosleep() everywhere in code as nano-time resolution is useless for us. The patch also enlarges delays in some busy wait loops. It seems enough to try read/write 4x per second. Signed-off-by: Karel Zak <kzak@redhat.com>
* man: Syntax and spelling fixes.Ville Skyttä2014-01-061-1/+1
| | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
* sulogin: use dirent->d_type when scans /devKarel Zak2013-11-121-0/+5
| | | | | | ... it's more effective than call fstatat() for all device. Signed-off-by: Karel Zak <kzak@redhat.com>
* chsh, chfn: add info about non-local support to the man pagesKarel Zak2013-11-112-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: add info about pam_lastlog to su.1Karel Zak2013-10-211-0/+14
| | | | | References: https://bugzilla.redhat.com/show_bug.cgi?id=1021108 Signed-off-by: Karel Zak <kzak@redhat.com>