Commit Graph

702 Commits

Author SHA1 Message Date
Karel Zak f7aea533f4 lslogins: fix nologins check
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-29 13:24:35 +02:00
Karel Zak ea24eacc6b lslogins: cleanup time formats
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-29 13:21:57 +02:00
Karel Zak f47c6d3a59 lslogins: clean up password hash check
* rename to PWD-* column names
 * add PWD-DENY for accounts where is no possible to login by password
 * PWD-LOCK (was LOCKED) checks for valid but locked pawwords
 * LOGIN renamed to USER

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-29 12:48:40 +02:00
Karel Zak d8b2ddb7bb lslogins: remove --sort-by-name
If we really need a sort functionality hardcoded into lslogins(1) then we need
a generic sort options (like for lsblk,--sort <column>).

Note that it seems that "lslogins | sort --key <col>" is good enough for now as
lslogins(1) does not convert any data to human readable non-precise format (like
for example lsblk SIZE column etc.).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-29 11:46:56 +02:00
Karel Zak 1624245ffe lslogins: improve nologins and shadow usage
* fix coding style
 * don't require shadow entries
 * check for /var/run/nologin

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-29 11:30:26 +02:00
Karel Zak f37b357b47 lslogins: print systemd journal logs
Co-Author: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-27 17:34:15 +02:00
Ondrej Oprala d3a93df80d lslogins: count per-user processes
[kzak@redhat.com: - rename column, align to right]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-27 17:01:05 +02:00
Karel Zak 56c8f8af4c lslogins: add FAILED-LOGIN to pretty output
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 14:14:02 +02:00
Karel Zak 512abd5694 lslogins: sync man page and usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 14:04:54 +02:00
Karel Zak 10c74524e5 lslogins: improve pretty output
* use Yes/No
 * print all available information (columns)
 * cleanup code

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 12:35:46 +02:00
Karel Zak 3e5cba73f1 lslogins: NLS for all messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 11:41:18 +02:00
Karel Zak 8b5e227978 lslogins: conding style changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-16 11:31:00 +02:00
Karel Zak 68657ea2e7 lslogins: improve supplementary groups code, add SUPP-GIDS
* 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>
2014-05-16 11:14:32 +02:00
Karel Zak 07a4046f95 lslogins: align to right 0|1 columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-15 14:10:50 +02:00
Karel Zak a94baf36dc lslogins: cleanup status[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-15 14:01:51 +02:00
Karel Zak 5424d2a225 lslogins: cleanup fill_table()
* 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>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 3a016a536b lslogins: mention --time-format in usage
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 32badc3466 lslogins: fix option exclusivity
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala c20ffb8f69 lslogins: add option --time-format
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 969ee9e3ff lslogins: comment-in an expensive realloc
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 4ea7848b50 lslogins: add option --iso
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:56:00 +02:00
Ondrej Oprala 384965928a lslogins: add support for multiple time formats
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala c77108b867 lslogins: pretty printing and extended -l,-g 2014-05-15 13:55:59 +02:00
Ondrej Oprala c6cf4d1c46 lslogins: make it work
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala 1ebfc60a0f lslogins: use thread-safe functions
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala dd7760a8c1 lslogins: store users in a tree
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala 29cc2a5568 lslogins: add functionality
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala 78dd745089 login: extract get_hushlogin_status
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala 914e20a00a lslogins: move to login-utils
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Werner Fink b9c7390948 agetty: beside virtual consoles support xvc and hvc device lines as well
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>
2014-05-13 10:40:11 +02:00
Werner Fink f2bcda5183 agetty: better support of the special system consoles on S390
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>
2014-05-13 10:39:40 +02:00
Werner Fink 624b204d7b sulogin: find a suitable console device
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>
2014-05-13 10:38:06 +02:00
Werner Fink bb280f79f1 agetty: avoid that agetty nor sulogin are fooled by a running plymouth
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>
2014-05-13 10:36:49 +02:00
Ruediger Meier 6e69f1ee0f last: avoid leading "-" before "no logout"
This affects option --time-format=notime.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-10 15:17:42 +02:00
Ruediger Meier 4fcbfaa81d last: minor cleanup if statements
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-08 22:14:27 +02:00
Ruediger Meier f16d5044e1 last: --time-format=full should do the same like -F
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>
2014-05-08 22:14:06 +02:00
Ruediger Meier d3108db19e last: fix uninitialized length
length was unset when using "last --time-format=iso"

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-07 14:42:36 +02:00
Karel Zak 08ca3e26a8 lib/timeutils: remove get_boot_time from libcommon
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>
2014-05-06 13:16:05 +02:00
Bjarni Ingi Gislason 802cb7db71 chsh: Improve the typesetting of the manual
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>
2014-05-06 11:57:01 +02:00
Bjarni Ingi Gislason b5fff5211b chfn: Improve the typesetting of the manual
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>
2014-05-06 11:56:49 +02:00
Sami Kerola 0e5218acd9 last: fix is_phantom() detection
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: 404fa3f93c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-04 11:42:03 +01:00
Ondrej Oprala 46e0dd136f vipw: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:46:01 +02:00
Ondrej Oprala fd2e45b78e nologin: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:45:59 +02:00
Ondrej Oprala 38e3e66f70 utmpdump: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:45:59 +02:00
Ondrej Oprala 20400eb4a6 sulogin: minor man page improvements
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:45:58 +02:00
Ondrej Oprala 2b5e13351f su: fix minor typos in the man page
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:45:57 +02:00
Ondrej Oprala 96b65fb3ce runuser: fix minor typos in the man page
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:45:55 +02:00
Ondrej Oprala 9fb4d0138a last: fix minor typos in the man page
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-14 13:45:54 +02:00
Ondrej Oprala 3aca66a54d login: fix minor typos in the man page
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-07 12:38:17 +02:00
Karel Zak 78a3b0af30 include/carefulputc: cleanup and add fputs_{quoted,nonblank}()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00