diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-30 15:08:58 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-30 15:08:58 +0000 |
commit | 31044dd8e6419b305779408a4b3b0fbd8eab11b5 (patch) | |
tree | 1ed17e61bd4e31ab70454e989a5736f48fbf8262 /source3/rpcclient | |
parent | 868b22f5a1b5c9fec82d8c07f93ec0e7d05f23ac (diff) | |
download | samba-31044dd8e6419b305779408a4b3b0fbd8eab11b5.tar.gz samba-31044dd8e6419b305779408a4b3b0fbd8eab11b5.tar.bz2 samba-31044dd8e6419b305779408a4b3b0fbd8eab11b5.zip |
- adding builtin[alias]db.
- lib/sids.c:
generate_sam_sid() modified to take a domain name: it now
generates "DOMAIN_NAME.SID". reasons:
1) if you run multiple samba servers on the same machine
under different netbios names as members of a domain,
they won't all use the same SID, which is a _big_ mistake
but it would happen _by default_.
2) we have (had) a problem with sid_to_string() and string_to_sid()
which cause SIDs to be incorrectly read. one of the major
reasons for *NOT* making this change was so as not to disrupt
existing users. but as they will be anyway by this bug,
we might as well go ahead.
- passdb/smbpass.c:
wanted to change the meaning of the name in the smbpasswd
file to an "nt" name not a "unix" name. this is probably
not a good idea: reverted this.
- output formatting / bug-fixing in rpcclient query_useraliases code.
(This used to be commit e4930f5f48f8246ceec8add8bf769954a963190c)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 7a65fc5c37..4d77f67b54 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -181,8 +181,10 @@ void cmd_sam_enum_users(struct client_info *info) fstring domain; fstring sid; DOM_SID sid1; + DOM_SID sid_1_5_20; int user_idx; BOOL res = True; + BOOL res1 = True; BOOL request_user_info = False; BOOL request_group_info = False; BOOL request_alias_info = False; @@ -218,6 +220,10 @@ void cmd_sam_enum_users(struct client_info *info) request_group_info |= strequal(tmp, "-g"); request_alias_info |= strequal(tmp, "-a"); } + else + { + break; + } } #ifdef DEBUG_TESTING @@ -242,6 +248,8 @@ void cmd_sam_enum_users(struct client_info *info) } #endif + string_to_sid(&sid_1_5_20, "S-1-5-32"); + fprintf(out_hnd, "SAM Enumerate Users\n"); fprintf(out_hnd, "From: %s To: %s Domain: %s SID: %s\n", info->myhostname, srv_name, domain, sid); @@ -264,6 +272,11 @@ void cmd_sam_enum_users(struct client_info *info) &info->dom.samr_pol_connect, admin_rid, &sid1, &info->dom.samr_pol_open_domain) : False; + /* connect to the S-1-5-20 domain */ + res1 = res ? do_samr_open_domain(smb_cli, + &info->dom.samr_pol_connect, admin_rid, &sid_1_5_20, + &info->dom.samr_pol_open_builtindom) : False; + /* read some users */ res = res ? do_samr_enum_dom_users(smb_cli, &info->dom.samr_pol_open_domain, @@ -275,12 +288,8 @@ void cmd_sam_enum_users(struct client_info *info) fprintf(out_hnd, "No users\n"); } - if (request_user_info || request_group_info || request_alias_info) - { /* query all the users */ - user_idx = 0; - - while (res && user_idx < info->dom.num_sam_entries) + for (user_idx = 0; res && user_idx < info->dom.num_sam_entries; user_idx++) { uint32 user_rid = info->dom.sam[user_idx].user_rid; SAM_USER_INFO_21 usr; @@ -332,16 +341,26 @@ void cmd_sam_enum_users(struct client_info *info) &info->dom.samr_pol_open_domain, &als_sid, &num_aliases, rid)) { - display_alias_rid_info(out_hnd, ACTION_HEADER , &als_sid, num_aliases, rid); - display_alias_rid_info(out_hnd, ACTION_ENUMERATE, &als_sid, num_aliases, rid); - display_alias_rid_info(out_hnd, ACTION_FOOTER , &als_sid, num_aliases, rid); - } + display_alias_rid_info(out_hnd, ACTION_HEADER , &sid1, num_aliases, rid); + display_alias_rid_info(out_hnd, ACTION_ENUMERATE, &sid1, num_aliases, rid); + display_alias_rid_info(out_hnd, ACTION_FOOTER , &sid1, num_aliases, rid); } - user_idx++; + /* send user alias query */ + if (res1 && do_samr_query_useraliases(smb_cli, + &info->dom.samr_pol_open_builtindom, + &als_sid, &num_aliases, rid)) + { + display_alias_rid_info(out_hnd, ACTION_HEADER , &sid_1_5_20, num_aliases, rid); + display_alias_rid_info(out_hnd, ACTION_ENUMERATE, &sid_1_5_20, num_aliases, rid); + display_alias_rid_info(out_hnd, ACTION_FOOTER , &sid_1_5_20, num_aliases, rid); + } } } + res1 = res1 ? do_samr_close(smb_cli, + &info->dom.samr_pol_open_builtindom) : False; + res = res ? do_samr_close(smb_cli, &info->dom.samr_pol_open_domain) : False; |