summaryrefslogtreecommitdiffstats
path: root/login-utils/su-common.c
Commit message (Collapse)AuthorAgeFilesLines
* lib/tty: don't hardcode terminal fd in get_terminal_name()Karel Zak2013-05-131-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* su: consistent angular brackets and lowercase in help text of 'su'Benno Schulenberg2013-05-061-12/+11Star
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* su: remove '+' from getopt_long()Karel Zak2013-04-101-1/+1
| | | | | | | | # /bin/su - -c 'echo test' su: user -c does not exist Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=950495 Signed-off-by: Karel Zak <kzak@redhat.com>
* su: make code more robust [coverity scan]Karel Zak2013-03-271-0/+3
| | | | | | ... and more readable for static analyzers Signed-off-by: Karel Zak <kzak@redhat.com>
* translation: unify exec error messagesSami Kerola2013-02-061-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* su-common: make usage() translator friendlySami Kerola2013-01-251-12/+10Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* 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-221-2/+3
| | | | | | login(1) uses tty name (!= path) in the syslog messages. 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>
* runuser: add -u to not execute shellKarel Zak2012-11-011-47/+91
| | | | 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: 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>
* 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>
* runuser: new command (derived from su(1))Karel Zak2012-09-041-8/+43
| | | | | | | | | | | | | | | | | | | | | | | 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-041-0/+883
Signed-off-by: Karel Zak <kzak@redhat.com>