summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr_nt.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-06-13 14:06:08 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-06-13 14:06:08 +0000
commitbad738e6536e983064eee7647229354bc9028183 (patch)
treea3f36ff7035d676e28d60c0249dfdbf37cac6317 /source3/rpc_server/srv_samr_nt.c
parent2154ebce84c6cf376e7183e8c5f7ad0e17aead97 (diff)
downloadsamba-bad738e6536e983064eee7647229354bc9028183.tar.gz
samba-bad738e6536e983064eee7647229354bc9028183.tar.bz2
samba-bad738e6536e983064eee7647229354bc9028183.zip
Latest patch from metze <metze@metzemix.de> to move most of samba across
to using SIDs instead of RIDs. The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument. The idea here is to prevent mistakes where the SID is implict, but isn't the same one that we have in the struct. Andrew Bartlett (This used to be commit 04f9a8ff4c7982f6597c0f6748f85d66d4784901)
Diffstat (limited to 'source3/rpc_server/srv_samr_nt.c')
-rw-r--r--source3/rpc_server/srv_samr_nt.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index daa39b215f..a6f936feca 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -2019,18 +2019,9 @@ NTSTATUS _api_samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_
return NT_STATUS_ACCESS_DENIED;
}
- /* Get the domain SID stored in the domain policy */
- if(!get_lsa_policy_samr_sid(p, &dom_pol, &sid)) {
- pdb_free_sam(&sam_pass);
- return NT_STATUS_INVALID_HANDLE;
- }
-
- /* append the user's RID to it */
- if(!sid_append_rid(&sid, pdb_get_user_rid(sam_pass) )) {
- pdb_free_sam(&sam_pass);
- return NT_STATUS_NO_SUCH_USER;
- }
-
+ /* Get the user's SID */
+ sid_copy(&sid, (DOM_SID *) pdb_get_user_sid(sam_pass));
+
/* associate the user's SID with the new handle. */
if ((info = get_samr_info_by_sid(&sid)) == NULL) {
pdb_free_sam(&sam_pass);