smbparse.c smb.h :
authorLuke Leighton <lkcl@samba.org>
Fri, 17 Oct 1997 13:43:01 +0000 (13:43 +0000)
committerLuke Leighton <lkcl@samba.org>
Fri, 17 Oct 1997 13:43:01 +0000 (13:43 +0000)
uni_max_len and uni_str_len are the other way round, in UNIHDR.

util.c :

increased the show_msg() data size from 256 bytes to 512 bytes:
the LSA SAM Logon response can be about 500 bytes long.

pipenetlog.c :

forgot to set the authoritative field to 1.
(This used to be commit 71c6678cd7ffe30a5da27766cf99147e1921feae)

source3/include/smb.h
source3/lib/util.c
source3/pipenetlog.c
source3/pipeutil.c
source3/smbparse.c

index e4c2823a198e2818c8a53fce99898efc7fe3f99b..80b2f28f4a50cb37b3dd662cd3013135bae8af1a 100644 (file)
@@ -772,7 +772,7 @@ typedef struct lsa_q_user_info
        UNIHDR hdr_logon_dom; /* logon domain unicode string header */
 
        uint32 buffer_dom_id; /* undocumented logon domain id pointer */
-       char padding[40];    /* unused padding bytes? */
+       char padding[40];    /* unused padding bytes.  expansion room */
 
        uint32 num_other_sids; /* 0 - num_sids */
        uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */
index 0a8540b48b4cbe722ddee8a11ae479a3bfb937e5..a82713a0d84c44ab3bc0204e96c58f8e8f88190c 100644 (file)
@@ -1182,9 +1182,9 @@ void show_msg(char *buf)
   DEBUG(5,("smb_bcc=%d\n",bcc));
   if (DEBUGLEVEL < 10)
     return;
-  for (i = 0; i < MIN(bcc, 256); i += 16)
+  for (i = 0; i < MIN(bcc, 512); i += 16)
   {
-    for (j = 0; j < 16 && i+j < MIN(bcc,256); j++)
+    for (j = 0; j < 16 && i+j < MIN(bcc,512); j++)
     {
 
       DEBUG(10,("%2X ",CVAL(smb_buf(buf),i+j)));
@@ -1193,7 +1193,7 @@ void show_msg(char *buf)
     }
     DEBUG(10,("  "));  
 
-    for (j = 0; j < 16 && i+j < MIN(bcc,256); j++)
+    for (j = 0; j < 16 && i+j < MIN(bcc,512); j++)
     {
       unsigned char c = CVAL(smb_buf(buf),i+j);
       if (c < 32 || c > 128) c = '.';
index 54769270afef5fab0cc79ebadb6054391afab78d..14b20639514fcd7d4cffe4fc52e46f5d2e66c167 100644 (file)
@@ -242,6 +242,7 @@ static int lsa_reply_sam_logon(LSA_Q_SAM_LOGON *q_s, char *q, char *base,
        r_s.user = user_info;
        r_s.buffer_user = user_info != NULL ? 1 : 0;
        r_s.status = user_info != NULL ? 0 : (0xC000000|NT_STATUS_NO_SUCH_USER);
+       r_s.auth_resp = 1; /* authoritative response */
 
        /* store the response in the SMB stream */
        q = lsa_io_r_sam_logon(False, &r_s, q, base, 4, 0);
index f55a8d2181e3da3d3f674b08fbf47243b05aba23..de58d56a98cae1e5c6afc5a881f90a532c98b791 100644 (file)
@@ -106,6 +106,16 @@ void make_dom_sid(DOM_SID *sid, char *domsid)
        int identauth;
        char *p;
 
+       if (sid == NULL) return;
+
+       if (domsid == NULL)
+       {
+               DEBUG(4,("netlogon domain SID: none\n"));
+               sid->sid_no = 0;
+               sid->num_auths = 0;
+               return;
+       }
+               
        DEBUG(4,("netlogon domain SID: %s\n", domsid));
 
        /* assume, but should check, that domsid starts "S-" */
index e5f455a40862971593a9ca8e77c1d0d84a59fb9a..de6ee7b90eef29071be3a4b17306c894b0de5532 100644 (file)
@@ -104,10 +104,14 @@ char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align, int de
 
        q = align_offset(q, base, align);
        
-       DBG_RW_SVAL("uni_max_len", depth, base, io, q, hdr->uni_max_len); q += 4;
-       DBG_RW_SVAL("uni_str_len", depth, base, io, q, hdr->uni_str_len); q += 4;
+       DBG_RW_SVAL("uni_str_len", depth, base, io, q, hdr->uni_str_len); q += 2;
+       DBG_RW_SVAL("uni_max_len", depth, base, io, q, hdr->uni_max_len); q += 2;
        DBG_RW_IVAL("undoc      ", depth, base, io, q, hdr->undoc      ); q += 4;
 
+       /* oops! XXXX maybe issue a warning that this is happening... */
+       if (hdr->uni_max_len > MAX_UNISTRLEN) hdr->uni_max_len = MAX_UNISTRLEN;
+       if (hdr->uni_str_len > MAX_UNISTRLEN) hdr->uni_str_len = MAX_UNISTRLEN;
+
        return q;
 }