]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r15539: Use portable wrapper functions instead of seteuid
authorJeremy Allison <jra@samba.org>
Thu, 11 May 2006 22:47:28 +0000 (22:47 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:16:56 +0000 (11:16 -0500)
directly in winbindd.
Jeremy.
(This used to be commit 2e65fcc9def5f1386a33ca4a76e494838e3a0632)

source3/nsswitch/winbindd_cred_cache.c
source3/nsswitch/winbindd_pam.c

index db1dc577956b265ee573fa83c1c16c8df7b701d9..84c316dbf8bc652fda589461c67844d2366bec09 100644 (file)
@@ -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)));
index 243d2a7838638923de680ae5e76582a3a36c714a..b02ba8e36cac7dc31634cc62ee12e9e896df58c7 100644 (file)
@@ -478,7 +478,7 @@ static NTSTATUS winbindd_raw_kerberos_login(struct winbindd_domain *domain,
 
        if (!internal_ccache) {
 
-               seteuid(uid);
+               set_effective_uid(uid);
                DEBUG(10,("winbindd_raw_kerberos_login: uid is %d\n", uid));
        }
 
@@ -533,7 +533,7 @@ static NTSTATUS winbindd_raw_kerberos_login(struct winbindd_domain *domain,
        }
 
        if (!internal_ccache) {
-               seteuid(0);
+               gain_root_privilege();
        }
 
        /************************ NON-ROOT **********************/
@@ -631,7 +631,7 @@ done:
        SAFE_FREE(client_princ_out);
 
        if (!internal_ccache) {
-               seteuid(0);
+               gain_root_privilege();
        }
 
        return result;