[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Sun Mar 21 08:48:48 MDT 2010


The branch, master has been updated
       via  ad83995... s4:registry - "LDB backend" - reg_key_get_info - adapt max. subkey and value length
       via  2bbdb2c... s4:WINREG RPC server - don't check for the "name" size in "EnumValue"
      from  0f2cf82... s4:torture - WINREG RPC - reactivate test "SetValueExtended" for s4

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit ad83995de5df5a738c2fdad48866e226533b9b0a
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sun Mar 21 15:33:52 2010 +0100

    s4:registry - "LDB backend" - reg_key_get_info - adapt max. subkey and value length
    
    Those lengths are measured in UTF8 string lengths and not in UTF16 ones (the
    returned strings are generally in this format). Discovered this by checking the
    s3 registry code.
    Therefore we have to multiply the both numbers by two.
    
    Discovered with the "regedt32" (old NT registry editor).

commit 2bbdb2cd34233b0836f1aa7365e02c85494af4fa
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sun Mar 21 15:12:37 2010 +0100

    s4:WINREG RPC server - don't check for the "name" size in "EnumValue"
    
    This isn't needed at all since:
    1.) a new name object is created and sent back to the client
    2.) the "size" seems to be the size of the "name" pointer. On my test with the
        "regedt32" program this has always been "4".

-----------------------------------------------------------------------

Summary of changes:
 source4/lib/registry/ldb.c             |   16 ++++++++--------
 source4/rpc_server/winreg/rpc_winreg.c |    5 -----
 2 files changed, 8 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 5f1a06c..46b340d 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -991,12 +991,13 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
 		unsigned int i;
 		struct ldb_message_element *el;
 
-		*max_subkeynamelen = 0;
-
 		for (i = 0; i < kd->subkey_count; i++) {
 			el = ldb_msg_find_element(kd->subkeys[i], "key");
 			*max_subkeynamelen = MAX(*max_subkeynamelen, el->values[0].length);
 		}
+
+		/* for UTF16 encoding */
+		*max_subkeynamelen *= 2;
 	}
 
 	if (max_valnamelen != NULL || max_valbufsize != NULL) {
@@ -1004,12 +1005,6 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
 		struct ldb_message_element *el;
 		W_ERROR_NOT_OK_RETURN(cache_values(kd));
 
-		if (max_valbufsize != NULL)
-			*max_valbufsize = 0;
-
-		if (max_valnamelen != NULL)
-			*max_valnamelen = 0;
-
 		for (i = 0; i < kd->value_count; i++) {
 			if (max_valnamelen != NULL) {
 				el = ldb_msg_find_element(kd->values[i], "value");
@@ -1026,6 +1021,11 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
 				talloc_free(data.data);
 			}
 		}
+
+		if (max_valnamelen != NULL) {
+			/* for UTF16 encoding */
+			*max_valnamelen *= 2;
+		}
 	}
 
 	return WERR_OK;
diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c
index 5bfc655..506c72d 100644
--- a/source4/rpc_server/winreg/rpc_winreg.c
+++ b/source4/rpc_server/winreg/rpc_winreg.c
@@ -300,11 +300,6 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call,
 		data.length = *r->in.length;
 	}
 
-	/* check if there is enough room for the name */
-	if (r->in.name->size < 2*strlen_m_term(data_name)) {
-		return WERR_MORE_DATA;
-	}
-
 	/* "data_name" is NULL when we query the default attribute */
 	if (data_name != NULL) {
 		r->out.name->name = data_name;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list