summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-02-27 10:32:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:25 -0500
commite54786b53543b4667288c64abb55478fddd95061 (patch)
treec9641bd414989a72be6c425f9857f5731da74188 /source3/rpc_parse
parentbd97e1a5eae982feda5e5bbd08e7f4e3b6473baf (diff)
downloadsamba-e54786b53543b4667288c64abb55478fddd95061.tar.gz
samba-e54786b53543b4667288c64abb55478fddd95061.tar.bz2
samba-e54786b53543b4667288c64abb55478fddd95061.zip
r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues. * in the info3 reply in a samlogon, return the ACB-flags (instead of returning zero) Guenther (This used to be commit 5b89e8bc24f0fdc8b52d5c9e849aba723df34ea7)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_net.c18
-rw-r--r--source3/rpc_parse/parse_samr.c21
2 files changed, 17 insertions, 22 deletions
diff --git a/source3/rpc_parse/parse_net.c b/source3/rpc_parse/parse_net.c
index 3734ce26a6..745cf24b0f 100644
--- a/source3/rpc_parse/parse_net.c
+++ b/source3/rpc_parse/parse_net.c
@@ -1424,7 +1424,8 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
uint16 logon_count, uint16 bad_pw_count,
uint32 num_groups, const DOM_GID *gids,
- uint32 user_flgs, uchar user_session_key[16],
+ uint32 user_flgs, uint32 acct_flags,
+ uchar user_session_key[16],
uchar lm_session_key[16],
const char *logon_srv, const char *logon_dom,
const DOM_SID *dom_sid)
@@ -1466,6 +1467,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
usr->buffer_groups = 1; /* indicates fill in groups, below, even if there are none */
usr->user_flgs = user_flgs;
+ usr->acct_flags = acct_flags;
if (user_session_key != NULL)
memcpy(usr->user_sess_key, user_session_key, sizeof(usr->user_sess_key));
@@ -1475,7 +1477,6 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
usr->buffer_dom_id = dom_sid ? 1 : 0; /* yes, we're bothering to put a domain SID in */
memset((char *)usr->lm_sess_key, '\0', sizeof(usr->lm_sess_key));
- memset(&usr->acct_flags, '\0', sizeof(usr->acct_flags));
for (i=0; i<7; i++) {
memset(&usr->unknown[i], '\0', sizeof(usr->unknown));
@@ -1526,19 +1527,22 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr,
int lvl = 10;
DEBUG(lvl,("dump_acct_flags\n"));
if (acct_flags & ACB_NORMAL) {
- DEBUGADD(lvl,("\taccount has UF_NORMAL_ACCOUNT\n"));
+ DEBUGADD(lvl,("\taccount has ACB_NORMAL\n"));
}
if (acct_flags & ACB_PWNOEXP) {
- DEBUGADD(lvl,("\taccount has UF_DONT_EXPIRE_PASSWD\n"));
+ DEBUGADD(lvl,("\taccount has ACB_PWNOEXP\n"));
}
if (acct_flags & ACB_ENC_TXT_PWD_ALLOWED) {
- DEBUGADD(lvl,("\taccount has UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED\n"));
+ DEBUGADD(lvl,("\taccount has ACB_ENC_TXT_PWD_ALLOWED\n"));
}
if (acct_flags & ACB_NOT_DELEGATED) {
- DEBUGADD(lvl,("\taccount has UF_NOT_DELEGATED\n"));
+ DEBUGADD(lvl,("\taccount has ACB_NOT_DELEGATED\n"));
}
if (acct_flags & ACB_USE_DES_KEY_ONLY) {
- DEBUGADD(lvl,("\taccount has UF_USE_DES_KEY_ONLY set, sig verify wont work\n"));
+ DEBUGADD(lvl,("\taccount has ACB_USE_DES_KEY_ONLY set, sig verify wont work\n"));
+ }
+ if (acct_flags & ACB_NO_AUTH_DATA_REQD) {
+ DEBUGADD(lvl,("\taccount has ACB_NO_AUTH_DATA_REQD set\n"));
}
}
diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c
index fc4d7a3ab3..49d0fb7d72 100644
--- a/source3/rpc_parse/parse_samr.c
+++ b/source3/rpc_parse/parse_samr.c
@@ -1004,7 +1004,7 @@ inits a SAM_ENTRY1 structure.
static void init_sam_entry1(SAM_ENTRY1 *sam, uint32 user_idx,
UNISTR2 *sam_name, UNISTR2 *sam_full,
UNISTR2 *sam_desc, uint32 rid_user,
- uint16 acb_info)
+ uint32 acb_info)
{
DEBUG(5, ("init_sam_entry1\n"));
@@ -1040,10 +1040,7 @@ static BOOL sam_io_sam_entry1(const char *desc, SAM_ENTRY1 * sam,
if(!prs_uint32("rid_user ", ps, depth, &sam->rid_user))
return False;
- if(!prs_uint16("acb_info ", ps, depth, &sam->acb_info))
- return False;
-
- if(!prs_align(ps))
+ if(!prs_uint32("acb_info ", ps, depth, &sam->acb_info))
return False;
if (!smb_io_unihdr("hdr_acct_name", &sam->hdr_acct_name, ps, depth))
@@ -1085,7 +1082,7 @@ inits a SAM_ENTRY2 structure.
********************************************************************/
static void init_sam_entry2(SAM_ENTRY2 * sam, uint32 user_idx,
UNISTR2 *sam_name, UNISTR2 *sam_desc,
- uint32 rid_user, uint16 acb_info)
+ uint32 rid_user, uint32 acb_info)
{
DEBUG(5, ("init_sam_entry2\n"));
@@ -1118,10 +1115,7 @@ static BOOL sam_io_sam_entry2(const char *desc, SAM_ENTRY2 * sam,
if(!prs_uint32("rid_user ", ps, depth, &sam->rid_user))
return False;
- if(!prs_uint16("acb_info ", ps, depth, &sam->acb_info))
- return False;
-
- if(!prs_align(ps))
+ if(!prs_uint32("acb_info ", ps, depth, &sam->acb_info))
return False;
if(!smb_io_unihdr("unihdr", &sam->hdr_srv_name, ps, depth)) /* account name unicode string header */
@@ -1322,7 +1316,7 @@ inits a SAMR_Q_ENUM_DOM_USERS structure.
void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS * q_e, POLICY_HND *pol,
uint32 start_idx,
- uint16 acb_mask, uint16 unk_1, uint32 size)
+ uint32 acb_mask, uint32 size)
{
DEBUG(5, ("init_samr_q_enum_dom_users\n"));
@@ -1330,7 +1324,6 @@ void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS * q_e, POLICY_HND *pol,
q_e->start_idx = start_idx; /* zero indicates lots */
q_e->acb_mask = acb_mask;
- q_e->unknown_1 = unk_1;
q_e->max_size = size;
}
@@ -1355,9 +1348,7 @@ BOOL samr_io_q_enum_dom_users(const char *desc, SAMR_Q_ENUM_DOM_USERS * q_e,
if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx))
return False;
- if(!prs_uint16("acb_mask ", ps, depth, &q_e->acb_mask))
- return False;
- if(!prs_uint16("unknown_1", ps, depth, &q_e->unknown_1))
+ if(!prs_uint32("acb_mask ", ps, depth, &q_e->acb_mask))
return False;
if(!prs_uint32("max_size ", ps, depth, &q_e->max_size))