Commit Graph

58 Commits

Author SHA1 Message Date
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