Add a become_root()/unbecome_root() pair to allow acces to the passdb for
authorAndrew Bartlett <abartlet@samba.org>
Tue, 9 Apr 2002 04:59:34 +0000 (04:59 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 9 Apr 2002 04:59:34 +0000 (04:59 +0000)
SID lookup.  This fixes a bug where SIDs (rather than names) are displayed in windows ACL lists

source/rpc_server/srv_lsa_nt.c

index af02a97769216e4ea057529cbdf1109b8625662b..84ab44bc30d019b2b1607cc78ba6a71e0d51fc28 100644 (file)
@@ -233,6 +233,8 @@ static void init_lsa_trans_names(TALLOC_CTX *ctx, DOM_R_REF *ref, LSA_TRANS_NAME
                }
        }
 
+       become_root(); /* Need root to get to passdb to for local sids */
+
        for (i = 0; i < num_entries; i++) {
                BOOL status = False;
                DOM_SID find_sid = sid[i].sid;
@@ -276,6 +278,8 @@ static void init_lsa_trans_names(TALLOC_CTX *ctx, DOM_R_REF *ref, LSA_TRANS_NAME
                total++;
        }
 
+       unbecome_root();
+
        trn->num_entries = total;
        trn->ptr_trans_names = 1;
        trn->num_entries2 = total;