From 8efd30ca610692fad3103ae7c9de57fc46206763 Mon Sep 17 00:00:00 2001 From: Vicentiu Ciorbaru Date: Wed, 13 Jul 2011 22:57:08 +0300 Subject: [PATCH] s3-net: rpc_conf_list now uses the wrapper rpc_conf_open_conf Signed-off-by: Michael Adam --- source3/utils/net_rpc_conf.c | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/source3/utils/net_rpc_conf.c b/source3/utils/net_rpc_conf.c index 84101f6dcd1..365d0ee8bb2 100644 --- a/source3/utils/net_rpc_conf.c +++ b/source3/utils/net_rpc_conf.c @@ -355,7 +355,6 @@ static NTSTATUS rpc_conf_list_internal(struct net_context *c, NTSTATUS status = NT_STATUS_OK; WERROR werr = WERR_OK; WERROR _werr; - struct winreg_String key; struct dcerpc_binding_handle *b = pipe_hnd->binding_handle; @@ -367,7 +366,6 @@ static NTSTATUS rpc_conf_list_internal(struct net_context *c, const char **subkeys = NULL; - ZERO_STRUCT(key); ZERO_STRUCT(hive_hnd); ZERO_STRUCT(key_hnd); @@ -378,34 +376,18 @@ static NTSTATUS rpc_conf_list_internal(struct net_context *c, goto error; } - status = dcerpc_winreg_OpenHKLM(b, frame, NULL, - REG_KEY_READ, &hive_hnd, &werr); + status = rpc_conf_open_conf(frame, + b, + REG_KEY_READ, + &hive_hnd, + &key_hnd, + &werr); if (!(NT_STATUS_IS_OK(status))) { - d_fprintf(stderr, _("Failed to open hive: %s\n"), - nt_errstr(status)); - goto error; - } - if (!W_ERROR_IS_OK(werr)) { - d_fprintf(stderr, _("Failed to open hive: %s\n"), - win_errstr(werr)); goto error; } - key.name = confpath; - status = dcerpc_winreg_OpenKey(b, frame, &hive_hnd, key, 0, - REG_KEY_READ, &key_hnd, &werr); - - if (!(NT_STATUS_IS_OK(status))) { - d_fprintf(stderr, _("Failed to open smbconf key: %s\n"), - nt_errstr(status)); - dcerpc_winreg_CloseKey(b, frame, &hive_hnd, &_werr); - goto error; - } if (!(W_ERROR_IS_OK(werr))) { - d_fprintf(stderr, _("Failed to open smbconf key: %s\n"), - win_errstr(werr)); - dcerpc_winreg_CloseKey(b, frame, &hive_hnd, &_werr); goto error; } -- 2.11.4.GIT