summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-04-16 22:30:15 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-04-16 22:30:15 +0200
commita5d52174bd993b32d01d26a795a56df4a92eba45 (patch)
treed87a3e1eab33c194a4746e978324a24c31806834 /source4/utils
parentb815b81fb09f770fcacc7e06e82b9ec5f5992fdb (diff)
downloadsamba-a5d52174bd993b32d01d26a795a56df4a92eba45.tar.gz
samba-a5d52174bd993b32d01d26a795a56df4a92eba45.tar.bz2
samba-a5d52174bd993b32d01d26a795a56df4a92eba45.zip
Avoid event_find_context() when the event context is already available
in the net utility. (This used to be commit d40804777edf41889bd461f63f7a07cc1cc60e27)
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/net/net.c1
-rw-r--r--source4/utils/net/net.h1
-rw-r--r--source4/utils/net/net_join.c2
-rw-r--r--source4/utils/net/net_password.c4
-rw-r--r--source4/utils/net/net_time.c2
-rw-r--r--source4/utils/net/net_user.c4
-rw-r--r--source4/utils/net/net_vampire.c6
7 files changed, 11 insertions, 9 deletions
diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c
index 6086a4ce32..ab81f07225 100644
--- a/source4/utils/net/net.c
+++ b/source4/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/source4/utils/net/net.h b/source4/utils/net/net.h
index 17388079dd..309bee277c 100644
--- a/source4/utils/net/net.h
+++ b/source4/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/source4/utils/net/net_join.c b/source4/utils/net/net_join.c
index 37b3c21fcf..ad63340089 100644
--- a/source4/utils/net/net_join.c
+++ b/source4/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/source4/utils/net/net_password.c b/source4/utils/net/net_password.c
index 97bb467fac..55f7c3c31d 100644
--- a/source4/utils/net/net_password.c
+++ b/source4/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/source4/utils/net/net_time.c b/source4/utils/net/net_time.c
index 12a8132cea..92e6e77481 100644
--- a/source4/utils/net/net_time.c
+++ b/source4/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/source4/utils/net/net_user.c b/source4/utils/net/net_user.c
index 57cef6b383..c4b8ecb0c2 100644
--- a/source4/utils/net/net_user.c
+++ b/source4/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/source4/utils/net/net_vampire.c b/source4/utils/net/net_vampire.c
index 38f05353ed..14f6a07e4b 100644
--- a/source4/utils/net/net_vampire.c
+++ b/source4/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;
}