summaryrefslogtreecommitdiff
path: root/source3/utils/net_rpc_registry.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-01 20:01:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:18 -0500
commitecf90c495eb850cd6f376fb4e090640b69f0c029 (patch)
treef3f30d71daab2abb56f50bac558fb9a43f28d6f1 /source3/utils/net_rpc_registry.c
parente57de5730cd65bca08ea2dabcf2d74d52825285e (diff)
downloadsamba-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/net_rpc_registry.c')
-rw-r--r--source3/utils/net_rpc_registry.c25
1 files changed, 14 insertions, 11 deletions
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");