summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-15 22:43:08 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-15 22:43:08 +0000
commit98ee99eb72e537c1a69317cc81305d728e40ab64 (patch)
treebdb62b16dca9c4d6871d6e3dba25fb99e2cff9ca /source3/include
parentb231d2fafaff8dc67ef2dbaec778f716524d4f6a (diff)
downloadsamba-98ee99eb72e537c1a69317cc81305d728e40ab64.tar.gz
samba-98ee99eb72e537c1a69317cc81305d728e40ab64.tar.bz2
samba-98ee99eb72e537c1a69317cc81305d728e40ab64.zip
added rpcclient "enumdomains" command. enumerates names of domains
for which a PDC is responsible. typical answers are: <Name of Domain> plus <Builtin>. against a hierarchical, down-level-compatible NT5 PDC, there's likely to be more than these two entries!!!!! (This used to be commit 3146aa6b6049a0d996e9abbe7dbee8526550e7e0)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/ntdomain.h3
-rw-r--r--source3/include/proto.h18
-rw-r--r--source3/include/rpc_samr.h32
3 files changed, 52 insertions, 1 deletions
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 7f58874475..4f6cc85905 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -170,6 +170,9 @@ struct acct_info
uint32, const uint32*, char *const *const,\
uint32*const)
+#define DOMAIN_FN(fn)\
+ void (*fn)(const char*)
+
#define USER_FN(fn)\
void (*fn)(const char*, const DOM_SID*, uint32, const char*)
#define USER_INFO_FN(fn)\
diff --git a/source3/include/proto.h b/source3/include/proto.h
index df05f2d7be..ff55331400 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1952,6 +1952,11 @@ BOOL samr_unknown_38(struct cli_state *cli, uint16 fnum, char *srv_name);
BOOL samr_query_dom_info(struct cli_state *cli, uint16 fnum,
POLICY_HND *domain_pol, uint16 switch_value,
SAM_UNK_CTR *ctr);
+uint32 samr_enum_domains(struct cli_state *cli, uint16 fnum,
+ POLICY_HND *pol,
+ uint32 *start_idx, uint32 size,
+ struct acct_info **sam,
+ uint32 *num_sam_domains);
uint32 samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol,
uint32 *start_idx, uint32 size,
@@ -2703,6 +2708,13 @@ BOOL samr_io_q_query_usergroups(char *desc, SAMR_Q_QUERY_USERGROUPS *q_u, prs_s
BOOL make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u,
uint32 num_gids, DOM_GID *gid, uint32 status);
BOOL samr_io_r_query_usergroups(char *desc, SAMR_R_QUERY_USERGROUPS *r_u, prs_struct *ps, int depth);
+BOOL make_samr_q_enum_domains(SAMR_Q_ENUM_DOMAINS *q_e, POLICY_HND *pol,
+ uint32 start_idx, uint32 size);
+BOOL samr_io_q_enum_domains(char *desc, SAMR_Q_ENUM_DOMAINS *q_e, prs_struct *ps, int depth);
+BOOL make_samr_r_enum_domains(SAMR_R_ENUM_DOMAINS *r_u,
+ uint32 next_idx,
+ uint32 num_sam_entries, char **doms, uint32 status);
+BOOL samr_io_r_enum_domains(char *desc, SAMR_R_ENUM_DOMAINS *r_u, prs_struct *ps, int depth);
BOOL make_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_e, POLICY_HND *pol,
uint32 start_idx, uint32 size);
BOOL samr_io_q_enum_dom_groups(char *desc, SAMR_Q_ENUM_DOM_GROUPS *q_e, prs_struct *ps, int depth);
@@ -3428,6 +3440,11 @@ BOOL sam_query_groupmem(struct cli_state *cli, uint16 fnum,
uint32 **rid_mem,
char ***name,
uint32 **type);
+uint32 msrpc_sam_enum_domains(struct cli_state *cli,
+ const char* srv_name,
+ struct acct_info **sam,
+ uint32 *num_sam_entries,
+ DOMAIN_FN(dom_fn));
uint32 msrpc_sam_enum_groups(struct cli_state *cli,
const char* domain,
const DOM_SID *sid1,
@@ -3469,6 +3486,7 @@ void cmd_sam_query_aliasmem(struct client_info *info);
void cmd_sam_query_alias(struct client_info *info);
void cmd_sam_enum_aliases(struct client_info *info);
void cmd_sam_enum_groups(struct client_info *info);
+void cmd_sam_enum_domains(struct client_info *info);
/*The following definitions come from rpcclient/cmd_spoolss.c */
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h
index 58246488a1..850e3a8b94 100644
--- a/source3/include/rpc_samr.h
+++ b/source3/include/rpc_samr.h
@@ -83,6 +83,7 @@ SamrTestPrivateFunctionsUser
#define SAMR_QUERY_SEC_OBJECT 0x03
#define SAMR_LOOKUP_DOMAIN 0x05
#define SAMR_OPEN_DOMAIN 0x07
+#define SAMR_ENUM_DOMAINS 0x06
#define SAMR_QUERY_DOMAIN_INFO 0x08
@@ -586,7 +587,6 @@ typedef struct r_samr_open_domain_info
} SAMR_R_OPEN_DOMAIN;
-
#define MAX_SAM_ENTRIES 250
typedef struct samr_entry_info
@@ -597,6 +597,36 @@ typedef struct samr_entry_info
} SAM_ENTRY;
+/* SAMR_Q_ENUM_DOMAINS - SAM rids and names */
+typedef struct q_samr_enum_domains_info
+{
+ POLICY_HND pol; /* policy handle */
+
+ uint32 start_idx; /* enumeration handle */
+ uint32 max_size; /* 0x0000 ffff */
+
+} SAMR_Q_ENUM_DOMAINS;
+
+/* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */
+typedef struct r_samr_enum_domains_info
+{
+ uint32 next_idx; /* next starting index required for enum */
+ uint32 ptr_entries1;
+
+ uint32 num_entries2;
+ uint32 ptr_entries2;
+
+ uint32 num_entries3;
+
+ SAM_ENTRY *sam;
+ UNISTR2 *uni_dom_name;
+
+ uint32 num_entries4;
+
+ uint32 status;
+
+} SAMR_R_ENUM_DOMAINS;
+
/* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */
typedef struct q_samr_enum_dom_users_info
{