r9893: fix REG_CREATE_KEY_EX parsing error caused by WinXP clients
authorGerald Carter <jerry@samba.org>
Thu, 1 Sep 2005 13:57:10 +0000 (13:57 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:03:26 +0000 (11:03 -0500)
looking for an not finding a 'Terminal Server' key.
Claims to make problems with usrmgr.exe support as well
according the Samba ml.

Posted on samba@samba.org for review.  Reviewed by
Thomas Bork (comments integrated into the reg_db.c patch
coming up next).
(This used to be commit ee54d1abf929e1b5ad2c202469d1c1c744cc30d9)

source3/include/rpc_reg.h
source3/rpc_parse/parse_reg.c

index bbbb1acf8c1ed45574f5a402911bf3b937a47a3e..f6ddf5b9adffda5f11ac0d8ca4105ae0b1d364b3 100644 (file)
@@ -217,14 +217,17 @@ typedef struct {
        POLICY_HND handle;
        UNISTR4 name;
        UNISTR4 key_class;
-       uint32 reserved;
+       uint32 options;
        uint32 access;
+       
+       /* FIXME!  collapse all this into one structure */
        uint32 *sec_info;
        uint32 ptr2;
        BUFHDR hdr_sec;
        uint32 ptr3;
        SEC_DESC_BUF *data;
-       uint32 unknown_2; /* 0x0000 0000 */
+
+       uint32 *disposition; 
 } REG_Q_CREATE_KEY_EX;
 
 typedef struct {
index 3d586b3779f8ec03ccb17d6c1bec53753f12eed4..332f38ab261f431f55a9149e889ff6e12f012f5f 100644 (file)
@@ -227,7 +227,7 @@ void init_reg_q_create_key_ex(REG_Q_CREATE_KEY_EX *q_c, POLICY_HND *hnd,
        q_c->ptr2 = 1;
        init_buf_hdr(&q_c->hdr_sec, sec_buf->len, sec_buf->len);
        q_c->ptr3 = 1;
-       q_c->unknown_2 = 0x00000000;
+       q_c->disposition = TALLOC_P( get_talloc_ctx(), uint32 );
 }
 
 /*******************************************************************
@@ -259,7 +259,7 @@ BOOL reg_io_q_create_key_ex(const char *desc,  REG_Q_CREATE_KEY_EX *q_u,
        if(!prs_align(ps))
                return False;
 
-       if(!prs_uint32("reserved", ps, depth, &q_u->reserved))
+       if(!prs_uint32("options", ps, depth, &q_u->options))
                return False;
        if(!prs_uint32("access", ps, depth, &q_u->access))
                return False;
@@ -267,16 +267,15 @@ BOOL reg_io_q_create_key_ex(const char *desc,  REG_Q_CREATE_KEY_EX *q_u,
        if(!prs_pointer("sec_info", ps, depth, (void**)&q_u->sec_info, sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
                return False;
 
-       if(!prs_uint32("ptr2", ps, depth, &q_u->ptr2))
-               return False;
-       if(!reg_io_hdrbuf_sec(q_u->ptr2, &q_u->ptr3, &q_u->hdr_sec, q_u->data,
-                             ps, depth))
-               return False;
+       if ( q_u->sec_info ) {
+               if(!prs_uint32("ptr2", ps, depth, &q_u->ptr2))
+                       return False;
+               if(!reg_io_hdrbuf_sec(q_u->ptr2, &q_u->ptr3, &q_u->hdr_sec, q_u->data, ps, depth))
+                       return False;
+       }
 
-#if 0
-       if(!prs_uint32("unknown_2", ps, depth, &q_u->unknown_2))
+       if(!prs_pointer("disposition", ps, depth, (void**)&q_u->disposition, sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
                return False;
-#endif
 
        return True;
 }