diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-12-08 19:34:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:46 -0500 |
commit | 6a92f418ea36eb12b247e11656b3e8bbe367f394 (patch) | |
tree | e640452353a1bbe4cb41f3e518e948c6d6e69204 /source3/rpc_server/srv_samr_nt.c | |
parent | 5ffc3b18ef31bb96d750b1bceab4fa7f00eb2852 (diff) | |
download | samba-6a92f418ea36eb12b247e11656b3e8bbe367f394.tar.gz samba-6a92f418ea36eb12b247e11656b3e8bbe367f394.tar.bz2 samba-6a92f418ea36eb12b247e11656b3e8bbe367f394.zip |
r12133: Fix an uninitialized variable in new code in rpc_server/srv_samr_nt.c.
Fix winbind_lookup_name for the local domain, ie for aliases on a member
server.
Volker
(This used to be commit 4ba50c823e8d61f87ab5627f15e826e73e45ffcc)
Diffstat (limited to 'source3/rpc_server/srv_samr_nt.c')
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 13f3a3284b..880e1db388 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -2243,6 +2243,8 @@ static NTSTATUS can_create(TALLOC_CTX *mem_ctx, const char *new_name) enum SID_NAME_USE type; BOOL result; + DEBUG(10, ("Checking whether [%s] can be created\n", new_name)); + become_root(); /* Lookup in our local databases (only LOOKUP_NAME_ISOLATED set) * whether the name already exists */ @@ -2251,6 +2253,7 @@ static NTSTATUS can_create(TALLOC_CTX *mem_ctx, const char *new_name) unbecome_root(); if (!result) { + DEBUG(10, ("%s does not exist, can create it\n", new_name)); return NT_STATUS_OK; } @@ -4308,16 +4311,16 @@ NTSTATUS _samr_create_dom_alias(pipes_struct *p, SAMR_Q_CREATE_DOM_ALIAS *q_u, S if (!sid_equal(&dom_sid, get_global_sam_sid())) return NT_STATUS_ACCESS_DENIED; - r_u->status = can_create(p->mem_ctx, name); - if (!NT_STATUS_IS_OK(r_u->status)) { - return r_u->status; - } - unistr2_to_ascii(name, &q_u->uni_acct_desc, sizeof(name)-1); se_priv_copy( &se_rights, &se_add_users ); can_add_accounts = user_has_privileges( p->pipe_user.nt_user_token, &se_rights ); + result = can_create(p->mem_ctx, name); + if (!NT_STATUS_IS_OK(result)) { + return result; + } + /******** BEGIN SeAddUsers BLOCK *********/ if ( can_add_accounts ) |