The Samba-Bugzilla – Attachment 3473 Details for
Bug 5178
Registry backend: Problems when editing with regedit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix up the WINREG RPC pipe
regRpcServer.patch (text/plain), 4.08 KB, created by
Matthias Dieter Wallnöfer
on 2008-08-13 14:35:40 UTC
(
hide
)
Description:
Patch to fix up the WINREG RPC pipe
Filename:
MIME Type:
Creator:
Matthias Dieter Wallnöfer
Created:
2008-08-13 14:35:40 UTC
Size:
4.08 KB
patch
obsolete
>diff --git a/source/rpc_server/winreg/rpc_winreg.c b/source/rpc_server/winreg/rpc_winreg.c >index 22c60c3..5f96207 100644 >--- a/source/rpc_server/winreg/rpc_winreg.c >+++ b/source/rpc_server/winreg/rpc_winreg.c >@@ -222,16 +222,14 @@ static WERROR dcesrv_winreg_EnumKey(struct dcesrv_call_state *dce_call, > r->in.enum_index, > &name, NULL, &last_mod); > >- if (W_ERROR_IS_OK(r->out.result)) { >- if (2*strlen_m_term(name) > r->in.name->size) { >- return WERR_MORE_DATA; >- } >- r->out.name->length = 2*strlen_m_term(name); >- r->out.name->name = name; >- r->out.keyclass = talloc_zero(mem_ctx, struct winreg_StringBuf); >- if (r->in.last_changed_time) { >- r->out.last_changed_time = &last_mod; >- } >+ if (2*strlen_m_term(name) > r->in.name->size) { >+ return WERR_MORE_DATA; >+ } >+ r->out.name->length = 2*strlen_m_term(name); >+ r->out.name->name = name; >+ r->out.keyclass = talloc_zero(mem_ctx, struct winreg_StringBuf); >+ if (r->in.last_changed_time) { >+ r->out.last_changed_time = &last_mod; > } > > return r->out.result; >@@ -259,8 +257,13 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call, > result = reg_key_get_value_by_index(mem_ctx, key, r->in.enum_index, > &data_name, > &data_type, &data); >+ > if (!W_ERROR_IS_OK(result)) { >- return result; >+ /* if the lookup wasn't successful, send client query back */ >+ data_name = r->in.name->name; >+ data_type = *r->in.type; >+ data.data = r->in.value; >+ data.length = *r->in.length; > } > > /* the client can optionally pass a NULL for type, meaning they don't >@@ -296,7 +299,7 @@ static WERROR dcesrv_winreg_EnumValue(struct dcesrv_call_state *dce_call, > r->out.length = r->out.size; > } > >- return WERR_OK; >+ return result; > } > > >@@ -408,7 +411,7 @@ static WERROR dcesrv_winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, > { > struct dcesrv_handle *h; > struct registry_key *k; >- WERROR ret; >+ WERROR result; > const char *classname = NULL; > > DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); >@@ -420,7 +423,7 @@ static WERROR dcesrv_winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, > case SECURITY_USER: > k = h->data; > >- ret = reg_key_get_info(mem_ctx, k, &classname, r->out.num_subkeys, >+ result = reg_key_get_info(mem_ctx, k, &classname, r->out.num_subkeys, > r->out.num_values, r->out.last_changed_time, > r->out.max_subkeylen, r->out.max_valnamelen, > r->out.max_valbufsize); >@@ -428,7 +431,7 @@ static WERROR dcesrv_winreg_QueryInfoKey(struct dcesrv_call_state *dce_call, > if (r->out.classname != NULL) > r->out.classname->name = classname; > >- return ret; >+ return result; > default: > return WERR_ACCESS_DENIED; > } >@@ -444,9 +447,9 @@ static WERROR dcesrv_winreg_QueryValue(struct dcesrv_call_state *dce_call, > { > struct dcesrv_handle *h; > struct registry_key *key; >+ WERROR result; > uint32_t value_type; > DATA_BLOB value_data; >- WERROR result; > > DCESRV_PULL_HANDLE_FAULT(h, r->in.handle, HTYPE_REGKEY); > >@@ -460,10 +463,14 @@ static WERROR dcesrv_winreg_QueryValue(struct dcesrv_call_state *dce_call, > result = reg_key_get_value_by_name(mem_ctx, key, r->in.value_name.name, > &value_type, &value_data); > >+ > if (!W_ERROR_IS_OK(result)) { >- return result; >+ /* if the lookup wasn't successful, send client query back */ >+ value_type = *r->in.type; >+ value_data.data = r->in.data; >+ value_data.length = *r->in.length; > } >- >+ > /* Just asking for the size of the buffer */ > r->out.type = talloc(mem_ctx, uint32_t); > if (!r->out.type) { >@@ -475,15 +482,15 @@ static WERROR dcesrv_winreg_QueryValue(struct dcesrv_call_state *dce_call, > return WERR_NOMEM; > } > *r->out.length = value_data.length; >- if (r->in.data == NULL) { >- r->out.size = talloc(mem_ctx, uint32_t); >- *r->out.size = value_data.length; >- } else { >- r->out.size = r->in.size; >- r->out.data = value_data.data; >+ r->out.size = talloc(mem_ctx, uint32_t); >+ if (!r->out.size) { >+ return WERR_NOMEM; > } >- >- return WERR_OK; >+ *r->out.size = value_data.length; >+ >+ r->out.data = value_data.data; >+ >+ return result; > default: > return WERR_ACCESS_DENIED; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5178
:
3090
|
3108
|
3109
|
3110
|
3111
|
3112
|
3113
|
3152
|
3400
|
3464
|
3466
|
3472
|
3473
|
3474
|
3480
|
3481
|
3497
|
3572