summaryrefslogtreecommitdiffstats
path: root/source3/nsswitch/winbindd_cred_cache.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-05-11 22:47:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:16:56 -0500
commit71465a6fbc2941c77141607bd4af312d15fe3892 (patch)
tree00aa7ab115478498580eaaf8e0872c4428120ab5 /source3/nsswitch/winbindd_cred_cache.c
parent2dd8857dcbf6520228ef8676264f4405198f132e (diff)
downloadsamba-71465a6fbc2941c77141607bd4af312d15fe3892.tar.gz
samba-71465a6fbc2941c77141607bd4af312d15fe3892.tar.xz
samba-71465a6fbc2941c77141607bd4af312d15fe3892.zip
r15539: Use portable wrapper functions instead of seteuid
directly in winbindd. Jeremy. (This used to be commit 2e65fcc9def5f1386a33ca4a76e494838e3a0632)
Diffstat (limited to 'source3/nsswitch/winbindd_cred_cache.c')
-rw-r--r--source3/nsswitch/winbindd_cred_cache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_cred_cache.c b/source3/nsswitch/winbindd_cred_cache.c
index db1dc577956..84c316dbf8b 100644
--- a/source3/nsswitch/winbindd_cred_cache.c
+++ b/source3/nsswitch/winbindd_cred_cache.c
@@ -105,7 +105,7 @@ static void krb5_ticket_refresh_handler(struct timed_event *te,
if ((entry->renew_until < time(NULL)) && (entry->pass != NULL)) {
- seteuid(entry->uid);
+ set_effective_uid(entry->uid);
ret = kerberos_kinit_password_ext(entry->principal_name,
entry->pass,
@@ -116,7 +116,7 @@ static void krb5_ticket_refresh_handler(struct timed_event *te,
False, /* no PAC required anymore */
True,
WINBINDD_PAM_AUTH_KRB5_RENEW_TIME);
- seteuid(0);
+ gain_root_privilege();
if (ret) {
DEBUG(3,("could not re-kinit: %s\n", error_message(ret)));
@@ -132,13 +132,13 @@ static void krb5_ticket_refresh_handler(struct timed_event *te,
goto done;
}
- seteuid(entry->uid);
+ set_effective_uid(entry->uid);
ret = smb_krb5_renew_ticket(entry->ccname,
entry->principal_name,
entry->service,
&new_start);
- seteuid(0);
+ gain_root_privilege();
if (ret) {
DEBUG(3,("could not renew tickets: %s\n", error_message(ret)));