summaryrefslogtreecommitdiff
path: root/source4/utils/net
diff options
context:
space:
mode:
Diffstat (limited to 'source4/utils/net')
-rw-r--r--source4/utils/net/config.mk7
-rw-r--r--source4/utils/net/net.c2
-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
8 files changed, 15 insertions, 13 deletions
diff --git a/source4/utils/net/config.mk b/source4/utils/net/config.mk
index 4423c44c15..93b51e1e28 100644
--- a/source4/utils/net/config.mk
+++ b/source4/utils/net/config.mk
@@ -1,10 +1,9 @@
-# utils/net subsystem
+# $(utilssrcdir)/net subsystem
#################################
# Start BINARY net
[BINARY::net]
INSTALLDIR = BINDIR
-PRIVATE_PROTO_HEADER = net_proto.h
PRIVATE_DEPENDENCIES = \
LIBSAMBA-HOSTCONFIG \
LIBSAMBA-UTIL \
@@ -15,7 +14,7 @@ PRIVATE_DEPENDENCIES = \
# End BINARY net
#################################
-net_OBJ_FILES = $(addprefix utils/net/, \
+net_OBJ_FILES = $(addprefix $(utilssrcdir)/net/, \
net.o \
net_password.o \
net_time.o \
@@ -23,3 +22,5 @@ net_OBJ_FILES = $(addprefix utils/net/, \
net_vampire.o \
net_user.o)
+
+$(eval $(call proto_header_template,$(utilssrcdir)/net/net_proto.h,$(net_OBJ_FILES:.o=.c)))
diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c
index 6086a4ce32..a87b266568 100644
--- a/source4/utils/net/net.c
+++ b/source4/utils/net/net.c
@@ -199,7 +199,7 @@ static int binary_net(int argc, const char **argv)
ZERO_STRUCTP(ctx);
ctx->lp_ctx = cmdline_lp_ctx;
ctx->credentials = cmdline_credentials;
- cli_credentials_set_event_context(ctx->credentials, ev);
+ ctx->event_ctx = 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;
}