svn commit: samba r16954 - branches/SAMBA_3_0/source/rpc_server trunk/source/rpc_server

jerry at samba.org jerry at samba.org
Tue Jul 11 20:31:14 GMT 2006


Author: jerry
Date: 2006-07-11 20:31:13 +0000 (Tue, 11 Jul 2006)
New Revision: 16954

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16954

Log:
Volker reminded me we already have code to do this check.
Reuse can_create() to prevent renameing a group to 
an existing user or group.



Modified:
   branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
   trunk/source/rpc_server/srv_samr_nt.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
===================================================================
--- branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c	2006-07-11 20:02:22 UTC (rev 16953)
+++ branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c	2006-07-11 20:31:13 UTC (rev 16954)
@@ -4592,7 +4592,7 @@
 		case 2:
 		{
 			fstring group_name;
-			enum SID_NAME_USE type;
+			NTSTATUS status;
 
 			/* We currently do not support renaming groups in the
 			   the BUILTIN domain.  Refer to util_builtin.c to understand 
@@ -4614,13 +4614,9 @@
 			   or local group */
 
 			fstr_sprintf( group_name, "%s\\%s", global_myname(), info.acct_name );
-			if ( lookup_name( p->mem_ctx, group_name, 0, NULL, NULL, NULL, &type) ) {
-				if ( type == SID_NAME_USER ) {
-					return NT_STATUS_USER_EXISTS;
-				}
-
-				return NT_STATUS_ALIAS_EXISTS;
-			}
+			status = can_create( p->mem_ctx, group_name );
+			if ( !NT_STATUS_IS_OK( status ) ) 
+				return status;
 			break;
 		}
 		case 3:

Modified: trunk/source/rpc_server/srv_samr_nt.c
===================================================================
--- trunk/source/rpc_server/srv_samr_nt.c	2006-07-11 20:02:22 UTC (rev 16953)
+++ trunk/source/rpc_server/srv_samr_nt.c	2006-07-11 20:31:13 UTC (rev 16954)
@@ -4592,7 +4592,7 @@
 		case 2:
 		{
 			fstring group_name;
-			enum SID_NAME_USE type;
+			NTSTATUS status;
 
 			/* We currently do not support renaming groups in the
 			   the BUILTIN domain.  Refer to util_builtin.c to understand 
@@ -4614,13 +4614,9 @@
 			   or local group */
 
 			fstr_sprintf( group_name, "%s\\%s", global_myname(), info.acct_name );
-			if ( lookup_name( p->mem_ctx, group_name, 0, NULL, NULL, NULL, &type) ) {
-				if ( type == SID_NAME_USER ) {
-					return NT_STATUS_USER_EXISTS;
-				}
-
-				return NT_STATUS_ALIAS_EXISTS;
-			}
+			status = can_create( p->mem_ctx, group_name );
+			if ( !NT_STATUS_IS_OK( status ) ) 
+				return status;
 			break;
 		}
 		case 3:



More information about the samba-cvs mailing list