#include "winbindd.h"
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_WINBIND
+
/* Query display info for a domain. This returns enough information plus a
bit extra to give an overview of domain users for the User Manager
application. */
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
int i;
+ DEBUG(3,("rpc: query_user_list\n"));
+
*num_entries = 0;
*info = NULL;
*num_entries = 0;
*info = NULL;
+ DEBUG(3,("rpc: enum_dom_groups\n"));
+
if (!(hnd = cm_get_sam_handle(domain->name))) {
return NT_STATUS_UNSUCCESSFUL;
}
NTSTATUS status;
DOM_SID *sids = NULL;
uint32 *types = NULL;
- int num_sids;
const char *full_name;
+ DEBUG(3,("rpc: name_to_sid name=%s\n", name));
+
if (!(mem_ctx = talloc_init_named("name_to_sid[rpc] for [%s]\\[%s]", domain->name, name))) {
DEBUG(0, ("talloc_init failed!\n"));
return NT_STATUS_NO_MEMORY;
}
status = cli_lsa_lookup_names(hnd->cli, mem_ctx, &hnd->pol, 1,
- &full_name, &sids, &types, &num_sids);
+ &full_name, &sids, &types);
- /* Return rid and type if lookup successful */
+ /* Return rid and type if lookup successful */
+
if (NT_STATUS_IS_OK(status)) {
sid_copy(sid, &sids[0]);
*type = types[0];
char **domains;
char **names;
uint32 *types;
- int num_names;
NTSTATUS status;
+ DEBUG(3,("rpc: sid_to_name\n"));
+
if (!(hnd = cm_get_lsa_handle(domain->name)))
return NT_STATUS_UNSUCCESSFUL;
status = cli_lsa_lookup_sids(hnd->cli, mem_ctx, &hnd->pol,
- 1, sid, &domains, &names, &types,
- &num_names);
+ 1, sid, &domains, &names, &types);
if (NT_STATUS_IS_OK(status)) {
*type = types[0];
BOOL got_dom_pol = False, got_user_pol = False;
SAM_USERINFO_CTR *ctr;
+ DEBUG(3,("rpc: query_user rid=%u\n", user_rid));
+
/* Get sam handle */
if (!(hnd = cm_get_sam_handle(domain->name)))
goto done;
result = cli_samr_query_userinfo(hnd->cli, mem_ctx, &user_pol,
0x15, &ctr);
+ if (!NT_STATUS_IS_OK(result))
+ goto done;
+
cli_samr_close(hnd->cli, mem_ctx, &user_pol);
got_user_pol = False;
+ user_info->user_rid = user_rid;
user_info->group_rid = ctr->info.id21->group_rid;
user_info->acct_name = unistr2_tdup(mem_ctx,
&ctr->info.id21->uni_user_name);
DOM_GID *user_groups;
int i;
+ DEBUG(3,("rpc: lookup_usergroups rid=%u\n", user_rid));
+
*num_groups = 0;
/* First try cached universal groups from logon */
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
BOOL got_dom_pol = False, got_group_pol = False;
+ DEBUG(10,("rpc: lookup_groupmem %s rid=%u\n", domain->name, group_rid));
+
*num_names = 0;
/* Get sam handle */
BOOL got_dom_pol = False;
uint32 des_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
+ DEBUG(10,("rpc: fetch sequence_number for %s\n", domain->name));
+
*seq = DOM_SEQUENCE_NONE;
if (!(mem_ctx = talloc_init_named("sequence_number[rpc]")))
TALLOC_CTX *mem_ctx,
uint32 *num_domains,
char ***names,
+ char ***alt_names,
DOM_SID **dom_sids)
{
CLI_POLICY_HND *hnd;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 enum_ctx = 0;
+ DEBUG(3,("rpc: trusted_domains\n"));
+
*num_domains = 0;
+ *alt_names = NULL;
if (!(hnd = cm_get_lsa_handle(lp_workgroup())))
goto done;
result = cli_lsa_enum_trust_dom(hnd->cli, mem_ctx,
- &hnd->pol, &enum_ctx, num_domains,
- names, dom_sids);
+ &hnd->pol, &enum_ctx,
+ num_domains, names, dom_sids);
done:
return result;
}
CLI_POLICY_HND *hnd;
fstring level5_dom;
+ DEBUG(3,("rpc: domain_sid\n"));
+
if (!(mem_ctx = talloc_init_named("domain_sid[rpc]")))
return NT_STATUS_NO_MEMORY;
return status;
}
+/* find alternate names list for the domain - none for rpc */
+static NTSTATUS alternate_name(struct winbindd_domain *domain)
+{
+ return NT_STATUS_OK;
+}
+
+
/* the rpc backend methods are exposed via this structure */
struct winbindd_methods msrpc_methods = {
False,
lookup_groupmem,
sequence_number,
trusted_domains,
- domain_sid
+ domain_sid,
+ alternate_name
};