r13433: Get ready to implement NET_SAM_LOGON_EX.
authorJeremy Allison <jra@samba.org>
Fri, 10 Feb 2006 17:55:44 +0000 (17:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:10:01 +0000 (11:10 -0500)
Jeremy.

source/include/rpc_netlogon.h
source/rpc_parse/parse_net.c

index 63ab804acbf051f03f7784db4d23a0fbbf1354fe..008204b28d5ea52edd910774f0eb6f2418c3b12d 100644 (file)
@@ -41,6 +41,7 @@
 #define NET_DSR_GETDCNAME      0x14
 #define NET_AUTH3              0x1a
 #define NET_DSR_GETSITENAME    0x1c
+#define NET_SAMLOGON_EX                0x27
 
 /* Secure Channel types.  used in NetrServerAuthenticate negotiation */
 #define SEC_CHAN_WKSTA   2
@@ -571,12 +572,26 @@ typedef struct sam_info {
        NET_ID_INFO_CTR *ctr;
 } DOM_SAM_INFO;
 
+/* SAM_INFO - sam logon/off id structure - no creds */
+typedef struct sam_info_ex {
+       DOM_CLNT_INFO2  client;
+       uint16          logon_level;
+       NET_ID_INFO_CTR *ctr;
+} DOM_SAM_INFO_EX;
+
 /* NET_Q_SAM_LOGON */
 typedef struct net_q_sam_logon_info {
        DOM_SAM_INFO sam_id;
        uint16          validation_level;
 } NET_Q_SAM_LOGON;
 
+/* NET_Q_SAM_LOGON_EX */
+typedef struct net_q_sam_logon_info_ex {
+       DOM_SAM_INFO_EX sam_id;
+       uint16          validation_level;
+       uint32 flags;
+} NET_Q_SAM_LOGON_EX;
+
 /* NET_R_SAM_LOGON */
 typedef struct net_r_sam_logon_info {
        uint32 buffer_creds; /* undocumented buffer pointer */
@@ -590,6 +605,17 @@ typedef struct net_r_sam_logon_info {
        NTSTATUS status; /* return code */
 } NET_R_SAM_LOGON;
 
+/* NET_R_SAM_LOGON_EX */
+typedef struct net_r_sam_logon_info_ex {
+       uint16 switch_value; /* 3 - indicates type of USER INFO */
+       NET_USER_INFO_3 *user;
+
+       uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
+       uint32 flags;
+
+       NTSTATUS status; /* return code */
+} NET_R_SAM_LOGON_EX;
+
 
 /* NET_Q_SAM_LOGOFF */
 typedef struct net_q_sam_logoff_info {
index fd2bc3cf3892b9d442d229b3bd33e1752c94e5eb..d336df161db92a5683dda3fc0dba79655297019a 100644 (file)
@@ -1366,6 +1366,35 @@ static BOOL smb_io_sam_info(const char *desc, DOM_SAM_INFO *sam, prs_struct *ps,
        return True;
 }
 
+/*******************************************************************
+ Reads or writes a DOM_SAM_INFO_EX structure.
+ ********************************************************************/
+
+static BOOL smb_io_sam_info_ex(const char *desc, DOM_SAM_INFO_EX *sam, prs_struct *ps, int depth)
+{
+       if (sam == NULL)
+               return False;
+
+       prs_debug(ps, depth, desc, "smb_io_sam_info_ex");
+       depth++;
+
+       if(!prs_align(ps))
+               return False;
+       
+       if(!smb_io_clnt_info2("", &sam->client, ps, depth))
+               return False;
+
+       if(!prs_uint16("logon_level  ", ps, depth, &sam->logon_level))
+               return False;
+
+       if (sam->logon_level != 0) {
+               if(!net_io_id_info_ctr("logon_info", &sam->ctr, ps, depth))
+                       return False;
+       }
+
+       return True;
+}
+
 /*************************************************************************
  Inits a NET_USER_INFO_3 structure.
 
@@ -1831,6 +1860,79 @@ BOOL net_io_r_sam_logon(const char *desc, NET_R_SAM_LOGON *r_l, prs_struct *ps,
        return True;
 }
 
+/*******************************************************************
+ Reads or writes a structure.
+********************************************************************/
+
+BOOL net_io_q_sam_logon_ex(const char *desc, NET_Q_SAM_LOGON_EX *q_l, prs_struct *ps, int depth)
+{
+       if (q_l == NULL)
+               return False;
+
+       prs_debug(ps, depth, desc, "net_io_q_sam_logon_ex");
+       depth++;
+
+       if(!prs_align(ps))
+               return False;
+       
+       if(!smb_io_sam_info_ex("", &q_l->sam_id, ps, depth))
+               return False;
+
+       if(!prs_align_uint16(ps))
+               return False;
+
+       if(!prs_uint16("validation_level", ps, depth, &q_l->validation_level))
+               return False;
+
+       if(!prs_uint32("flags  ", ps, depth, &q_l->flags))
+               return False;
+
+       return True;
+}
+
+/*******************************************************************
+ Reads or writes a structure.
+********************************************************************/
+
+BOOL net_io_r_sam_logon_ex(const char *desc, NET_R_SAM_LOGON_EX *r_l, prs_struct *ps, int depth)
+{
+       if (r_l == NULL)
+               return False;
+
+       prs_debug(ps, depth, desc, "net_io_r_sam_logon_ex");
+       depth++;
+
+       if(!prs_uint16("switch_value", ps, depth, &r_l->switch_value))
+               return False;
+       if(!prs_align(ps))
+               return False;
+
+#if 1 /* W2k always needs this - even for bad passwd. JRA */
+       if(!net_io_user_info3("", r_l->user, ps, depth, r_l->switch_value, False))
+               return False;
+#else
+       if (r_l->switch_value != 0) {
+               if(!net_io_user_info3("", r_l->user, ps, depth, r_l->switch_value, False))
+                       return False;
+       }
+#endif
+
+       if(!prs_uint32("auth_resp   ", ps, depth, &r_l->auth_resp)) /* 1 - Authoritative response; 0 - Non-Auth? */
+               return False;
+
+       if(!prs_uint32("flags   ", ps, depth, &r_l->flags))
+               return False;
+
+       if(!prs_ntstatus("status      ", ps, depth, &r_l->status))
+               return False;
+
+       if(!prs_align(ps))
+               return False;
+
+       return True;
+}
+
+
 /*******************************************************************
  Reads or writes a structure.
 ********************************************************************/