diff options
author | Volker Lendecke <vlendec@samba.org> | 2006-12-01 20:01:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:18 -0500 |
commit | ecf90c495eb850cd6f376fb4e090640b69f0c029 (patch) | |
tree | f3f30d71daab2abb56f50bac558fb9a43f28d6f1 /source3/utils | |
parent | e57de5730cd65bca08ea2dabcf2d74d52825285e (diff) | |
download | samba-ecf90c495eb850cd6f376fb4e090640b69f0c029.tar.gz samba-ecf90c495eb850cd6f376fb4e090640b69f0c029.tar.bz2 samba-ecf90c495eb850cd6f376fb4e090640b69f0c029.zip |
r19991: Sorry for this 2000-liner...
The main thing here is a rewrite of srv_winreg_nt.c. The core functionality
has moved to registry/reg_api.c which is then usable by the rest of Samba as
well.
On that way it fixes creating keys with more than one element in the
path. This did not work before.
Two things that sneaked in (sorry :-) is the change of some routines from
NTSTATUS to WERROR the removed "parent" argument to regkey_open_internal.
Volker
(This used to be commit fea52801de8c7b85c578d200c599475680c5339f)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_printer.c | 7 | ||||
-rw-r--r-- | source3/utils/net_rpc_registry.c | 25 |
2 files changed, 17 insertions, 15 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 5a18253aaf..d0b55454f9 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -132,10 +132,9 @@ static void display_reg_value(const char *subkey, REGISTRY_VALUE value) uint32 i, num_values; char **values; - if (!NT_STATUS_IS_OK(reg_pull_multi_sz(NULL, value.data_p, - value.size, - &num_values, - &values))) { + if (!W_ERROR_IS_OK(reg_pull_multi_sz(NULL, value.data_p, + value.size, &num_values, + &values))) { d_printf("reg_pull_multi_sz failed\n"); break; } diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index c684b04b8e..3634b0a4f2 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -266,6 +266,7 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx, char n; struct winreg_ValNameBuf name_buf; + WERROR err; n = '\0'; name_buf.name = &n; @@ -301,9 +302,10 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx, goto error; } - status = registry_pull_value(values, &values[i], *ptype, data, - *pdata_size, *pvalue_length); - if (!(NT_STATUS_IS_OK(status))) { + err = registry_pull_value(values, &values[i], *ptype, data, + *pdata_size, *pvalue_length); + if (!W_ERROR_IS_OK(err)) { + status = werror_to_ntstatus(err); goto error; } } @@ -333,10 +335,11 @@ static NTSTATUS registry_setvalue(TALLOC_CTX *mem_ctx, struct winreg_String name_string; DATA_BLOB blob; NTSTATUS result; + WERROR err; - result = registry_push_value(mem_ctx, value, &blob); - if (!NT_STATUS_IS_OK(result)) { - return result; + err = registry_push_value(mem_ctx, value, &blob); + if (!W_ERROR_IS_OK(err)) { + return werror_to_ntstatus(err); } name_string.name = name; @@ -590,12 +593,12 @@ static NTSTATUS rpc_registry_enumerate_internal(const DOM_SID *domain_sid, { POLICY_HND pol_hive, pol_key; NTSTATUS status; - uint32 num_subkeys; - uint32 num_values; - char **names, **classes; - NTTIME **modtimes; + uint32 num_subkeys = 0; + uint32 num_values = 0; + char **names = NULL, **classes = NULL; + NTTIME **modtimes = NULL; uint32 i; - struct registry_value **values; + struct registry_value **values = NULL; if (argc != 1 ) { d_printf("Usage: net rpc enumerate <path> [recurse]\n"); |