diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2008-09-15 18:21:45 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-21 14:40:41 +0200 |
commit | 083785c0919b635601fdfc23c6dcc9368fa14a0d (patch) | |
tree | a4cf9e340717f58e0571f6ac00dd71a09c30569a | |
parent | c26cb44e0328aaba1d81cb4bd09b37252c7a725b (diff) | |
download | samba-083785c0919b635601fdfc23c6dcc9368fa14a0d.tar.gz samba-083785c0919b635601fdfc23c6dcc9368fa14a0d.tar.bz2 samba-083785c0919b635601fdfc23c6dcc9368fa14a0d.zip |
Registry server "reg_ldb_unpack_value": Tests demonstrate that also "type" doesn't has to be NULL
-rw-r--r-- | source4/lib/registry/ldb.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/winreg/rpc_winreg.c | 24 |
2 files changed, 11 insertions, 17 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index be844d75d5..95851dace0 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -52,8 +52,8 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, NULL)); value_type = ldb_msg_find_attr_as_uint(msg, "type", 0); - if (type != NULL) - *type = value_type; + *type = value_type; + val = ldb_msg_find_ldb_val(msg, "data"); switch (value_type) diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index dbb51b9baf..5cabae53a2 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -68,7 +68,6 @@ static WERROR dcesrv_winreg_openhive(struct dcesrv_call_state *dce_call, if (!W_ERROR_IS_OK(result)) { return result; } - *outh = &h->wire_handle; return result; @@ -279,20 +278,6 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call, data.length = *r->in.length; } - /* the client can optionally pass a NULL for type, meaning they don't - want that back */ - if (r->in.type != NULL) { - r->out.type = talloc(mem_ctx, enum winreg_Type); - *r->out.type = data_type; - } - - /* check the client has enough room for the value */ - if (r->in.value != NULL && - r->in.size != NULL && - data.length > *r->in.size) { - return WERR_MORE_DATA; - } - /* and enough room for the name */ if (r->in.name->size < 2*strlen_m_term(data_name)) { return WERR_MORE_DATA; @@ -308,6 +293,15 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call, } r->out.name->size = r->in.name->size; + *r->out.value = data_type; + + /* check the client has enough room for the value */ + if (r->in.value != NULL && + r->in.size != NULL && + data.length > *r->in.size) { + return WERR_MORE_DATA; + } + if (r->in.value != NULL) { r->out.value = data.data; } |