From ba0bf87d967a9544b9c97525994a43ad5b6f1f60 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 21 Apr 2008 20:14:32 +0200 Subject: net: Add libnetapi context to net's impressive list of globals. Guenther (This used to be commit 8a5fadf6a183e4e4ccc77283b3ddba0748c6abfb) --- source3/utils/net_rpc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source3/utils/net_rpc.c') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 924398fc33..5845c14314 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -601,7 +601,7 @@ static int rpc_user_add(int argc, const char **argv) if (status != 0) { d_fprintf(stderr, "Failed to add user '%s' with: %s.\n", - argv[0], libnetapi_get_error_string(NULL, status)); + argv[0], libnetapi_get_error_string(netapi_ctx, status)); return -1; } else { d_printf("Added user '%s'.\n", argv[0]); @@ -769,7 +769,7 @@ static int rpc_user_delete(int argc, const char **argv) if (status != 0) { d_fprintf(stderr, "Failed to delete user '%s' with: %s.\n", argv[0], - libnetapi_get_error_string(NULL, status)); + libnetapi_get_error_string(netapi_ctx, status)); return -1; } else { d_printf("Deleted user '%s'.\n", argv[0]); @@ -1147,7 +1147,6 @@ static NTSTATUS rpc_user_list_internals(const DOM_SID *domain_sid, int net_rpc_user(int argc, const char **argv) { - struct libnetapi_ctx *ctx = NULL; NET_API_STATUS status; struct functable func[] = { @@ -1159,12 +1158,12 @@ int net_rpc_user(int argc, const char **argv) {NULL, NULL} }; - status = libnetapi_init(&ctx); + status = libnetapi_init(&netapi_ctx); if (status != 0) { return -1; } - libnetapi_set_username(ctx, opt_user_name); - libnetapi_set_password(ctx, opt_password); + libnetapi_set_username(netapi_ctx, opt_user_name); + libnetapi_set_password(netapi_ctx, opt_password); if (argc == 0) { return run_rpc_command(NULL,PI_SAMR, 0, -- cgit