summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-07-11 20:31:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:15 -0500
commit751ad5753402749c1e1638ba4d07aed0d76c52bc (patch)
tree56f751c534ffb2463f9cc440a67745e70a80ff4b /source3
parent7c1f79143b4f28e6eff0cf914defd0a008372055 (diff)
downloadsamba-751ad5753402749c1e1638ba4d07aed0d76c52bc.tar.gz
samba-751ad5753402749c1e1638ba4d07aed0d76c52bc.tar.bz2
samba-751ad5753402749c1e1638ba4d07aed0d76c52bc.zip
r16954: 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. (This used to be commit ce7091fda1eb3c7ea0900f455cec48c3b95a17f6)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_samr_nt.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 66f196ae3a..9c453b04a4 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -4592,7 +4592,7 @@ NTSTATUS _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_
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 @@ NTSTATUS _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_
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: