diff options
author | Luke Leighton <lkcl@samba.org> | 1998-11-17 16:19:04 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-11-17 16:19:04 +0000 |
commit | 74d539f5573a3ed3ff1b96c54752a389da4c3e14 (patch) | |
tree | cc4cee5bc8c5ff3e7ebfef04c4ed3ff6a199df48 /source3/rpc_parse | |
parent | b7c4cd9fc6460c2138750237ee4525f929e93a76 (diff) | |
download | samba-74d539f5573a3ed3ff1b96c54752a389da4c3e14.tar.gz samba-74d539f5573a3ed3ff1b96c54752a389da4c3e14.tar.bz2 samba-74d539f5573a3ed3ff1b96c54752a389da4c3e14.zip |
- group database API. oops and oh dear, the threat has been carried out:
the pre-alpha "domain group" etc parameters have disappeared.
- interactive debug detection
- re-added mem_man (andrew's memory management, detects memory corruption)
- american spellings of "initialise" replaced with english spelling of
"initialise".
- started on "lookup_name()" and "lookup_sid()" functions. proper ones.
- moved lots of functions around. created some modules of commonly used
code. e.g the password file locking code, which is used in groupfile.c
and aliasfile.c and smbpass.c
- moved RID_TYPE_MASK up another bit. this is really unfortunate, but
there is no other "fast" way to identify users from groups from aliases.
i do not believe that this code saves us anything (the multipliers)
and puts us at a disadvantage (reduces the useable rid space).
the designers of NT aren't silly: if they can get away with a user-
interface-speed LsaLookupNames / LsaLookupSids, then so can we. i
spoke with isaac at the cifs conference, the only time for example that
they do a security context check is on file create. certainly not on
individual file reads / writes, which would drastically hit their
performance and ours, too.
- renamed myworkgroup to global_sam_name, amongst other things, when used
in the rpc code. there is also a global_member_name, as we are always
responsible for a SAM database, the scope of which is limited by the role
of the machine (e.g if a member of a workgroup, your SAM is for _local_
logins only, and its name is the name of your server. you even still
have a SID. see LsaQueryInfoPolicy, levels 3 and 5).
- updated functionality of groupname.c to be able to cope with names
like DOMAIN\group and SERVER\alias. used this code to be able to
do aliases as well as groups. this code may actually be better
off being used in username mapping, too.
- created a connect to serverlist function in clientgen.c and used it
in password.c
- initialisation in server.c depends on the role of the server. well,
it does now.
- rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
(This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_lsa.c | 4 | ||||
-rw-r--r-- | source3/rpc_parse/parse_net.c | 4 | ||||
-rw-r--r-- | source3/rpc_parse/parse_rpc.c | 11 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 31 |
4 files changed, 22 insertions, 28 deletions
diff --git a/source3/rpc_parse/parse_lsa.c b/source3/rpc_parse/parse_lsa.c index a5c523fdb6..818e7a0baf 100644 --- a/source3/rpc_parse/parse_lsa.c +++ b/source3/rpc_parse/parse_lsa.c @@ -37,7 +37,7 @@ void make_lsa_trans_name(LSA_TRANS_NAME *trn, UNISTR2 *uni_name, int len_name = strlen(name); trn->sid_name_use = sid_name_use; - make_uni_hdr(&(trn->hdr_name), len_name, len_name, len_name != 0); + make_uni_hdr(&(trn->hdr_name), len_name, len_name, 1); make_unistr2(uni_name, name, len_name); trn->domain_idx = idx; } @@ -692,7 +692,7 @@ void lsa_io_q_lookup_rids(char *desc, LSA_Q_LOOKUP_RIDS *q_r, prs_struct *ps, i for (i = 0; i < q_r->num_entries; i++) { - smb_io_unistr3("", &(q_r->lookup_name[i]), ps, depth); /* names to be looked up */ + smb_io_unistr3("dom_name", &(q_r->lookup_name[i]), ps, depth); /* names to be looked up */ } prs_uint8s (False, "undoc ", ps, depth, q_r->undoc, UNKNOWN_LEN); diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c index 57fc73e516..ce573c7bf2 100644 --- a/source3/rpc_parse/parse_net.c +++ b/source3/rpc_parse/parse_net.c @@ -665,8 +665,8 @@ void make_id_info2(NET_ID_INFO_2 *id, char *domain_name, int len_domain_name = strlen(domain_name); int len_user_name = strlen(user_name ); int len_wksta_name = strlen(wksta_name ); - int nt_chal_resp_len = ((nt_chal_resp != NULL) ? 24 : 0); - int lm_chal_resp_len = ((lm_chal_resp != NULL) ? 24 : 0); + int nt_chal_resp_len = ((nt_chal_resp != NULL) ? 24 : 0); + int lm_chal_resp_len = ((lm_chal_resp != NULL) ? 24 : 0); unsigned char lm_owf[24]; unsigned char nt_owf[24]; diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index 3bf017d25e..5059ca222b 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -122,17 +122,6 @@ interface/version dce/rpc pipe identification }, 0x00 \ } \ -/* pipe string names */ -#define PIPE_SRVSVC "\\PIPE\\srvsvc" -#define PIPE_SAMR "\\PIPE\\samr" -#define PIPE_WINREG "\\PIPE\\winreg" -#define PIPE_WKSSVC "\\PIPE\\wkssvc" -#define PIPE_NETLOGON "\\PIPE\\NETLOGON" -#define PIPE_NTLSA "\\PIPE\\ntlsa" -#define PIPE_NTSVCS "\\PIPE\\ntsvcs" -#define PIPE_LSASS "\\PIPE\\lsass" -#define PIPE_LSARPC "\\PIPE\\lsarpc" - struct pipe_id_info pipe_names [] = { /* client pipe , abstract syntax , server pipe , transfer syntax */ diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index ec4411b783..e7f4f0547c 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -993,7 +993,7 @@ void samr_io_q_enum_dom_aliases(char *desc, SAMR_Q_ENUM_DOM_ALIASES *q_e, prs_s makes a SAMR_R_ENUM_DOM_ALIASES structure. ********************************************************************/ void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, - uint32 num_sam_entries, SAM_USER_INFO_21 grps[MAX_SAM_ENTRIES], + uint32 num_sam_entries, LOCAL_GRP *alss, uint32 status) { int i; @@ -1022,11 +1022,13 @@ void make_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES *r_u, for (i = 0; i < num_sam_entries; i++) { + int acct_name_len = strlen(alss[i].name); + make_sam_entry(&(r_u->sam[i]), - grps[i].uni_user_name.uni_str_len, - grps[i].user_rid); + acct_name_len, + alss[i].rid); - copy_unistr2(&(r_u->uni_grp_name[i]), &(grps[i].uni_user_name)); + make_unistr2(&(r_u->uni_grp_name[i]), alss[i].name , acct_name_len); } r_u->num_entries4 = num_sam_entries; @@ -1415,7 +1417,7 @@ makes a SAMR_R_ENUM_DOM_GROUPS structure. ********************************************************************/ void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, uint32 start_idx, uint32 num_sam_entries, - SAM_USER_INFO_21 pass[MAX_SAM_ENTRIES], + DOMAIN_GRP *grp, uint32 status) { int i; @@ -1436,14 +1438,17 @@ void make_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS *r_u, { for (i = start_idx, entries_added = 0; i < num_sam_entries; i++) { + int acct_name_len = strlen(grp[i].name); + int acct_desc_len = strlen(grp[i].comment); + make_sam_entry3(&(r_u->sam[entries_added]), start_idx + entries_added + 1, - pass[i].uni_user_name.uni_str_len, - pass[i].uni_acct_desc.uni_str_len, - pass[i].user_rid); + acct_name_len, + acct_desc_len, + grp[i].rid); - copy_unistr2(&(r_u->str[entries_added].uni_grp_name), &(pass[i].uni_user_name)); - copy_unistr2(&(r_u->str[entries_added].uni_grp_desc), &(pass[i].uni_acct_desc)); + make_unistr2(&(r_u->str[entries_added].uni_grp_name), grp[i].name , acct_name_len); + make_unistr2(&(r_u->str[entries_added].uni_grp_desc), grp[i].comment, acct_desc_len); entries_added++; } @@ -1793,7 +1798,7 @@ void samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *p makes a SAMR_R_LOOKUP_NAMES structure. ********************************************************************/ void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, - uint32 num_rids, uint32 *rid, uint32 status) + uint32 num_rids, uint32 *rid, uint8 *type, uint32 status) { int i; if (r_u == NULL) return; @@ -1810,7 +1815,7 @@ void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, for (i = 0; i < num_rids; i++) { - make_dom_rid3(&(r_u->dom_rid[i]), rid[i], 0x01); + make_dom_rid3(&(r_u->dom_rid[i]), rid[i], type[i]); } r_u->num_entries3 = num_rids; @@ -2100,7 +2105,7 @@ void make_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS *r_u, { r_u->ptr_0 = 1; r_u->num_entries = num_gids; - r_u->ptr_1 = 1; + r_u->ptr_1 = (num_gids != 0) ? 1 : 0; r_u->num_entries2 = num_gids; r_u->gid = gid; |