Commit Graph

22 Commits

Author SHA1 Message Date
Benno Schulenberg 1b435f38ef textual: tiny alphabetical and grammatical tweak
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-06-07 11:31:40 +02:00
Benno Schulenberg bb3e58088a textual: standardize the spelling of "superuser"
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-06-07 11:31:37 +02:00
Karel Zak 3e5c0a2db2 su: ignore --preserve-environment, it's mutually exclusive to --login
Addresses: http://bugs.gnu.org/10317
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-29 11:32:58 +02:00
Karel Zak 507341f832 lib/tty: don't hardcode terminal fd in get_terminal_name()
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 15:40:57 +02:00
Benno Schulenberg 0bd341508e su: consistent angular brackets and lowercase in help text of 'su'
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-05-06 17:42:08 +02:00
Karel Zak 49932ad8db su: remove '+' from getopt_long()
# /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>
2013-04-10 14:24:54 +02:00
Karel Zak 82455ad52a su: make code more robust [coverity scan]
... and more readable for static analyzers

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27 14:36:06 +01:00
Sami Kerola 07ff972eb6 translation: unify exec error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-02-06 11:51:17 +01:00
Sami Kerola 09f5902e1e su-common: make usage() translator friendly
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-01-25 16:40:04 +01:00
Karel Zak c74a7af17c su: log failed logins to btmp
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22 15:23:14 +01:00
Karel Zak bbc5a5eac4 su: use get_terminal_name() for compatibility with login(1)
login(1) uses tty name (!= path) in the syslog messages.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22 14:45:49 +01:00
Karel Zak b033211290 su: rename log_su to log_syslog
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-22 13:53:25 +01:00
Karel Zak 360e088738 su: fix "COMMAND not specified" error
# 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>
2012-11-07 15:20:39 +01:00
Karel Zak 7a7f9d3886 runuser: add -u to not execute shell
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-01 10:36:35 +01:00
Vitezslav Cizek 61cebf7747 su: fixed a typo in pam error message
Signed-off-by: Vitezslav Cizek <vcizek@suse.cz>
2012-10-02 10:25:13 +02:00
Karel Zak 705ee62ff0 su: don't modify PATH if -l not specified
This patch reverts a6fdd3f812.

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>
2012-10-02 10:14:05 +02:00
Ondrej Oprala ea8a10391b su: add segmentation fault reporting of the child process
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>
2012-09-21 12:37:18 +02:00
Karel Zak bda67d64de su: move long options to main()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-05 11:26:20 +02:00
Karel Zak 4e1834978f su: verify writing to streams was successful
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-05 11:21:07 +02:00
Karel Zak d10028a712 su: more robust getpwuid() for GNU Hurt [coreutils 71b7ddc]
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>
2012-09-05 11:13:34 +02:00
Karel Zak 7ec6adb1cc runuser: new command (derived from su(1))
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>
2012-09-04 17:00:31 +02:00
Karel Zak cf1a99dacc su: move generic su code to su-common.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-04 17:00:30 +02:00