summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_lsa_nt.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-11-24 17:33:15 +0000
committerGerald Carter <jerry@samba.org>2003-11-24 17:33:15 +0000
commitf5ee9c7b02d6acf02d8e516c6e258965a029dd79 (patch)
treee3f4ada6b37ff42b987e8d41d7ebbafb6cda082d /source3/rpc_server/srv_lsa_nt.c
parent8ade0cf1b6eba966fdb3f2544a83c979195cef75 (diff)
downloadsamba-f5ee9c7b02d6acf02d8e516c6e258965a029dd79.tar.gz
samba-f5ee9c7b02d6acf02d8e516c6e258965a029dd79.tar.bz2
samba-f5ee9c7b02d6acf02d8e516c6e258965a029dd79.zip
more access fixes for group enumeration in LDAP; bug 281
(This used to be commit c4ce92e80688fe7fd4b2fde2c31e94baf3e4dca0)
Diffstat (limited to 'source3/rpc_server/srv_lsa_nt.c')
-rw-r--r--source3/rpc_server/srv_lsa_nt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index db5c8c83b0..8785cce789 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -845,6 +845,7 @@ NTSTATUS _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENU
int num_entries=0;
LSA_SID_ENUM *sids=&r_u->sids;
int i=0,j=0;
+ BOOL ret;
if (!find_policy_by_hnd(p, &q_u->pol, (void **)&handle))
return NT_STATUS_INVALID_HANDLE;
@@ -858,8 +859,14 @@ NTSTATUS _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENU
return NT_STATUS_ACCESS_DENIED;
/* get the list of mapped groups (domain, local, builtin) */
- if(!pdb_enum_group_mapping(SID_NAME_UNKNOWN, &map, &num_entries, ENUM_ONLY_MAPPED))
+ become_root();
+ ret = pdb_enum_group_mapping(SID_NAME_UNKNOWN, &map, &num_entries, ENUM_ONLY_MAPPED);
+ unbecome_root();
+ if( !ret ) {
+ DEBUG(3,("_lsa_enum_accounts: enumeration of groups failed!\n"));
return NT_STATUS_OK;
+ }
+
if (q_u->enum_context >= num_entries)
return NT_STATUS_NO_MORE_ENTRIES;