summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/include/smb.h16
-rw-r--r--source3/lsaparse.c146
3 files changed, 74 insertions, 92 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index a6250ca56c..9faecd3a00 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -325,6 +325,10 @@ char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align
char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align);
char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align);
char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align);
+char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align);
+char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align);
+char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align);
+char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align);
/*The following definitions come from mangle.c */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 280147b41f..1b8f04f02e 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -502,6 +502,8 @@ typedef struct lsa_r_query_info
DOM_QUERY_5 id5;
} dom;
+ uint32 status; /* return code */
+
} LSA_R_QUERY_INFO;
#define MAX_REF_DOMAINS 10
@@ -552,6 +554,8 @@ typedef struct lsa_r_lookup_sids
uint32 num_entries3;
+ uint32 status; /* return code */
+
} LSA_R_LOOKUP_SIDS;
/* DOM_NAME - XXXX not sure about this structure */
@@ -596,6 +600,8 @@ typedef struct lsa_r_lookup_rids
uint32 num_entries3;
+ uint32 status; /* return code */
+
} LSA_R_LOOKUP_RIDS;
@@ -624,6 +630,8 @@ typedef struct lsa_r_req_chal_info
{
DOM_CHAL srv_chal; /* server challenge */
+ uint32 status; /* return code */
+
} LSA_R_REQ_CHAL;
@@ -645,6 +653,8 @@ typedef struct lsa_r_auth2_info
DOM_CHAL srv_chal; /* server-calculated credentials */
NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
+ uint32 status; /* return code */
+
} LSA_R_AUTH_2;
@@ -661,6 +671,8 @@ typedef struct lsa_r_srv_pwset_info
{
DOM_CHAL srv_chal; /* server-calculated credentials */
+ uint32 status; /* return code */
+
} LSA_R_SRV_PWSET;
#define LSA_MAX_GROUPS 32
@@ -741,6 +753,8 @@ typedef struct lsa_r_sam_logon_info
uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
+ uint32 status; /* return code */
+
} LSA_R_SAM_LOGON;
@@ -757,6 +771,8 @@ typedef struct lsa_r_sam_logoff_info
uint32 buffer_creds; /* undocumented buffer pointer */
DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
+ uint32 status; /* return code */
+
} LSA_R_SAM_LOGOFF;
/*
diff --git a/source3/lsaparse.c b/source3/lsaparse.c
index 68884833f4..70d4f49380 100644
--- a/source3/lsaparse.c
+++ b/source3/lsaparse.c
@@ -68,6 +68,9 @@ char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int al
}
}
}
+
+ RW_IVAL(io, q, r_q->status, 0); q += 4;
+
return q;
}
@@ -127,6 +130,8 @@ char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base,
RW_IVAL(io, q, r_s->num_entries3, 0); q += 4;
+ RW_IVAL(io, q, r_s->status, 0); q += 4;
+
return q;
}
@@ -182,6 +187,8 @@ char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base,
RW_IVAL(io, q, r_r->num_entries3, 0); q += 4;
+ RW_IVAL(io, q, r_r->status, 0); q += 4;
+
return q;
}
@@ -212,6 +219,8 @@ char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int a
q = smb_io_chal(io, &(r_c->srv_chal), q, base, align); /* server challenge */
+ RW_IVAL(io, q, r_c->status, 0); q += 4;
+
return q;
}
@@ -244,6 +253,8 @@ char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align
q = smb_io_chal (io, &(r_a->srv_chal), q, base, align); /* server challenge */
q = smb_io_neg_flags(io, &(r_a->srv_flgs), q, base, align);
+ RW_IVAL(io, q, r_a->status, 0); q += 4;
+
return q;
}
@@ -274,6 +285,8 @@ char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int
q = smb_io_chal(io, &(r_s->srv_chal), q, base, align); /* server challenge */
+ RW_IVAL(io, q, r_s->status, 0); q += 4;
+
return q;
}
@@ -349,125 +362,72 @@ char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int ali
return q;
}
-
-#if 0
/*******************************************************************
reads or writes a structure.
********************************************************************/
- char* lsa_io_(BOOL io, *, char *q, char *base, int align)
+char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align)
{
- if (== NULL) return NULL;
+ if (q_l == NULL) return NULL;
q = align_offset(q, base, align);
- RW_IVAL(io, q, , 0); q += 4;
+ q = smb_io_sam_info(io, &(q_l->sam_id), q, base, align); /* domain SID */
return q;
}
-#endif
-
-
-#if 0 /* to be done... */
-
-#define LSA_MAX_GROUPS 32
-
-/* LSA_USER_INFO */
-typedef struct lsa_q_user_info
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align)
{
- uint32 undoc_buffer;
-
- NTTIME logon_time; /* logon time */
- NTTIME logoff_time; /* logoff time */
- NTTIME kickoff_time; /* kickoff time */
- NTTIME pass_last_set_time; /* password last set time */
- NTTIME pass_can_change_time; /* password can change time */
- NTTIME pass_must_change_time; /* password must change time */
+ if (r_l == NULL) return NULL;
- UNIHDR hdr_user_name; /* username unicode string header */
- UNIHDR hdr_full_name; /* user's full name unicode string header */
- UNIHDR hdr_logon_script; /* logon script unicode string header */
- UNIHDR hdr_profile_path; /* profile path unicode string header */
- UNIHDR hdr_home_dir; /* home directory unicode string header */
- UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
-
- uint16 logon_count; /* logon count */
- uint16 bad_pw_count; /* bad password count */
-
- uint32 user_id; /* User ID */
- uint32 group_id; /* Group ID */
- uint32 num_groups; /* num groups */
- uint32 buffer_groups; /* undocumented buffer pointer to groups. */
- uint32 user_flgs; /* user flags */
-
- char sess_key[16]; /* unused user session key */
-
- UNIHDR hdr_logon_srv; /* logon server unicode string header */
- UNIHDR hdr_logon_dom; /* logon domain unicode string header */
-
- uint32 buffer_dom_id; /* undocumented logon domain id pointer */
- char padding[40]; /* unused padding bytes? */
-
- uint32 num_sids; /* 0 - num_sids */
- uint32 buffer_sids; /* NULL - undocumented pointer to SIDs. */
+ q = align_offset(q, base, align);
- UNISTR2 uni_user_name; /* username unicode string */
- UNISTR2 uni_full_name; /* user's full name unicode string */
- UNISTR2 uni_logon_script; /* logon script unicode string */
- UNISTR2 uni_profile_path; /* profile path unicode string */
- UNISTR2 uni_home_dir; /* home directory unicode string */
- UNISTR2 uni_dir_drive; /* home directory drive unicode string */
+ RW_IVAL(io, q, r_l->buffer_creds, 0); q += 4; /* undocumented buffer pointer */
+ q = smb_io_cred(io, &(r_l->srv_creds), q, base, align); /* server credentials. server time stamp appears to be ignored. */
- uint32 num_groups2; /* num groups */
- DOM_GID gids[LSA_MAX_GROUPS]; /* group info */
+ RW_IVAL(io, q, r_l->buffer_user, 0); q += 4;
+ q = lsa_io_user_info(io, &(r_l->user), q, base, align);
- UNISTR2 uni_logon_srv; /* logon server unicode string */
- UNISTR2 uni_logon_dom; /* logon domain unicode string */
+ RW_IVAL(io, q, r_l->auth_resp, 0); q += 4; /* 1 - Authoritative response; 0 - Non-Auth? */
- DOM_SID undoc_dom_sids[2]; /* undocumented - domain SIDs */
- DOM_SID dom_sid; /* domain SID */
+ RW_IVAL(io, q, r_l->status, 0); q += 4;
-} LSA_USER_INFO;
-
-
-/* LSA_Q_SAM_LOGON */
-typedef struct lsa_q_sam_logon_info
-{
- DOM_SAM_INFO sam_id;
-
-} LSA_Q_SAM_LOGON;
+ return q;
+}
-/* LSA_R_SAM_LOGON */
-typedef struct lsa_r_sam_logon_info
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align)
{
- uint32 buffer_creds; /* undocumented buffer pointer */
- DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
-
- uint32 buffer_user;
- LSA_USER_INFO user;
-
- uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
+ if (q_l == NULL) return NULL;
-} LSA_R_SAM_LOGON;
+ q = align_offset(q, base, align);
+
+ q = smb_io_sam_info(io, &(q_l->sam_id), q, base, align); /* domain SID */
+ return q;
+}
-/* LSA_Q_SAM_LOGOFF */
-typedef struct lsa_q_sam_logoff_info
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align)
{
- DOM_SAM_INFO sam_id;
+ if (r_l == NULL) return NULL;
-} LSA_Q_SAM_LOGOFF;
-
-/* LSA_R_SAM_LOGOFF */
-typedef struct lsa_r_sam_logoff_info
-{
- uint32 buffer_creds; /* undocumented buffer pointer */
- DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
-
-} LSA_R_SAM_LOGOFF;
+ q = align_offset(q, base, align);
+
+ RW_IVAL(io, q, r_l->buffer_creds, 0); q += 4; /* undocumented buffer pointer */
+ q = smb_io_cred(io, &(r_l->srv_creds), q, base, align); /* server credentials. server time stamp appears to be ignored. */
-#endif
+ RW_IVAL(io, q, r_l->status, 0); q += 4;
+ return q;
+}
#if 0
/*******************************************************************
@@ -484,3 +444,5 @@ reads or writes a structure.
return q;
}
#endif
+
+