svn commit: samba r12504 - in
branches/SAMBA_4_0/source/rpc_server/samr: .
abartlet at samba.org
abartlet at samba.org
Mon Dec 26 23:47:20 GMT 2005
Author: abartlet
Date: 2005-12-26 23:47:19 +0000 (Mon, 26 Dec 2005)
New Revision: 12504
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12504
Log:
Fix one more transaction cancel bail-out path, and correct comments.
Andrew Bartlett
Modified:
branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c 2005-12-26 23:14:56 UTC (rev 12503)
+++ branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c 2005-12-26 23:47:19 UTC (rev 12504)
@@ -706,7 +706,9 @@
/*
samr_CreateUser2
- TODO: This should do some form of locking, especially around the rid allocation
+ This call uses transactions to ensure we don't get a new conflicting
+ user while we are processing this, and to ensure the user either
+ completly exists, or does not.
*/
static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct samr_CreateUser2 *r)
@@ -771,7 +773,11 @@
}
cn_name = talloc_strdup(mem_ctx, account_name);
- NT_STATUS_HAVE_NO_MEMORY(cn_name);
+ if (!cn_name) {
+ ldb_transaction_cancel(d_state->sam_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+
cn_name_len = strlen(cn_name);
/* This must be one of these values *only* */
More information about the samba-cvs
mailing list