The branch, v4-0-test has been updated
       via  d40804777edf41889bd461f63f7a07cc1cc60e27 (commit)
      from  b175e7bf16eb26c0bae9731a9147d1d379ca8888 (commit)

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


- Log -----------------------------------------------------------------
commit d40804777edf41889bd461f63f7a07cc1cc60e27
Author: Jelmer Vernooij <[EMAIL PROTECTED]>
Date:   Wed Apr 16 22:30:15 2008 +0200

    Avoid event_find_context() when the event context is already available
    in the net utility.

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

Summary of changes:
 source/utils/net/net.c          |    1 +
 source/utils/net/net.h          |    1 +
 source/utils/net/net_join.c     |    2 +-
 source/utils/net/net_password.c |    4 ++--
 source/utils/net/net_time.c     |    2 +-
 source/utils/net/net_user.c     |    4 ++--
 source/utils/net/net_vampire.c  |    6 +++---
 7 files changed, 11 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/net/net.c b/source/utils/net/net.c
index 6086a4c..ab81f07 100644
--- a/source/utils/net/net.c
+++ b/source/utils/net/net.c
@@ -199,6 +199,7 @@ static int binary_net(int argc, const char **argv)
        ZERO_STRUCTP(ctx);
        ctx->lp_ctx = cmdline_lp_ctx;
        ctx->credentials = cmdline_credentials;
+       ctx->event_ctx = ev;
        cli_credentials_set_event_context(ctx->credentials, ev);
 
        rc = net_run_function(ctx, argc_new-1, argv_new+1, net_functable, 
net_usage);
diff --git a/source/utils/net/net.h b/source/utils/net/net.h
index 1738807..309bee2 100644
--- a/source/utils/net/net.h
+++ b/source/utils/net/net.h
@@ -24,6 +24,7 @@
 struct net_context {
        struct cli_credentials *credentials;
        struct loadparm_context *lp_ctx;
+       struct event_context *event_ctx;
 };
 
 struct net_functable {
diff --git a/source/utils/net/net_join.c b/source/utils/net/net_join.c
index 37b3c21..ad63340 100644
--- a/source/utils/net/net_join.c
+++ b/source/utils/net/net_join.c
@@ -58,7 +58,7 @@ int net_join(struct net_context *ctx, int argc, const char 
**argv)
 
        domain_name = tmp;
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }
diff --git a/source/utils/net/net_password.c b/source/utils/net/net_password.c
index 97bb467..55f7c3c 100644
--- a/source/utils/net/net_password.c
+++ b/source/utils/net/net_password.c
@@ -53,7 +53,7 @@ static int net_password_change(struct net_context *ctx, int 
argc, const char **a
                new_password = getpass(password_prompt);
        }
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }
@@ -128,7 +128,7 @@ static int net_password_set(struct net_context *ctx, int 
argc, const char **argv
                new_password = getpass(password_prompt);
        }
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }
diff --git a/source/utils/net/net_time.c b/source/utils/net/net_time.c
index 12a8132..92e6e77 100644
--- a/source/utils/net/net_time.c
+++ b/source/utils/net/net_time.c
@@ -43,7 +43,7 @@ int net_time(struct net_context *ctx, int argc, const char 
**argv)
                return net_time_usage(ctx, argc, argv);
        }
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }
diff --git a/source/utils/net/net_user.c b/source/utils/net/net_user.c
index 57cef6b..c4b8ecb 100644
--- a/source/utils/net/net_user.c
+++ b/source/utils/net/net_user.c
@@ -44,7 +44,7 @@ static int net_user_add(struct net_context *ctx, int argc, 
const char **argv)
        }
 
        /* libnet context init and its params */
-       lnet_ctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       lnet_ctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!lnet_ctx) return -1;
 
        lnet_ctx->cred = ctx->credentials;
@@ -84,7 +84,7 @@ static int net_user_delete(struct net_context *ctx, int argc, 
const char **argv)
        }
 
        /* libnet context init and its params */
-       lnet_ctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       lnet_ctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!lnet_ctx) return -1;
 
        lnet_ctx->cred = ctx->credentials;
diff --git a/source/utils/net/net_vampire.c b/source/utils/net/net_vampire.c
index 38f0535..14f6a07 100644
--- a/source/utils/net/net_vampire.c
+++ b/source/utils/net/net_vampire.c
@@ -54,7 +54,7 @@ static int net_samdump_keytab(struct net_context *ctx, int 
argc, const char **ar
                break;
        }
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }
@@ -100,7 +100,7 @@ int net_samdump(struct net_context *ctx, int argc, const 
char **argv)
                return rc;
        }
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }
@@ -142,7 +142,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, 
const char **argv)
        struct libnet_context *libnetctx;
        struct libnet_samsync_ldb r;
 
-       libnetctx = libnet_context_init(event_context_find(ctx), ctx->lp_ctx);
+       libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx);
        if (!libnetctx) {
                return -1;      
        }


-- 
Samba Shared Repository

Reply via email to