summaryrefslogtreecommitdiffstats
path: root/login-utils
Commit message (Collapse)AuthorAgeFilesLines
* login: remove file descriptor leak [cppcheck]Sami Kerola2013-03-041-1/+3
| | | | | | [login-utils/login.c:510]: (error) Resource leak: fd Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* add missing rpmatch.h everywhere it needs to beWilliam Pitcock2013-02-201-0/+1
| | | | | Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* chsh-chfn: fix bugs, improve compilationKarel Zak2013-02-135-27/+38
| | | | | | | | | | | | | | * rename --disable-require-password to --disable-chsh-chfn-password * is_local() is really unnecessary when linked with libuser * fix set_value_libuser() returns codes * fix chfn.c, there is no 'pw', but oldf.pw * don't link with PAM when--disable-chsh-chfn-password Signed-off-by: Karel Zak <kzak@redhat.com>
* chfn: Add libuser supportCody Maloney2013-02-131-4/+23
| | | | Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
* chsh: Add libuser supportCody Maloney2013-02-134-1/+109
| | | | | | | | | | This is based directly on lchsh which is a part of libuser. libuser.{c,h} exist because exactly the same code is needed for both chsh and chfn. [kzak@redhat.com: cleanup err() usage] Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* chsh-chfn: Move pam auth to its own function, factoring out common codeCody Maloney2013-02-135-60/+68
| | | | | | | This makes it easier to add support for libuser, which needs the same PAM authentication. Also removes duplicate code between chsh and chfn. Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
* build-sys: Add flag for enabling/disabling libuser support.Cody Maloney2013-02-131-0/+5
| | | | Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
* translation: unify exec error messagesSami Kerola2013-02-063-5/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* textual: fix two misencodings in commentsBenno Schulenberg2013-02-061-2/+2
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* textual: spell and encode the name of Arkadiusz Miśkiewicz correctlyBenno Schulenberg2013-02-066-7/+7
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* newgrp: more robust crypt() usageKarel Zak2013-02-011-3/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* textual: gettextize an overlooked stringBenno Schulenberg2013-01-301-1/+1
| | | | | | * login-utils/islocal.c: Gettexttize the usage message. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* su-common: make usage() translator friendlySami Kerola2013-01-251-12/+10Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* include/ttyutils: add default chardataWerner Fink2013-01-083-12/+2Star
| | | | | | | | | | | | this one moves the init_chardata to include/ttyutils.h as well as to lib/include/ttyutils.c. Also the macros CTL/CTRL are fixed in agetty.c and sulogin.c to use the XOR variant CTL. [kzak@redhat.com: use macro rather than global variable for default chardata] Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* agetty: replace perms 660 to 620Karel Zak2013-01-021-1/+4
| | | | | | ... the default is root:tty 620 Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: don't use {de,con}structor attributesKarel Zak2012-12-233-2/+17
| | | | | | | We're not Russian roulette players, so don't use such ugly things at all.. Reported-by: Dave Reisner <d@falconindy.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: remove consoles.c from libcommonKarel Zak2012-12-234-2/+839
| | | | | | | | - move struct chardata to include/ttyutils.h - move console.{h,c} to login-utils/sulogin-* (it's sulogin specific) - fix sulogin and agetty includes Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: map NL to CR-NL on output in initial termios settingsKarel Zak2012-12-191-1/+3
| | | | | | (See also 9c62a2326e6e39a5e759830b0b9d91696166fb45 agetty patch). Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: minor coding style changesKarel Zak2012-12-181-13/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sulogin: add multi console feature from SysVinit suloginWerner Fink2012-12-181-149/+516
| | | | | | | | | | | | | Now after adding Conflicts=rescue.service to getty@.service and serial-getty@.service and Conflicts=getty.target to rescue.target all works with `systemctl rescue'. Even adding init=/sbin/sulogin to the kernels command line by using the `e' key in grub2 boot menu works flawless. This version is without the emergency code as I've this moved to lib/console.c where it belongs to. Signed-off-by: Werner Fink <werner@suse.de>
* sulogin: use alarm function to indicate if a timeout occursWerner Fink2012-12-181-3/+17
| | | | | | A small change to use the alarm handler to indicate if a timeout occurs. Signed-off-by: Werner Fink <werner@suse.de>
* login: check lastlog lseek return code [coverity scan]Karel Zak2012-12-121-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chsh: use return rather than exit in main, clean up man pageKarel Zak2012-12-122-17/+18
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chfn: always use return rather than exit() in mainKarel Zak2012-12-121-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* chfn: clean up exit statusKarel Zak2012-12-122-6/+7
| | | | | | | | The old version in some cases (but not always) returns -1 (255) on error. It seems better to cleanup the code and don't return internal return codes by exit(). Signed-off-by: Karel Zak <kzak@redhat.com>
* vipw: remove unused set{uid,gid} callsKarel Zak2012-12-041-6/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: log failed logins to btmpKarel Zak2012-11-221-2/+50
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: use get_terminal_name() for compatibility with login(1)Karel Zak2012-11-222-4/+5
| | | | | | login(1) uses tty name (!= path) in the syslog messages. Signed-off-by: Karel Zak <kzak@redhat.com>
* login: use get_terminal_name() from ttyutils.cKarel Zak2012-11-221-14/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: rename log_su to log_syslogKarel Zak2012-11-221-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: fix "COMMAND not specified" errorKarel Zak2012-11-071-10/+19
| | | | | | | | | | # su su: COMMAND not specified This error message make sense for "runuser -u <user> <command>" only. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=872787 Signed-off-by: Karel Zak <kzak@redhat.com>
* su: fix stupid typoKarel Zak2012-11-012-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: move runuser(1) to sbin dirKarel Zak2012-11-011-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* runuser: add -u to not execute shellKarel Zak2012-11-013-54/+105
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: fix compiler warning [-Wunused-result]Karel Zak2012-10-221-6/+10
| | | | | | | It's probably unnecessary paranoia, but let's check if we're able to restore the original IDs after ~/.hushlogin file check. Signed-off-by: Karel Zak <kzak@redhat.com>
* last: stop usig MAXHOSTNAMELENKarel Zak2012-10-191-3/+5
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: stop using MAXHOSTNAMELENKarel Zak2012-10-191-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* login: reuse DEAD_PROCESS utmp entriesKarel Zak2012-10-051-3/+11
| | | | | Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=858009 Signed-off-by: Karel Zak <kzak@redhat.com>
* su: fixed a typo in pam error messageVitezslav Cizek2012-10-021-1/+1
| | | | Signed-off-by: Vitezslav Cizek <vcizek@suse.cz>
* su: don't modify PATH if -l not specifiedKarel Zak2012-10-021-125/+1Star
| | | | | | | | | | | This patch reverts a6fdd3f8125be23930d955c2bc6b7a46cdaf8a12. su(1) modifies PATH if: - option -l specified - ALWAYS_SET_PATH login.defs variable set Reported-by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* su: fix compiler warning [-Wstrict-prototypes]Karel Zak2012-09-211-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: add segmentation fault reporting of the child processOndrej Oprala2012-09-211-1/+6
| | | | | | | | | Child processes that ended with segmentation fault previously indicated this with return status only. The report is now more verbose if core dump is allowed. Improved-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* sulogin: cleanup file descriptors usageKarel Zak2012-09-071-13/+16
| | | | | | | - use _FILENO macros rather than magic numbers - check for dup() result Signed-off-by: Karel Zak <kzak@redhat.com>
* su: move long options to main()Karel Zak2012-09-051-15/+14Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: verify writing to streams was successfulKarel Zak2012-09-051-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: more robust getpwuid() for GNU Hurt [coreutils 71b7ddc]Karel Zak2012-09-051-3/+23
| | | | | | | Let's support GNU Hurd over-engineering where a process can exist without UID and getuid() returns -1 and sets errno. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: install su.1 if building suDave Reisner2012-09-051-0/+1
| | | | Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* runuser: add note about PAM to man pageKarel Zak2012-09-041-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* runuser: new command (derived from su(1))Karel Zak2012-09-044-8/+293
| | | | | | | | | | | | | | | | | | | | | | | This command is based on su(1), the differences: - based on Fedora runuser su(1) patch - not installed with suid rights - allowed for root users only - don't ask for password - uses PAM session, for example: $ cat /etc/pam.d/runuser auth sufficient pam_rootok.so session optional pam_keyinit.so revoke session required pam_limits.so session required pam_unix.so $ cat /etc/pam.d/runuser-l auth include runuser session optional pam_keyinit.so force revoke session include runuser Signed-off-by: Karel Zak <kzak@redhat.com>
* su: move generic su code to su-common.cKarel Zak2012-09-044-873/+899
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>