diff options
author | Gerald Carter <jerry@samba.org> | 2003-11-24 17:31:38 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-11-24 17:31:38 +0000 |
commit | c39f5fea4ad7b57ee8ad4d2b115163f76753f853 (patch) | |
tree | e65a6577d044de2fdbfd354bbd1a72c47aec3199 /source3/rpc_server/srv_lsa_nt.c | |
parent | 62685054962f4be7d8791b87dff85e89347269e8 (diff) | |
download | samba-c39f5fea4ad7b57ee8ad4d2b115163f76753f853.tar.gz samba-c39f5fea4ad7b57ee8ad4d2b115163f76753f853.tar.bz2 samba-c39f5fea4ad7b57ee8ad4d2b115163f76753f853.zip |
more access fixes for group enumeration in LDAP; bug 281
(This used to be commit 68283407e0f366d8315f4be6caed67eb6fe84b85)
Diffstat (limited to 'source3/rpc_server/srv_lsa_nt.c')
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 9 |
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 0a8ad404cb..e545d8c267 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; |