[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha5-494-g6ac32d0

Jelmer Vernooij jelmer at samba.org
Tue Sep 9 22:06:26 GMT 2008


The branch, v4-0-test has been updated
       via  6ac32d0a10a9a27abceca362fcab04bcfc55c33f (commit)
       via  42ab865fc937a625d1eece45abe96bf354ddff8b (commit)
       via  d1052dc42ef591208cfbf7059b28a078f6d4f0bf (commit)
      from  62d76356c10b4223236425c4db32c2fc5105d155 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 6ac32d0a10a9a27abceca362fcab04bcfc55c33f
Merge: 62d76356c10b4223236425c4db32c2fc5105d155 42ab865fc937a625d1eece45abe96bf354ddff8b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed Sep 10 00:05:37 2008 +0200

    Merge branch 'v4-0-regClient' of git://repo.or.cz/Samba/mdw into manpage

commit 42ab865fc937a625d1eece45abe96bf354ddff8b
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Tue Sep 9 18:03:54 2008 +0200

    Fix up the "reg_common_open_remote" call
    
    This fixes up the "reg_common_open_remote" call because it didn't work anymore without the event context.

commit d1052dc42ef591208cfbf7059b28a078f6d4f0bf
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Tue Sep 9 18:01:20 2008 +0200

    Two useful "regshell" improvements
    
    This patch corrects the "change key" command (Follow up isn't supported yet) and adds a newline in a error message.

-----------------------------------------------------------------------

Summary of changes:
 source/lib/registry/tools/common.c   |    3 ++-
 source/lib/registry/tools/regpatch.c |    8 ++++----
 source/lib/registry/tools/regshell.c |   18 ++++++++----------
 source/lib/registry/tools/regtree.c  |    2 +-
 4 files changed, 15 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/registry/tools/common.c b/source/lib/registry/tools/common.c
index 3ea780d..f770f6a 100644
--- a/source/lib/registry/tools/common.c
+++ b/source/lib/registry/tools/common.c
@@ -24,13 +24,14 @@
 #include "lib/registry/tools/common.h"
 
 struct registry_context *reg_common_open_remote(const char *remote,
+						struct event_context *ev_ctx,
 						struct loadparm_context *lp_ctx,
 						struct cli_credentials *creds)
 {
 	struct registry_context *h = NULL;
 	WERROR error;
 
-	error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, NULL);
+	error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, ev_ctx);
 
 	if (!W_ERROR_IS_OK(error)) {
 		fprintf(stderr, "Unable to open remote registry at %s:%s \n",
diff --git a/source/lib/registry/tools/regpatch.c b/source/lib/registry/tools/regpatch.c
index 1170fba..add59a5 100644
--- a/source/lib/registry/tools/regpatch.c
+++ b/source/lib/registry/tools/regpatch.c
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
 	struct registry_context *h;
 	const char *file = NULL;
 	const char *remote = NULL;
-	struct event_context *ev;
+	struct event_context *ev_ctx;
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
 		{"remote", 'R', POPT_ARG_STRING, &remote, 0, "connect to specified remote server", NULL},
@@ -49,12 +49,12 @@ int main(int argc, char **argv)
 	while((opt = poptGetNextOpt(pc)) != -1) {
 	}
 
-	ev = s4_event_context_init(NULL);
+	ev_ctx = s4_event_context_init(NULL);
 
 	if (remote) {
-		h = reg_common_open_remote (remote, cmdline_lp_ctx, cmdline_credentials);
+		h = reg_common_open_remote (remote, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
 	} else {
-		h = reg_common_open_local (cmdline_credentials, ev, cmdline_lp_ctx);
+		h = reg_common_open_local (cmdline_credentials, ev_ctx, cmdline_lp_ctx);
 	}
 
 	if (h == NULL)
diff --git a/source/lib/registry/tools/regshell.c b/source/lib/registry/tools/regshell.c
index 4e859df..98f7f02 100644
--- a/source/lib/registry/tools/regshell.c
+++ b/source/lib/registry/tools/regshell.c
@@ -162,9 +162,7 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv)
 	struct registry_key *new = NULL;
 	WERROR error;
 
-	if(argc < 2) {
-		new = ctx->current;
-	} else {
+	if(argc == 2) {
 		error = reg_open_key(ctx->registry, ctx->current, argv[1],
 				     &new);
 		if(!W_ERROR_IS_OK(error)) {
@@ -172,11 +170,11 @@ static WERROR cmd_ck(struct regshell_context *ctx, int argc, char **argv)
 				win_errstr(error)));
 			return error;
 		}
-	}
 
-	ctx->path = talloc_asprintf(ctx, "%s\\%s", ctx->path, argv[1]);
-	printf("Current path is: %s\n", ctx->path);
-	ctx->current = new;
+		ctx->path = talloc_asprintf(ctx, "%s\\%s", ctx->path, argv[1]);
+		ctx->current = new;
+	}
+	printf("New path is: %s\n", ctx->path);
 
 	return WERR_OK;
 }
@@ -188,7 +186,7 @@ static WERROR cmd_print(struct regshell_context *ctx, int argc, char **argv)
 	WERROR error;
 
 	if (argc != 2) {
-		fprintf(stderr, "Usage: print <valuename>");
+		fprintf(stderr, "Usage: print <valuename>\n");
 		return WERR_INVALID_PARAM;
 	}
 
@@ -520,8 +518,8 @@ int main(int argc, char **argv)
 	ev_ctx = s4_event_context_init(ctx);
 
 	if (remote != NULL) {
-		ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx, 
-						       cmdline_credentials);
+		ctx->registry = reg_common_open_remote(remote, ev_ctx,
+					 cmdline_lp_ctx, cmdline_credentials);
 	} else if (file != NULL) {
 		ctx->current = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
 		if (ctx->current == NULL)
diff --git a/source/lib/registry/tools/regtree.c b/source/lib/registry/tools/regtree.c
index daca695..19e4a01 100644
--- a/source/lib/registry/tools/regtree.c
+++ b/source/lib/registry/tools/regtree.c
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
 	ev_ctx = s4_event_context_init(NULL);
 
 	if (remote != NULL) {
-		h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials);
+		h = reg_common_open_remote(remote, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
 	} else if (file != NULL) {
 		start_key = reg_common_open_file(file, ev_ctx, cmdline_lp_ctx, cmdline_credentials);
 	} else {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list