summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools/regpatch.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2004-05-22 18:49:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:53 -0500
commitbf52e242f53aeaac33eea69fbdfb3477634b90fb (patch)
tree76b04dc95e3e7befd45180a661cd7f55d085701e /source4/lib/registry/tools/regpatch.c
parent4e9d01c2a7cd044ac4b466a1039c9a7e3978d6ef (diff)
downloadsamba-bf52e242f53aeaac33eea69fbdfb3477634b90fb.tar.gz
samba-bf52e242f53aeaac33eea69fbdfb3477634b90fb.tar.bz2
samba-bf52e242f53aeaac33eea69fbdfb3477634b90fb.zip
r825: - Introduce support for multiple roots (or 'hives')
- Clean up rpc backend (possible now that multiple hives are supported) (This used to be commit 8cd1b6bc70510fe576135a66351e9e3ea895c9ff)
Diffstat (limited to 'source4/lib/registry/tools/regpatch.c')
-rw-r--r--source4/lib/registry/tools/regpatch.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index 64c2637a0c..77c0f710c1 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -664,7 +664,7 @@ static CMD_FILE *cmd_file_create(const char *file)
char *str_type(unsigned char type);
-static int nt_apply_reg_command_file(REG_KEY *root, const char *cmd_file_name)
+static int nt_apply_reg_command_file(REG_HANDLE *r, const char *cmd_file_name)
{
CMD *cmd;
BOOL modified = False;
@@ -680,12 +680,12 @@ static int nt_apply_reg_command_file(REG_KEY *root, const char *cmd_file_name)
*/
switch (cmd->cmd) {
case CMD_ADD_KEY:
- error = reg_open_key(root, cmd->key, &tmp);
+ error = reg_open_key_abs(r, cmd->key, &tmp);
/* If we found it, apply the other bits, else create such a key */
if (W_ERROR_EQUAL(error, WERR_DEST_NOT_FOUND)) {
- if(W_ERROR_IS_OK(reg_key_add_name_recursive(root, cmd->key))) {
- error = reg_open_key(root, cmd->key, &tmp);
+ if(W_ERROR_IS_OK(reg_key_add_name_recursive_abs(r, cmd->key))) {
+ error = reg_open_key_abs(r, cmd->key, &tmp);
if(!W_ERROR_IS_OK(error)) {
DEBUG(0, ("Error finding new key '%s' after it has been added\n", cmd->key));
continue;
@@ -732,7 +732,7 @@ static int nt_apply_reg_command_file(REG_KEY *root, const char *cmd_file_name)
* Find the key if it exists, and delete it ...
*/
- error = reg_open_key(root, cmd->key, &tmp);
+ error = reg_open_key_abs(r, cmd->key, &tmp);
if(!W_ERROR_IS_OK(error)) {
DEBUG(0, ("Unable to open key '%s'\n", cmd->key));
continue;
@@ -756,7 +756,6 @@ static int nt_apply_reg_command_file(REG_KEY *root, const char *cmd_file_name)
{
int opt;
poptContext pc;
- REG_KEY *root;
const char *location;
const char *credentials = NULL;
const char *patch;
@@ -793,13 +792,7 @@ static int nt_apply_reg_command_file(REG_KEY *root, const char *cmd_file_name)
if(!patch) patch = "/dev/stdin";
poptFreeContext(pc);
- error = reg_get_root(h, &root);
- if(!W_ERROR_IS_OK(error)) {
- DEBUG(0, ("Error opening root!\n"));
- return 1;
- }
-
- nt_apply_reg_command_file(root, patch);
+ nt_apply_reg_command_file(h, patch);
reg_free(h);