diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2013-09-16 11:48:12 +0200 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2013-09-16 11:48:12 +0200 |
commit | ba315ae8effdcad591608c99452dad05c4cf20ab (patch) | |
tree | 5b7ef082e883af17506cba5d42b58dbeb36f419a /modules/pam_unix/pam_unix_acct.c | |
parent | 45ec020678ffc82f6c2849935907e2d83710a1f2 (diff) | |
download | pam-ba315ae8effdcad591608c99452dad05c4cf20ab.tar.gz pam-ba315ae8effdcad591608c99452dad05c4cf20ab.tar.bz2 pam-ba315ae8effdcad591608c99452dad05c4cf20ab.zip |
Check return value of setuid to remove glibc warnings.
* modules/pam_unix/pam_unix_acct.c: Check setuid return value.
* modules/pam_unix/support.c: Likewise.
Diffstat (limited to 'modules/pam_unix/pam_unix_acct.c')
-rw-r--r-- | modules/pam_unix/pam_unix_acct.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/pam_unix/pam_unix_acct.c b/modules/pam_unix/pam_unix_acct.c index 865dc290..8ec44492 100644 --- a/modules/pam_unix/pam_unix_acct.c +++ b/modules/pam_unix/pam_unix_acct.c @@ -121,7 +121,12 @@ int _unix_run_verify_binary(pam_handle_t *pamh, unsigned int ctrl, if (geteuid() == 0) { /* must set the real uid to 0 so the helper will not error out if pam is called from setuid binary (su, sudo...) */ - setuid(0); + if (setuid(0) == -1) { + pam_syslog(pamh, LOG_ERR, "setuid failed: %m"); + printf("-1\n"); + fflush(stdout); + _exit(PAM_AUTHINFO_UNAVAIL); + } } /* exec binary helper */ |