diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-11-21 20:40:50 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-24 08:37:04 +0100 |
commit | 88d020ade07bfe5cd7570b8c9b80a162adb39891 (patch) | |
tree | c37d970b1061b74655d19725c754e15c71816a53 /source3/utils | |
parent | 58920aab0237aaa9f4a81577800bddba97e279a5 (diff) | |
download | samba-88d020ade07bfe5cd7570b8c9b80a162adb39891.tar.gz samba-88d020ade07bfe5cd7570b8c9b80a162adb39891.tar.bz2 samba-88d020ade07bfe5cd7570b8c9b80a162adb39891.zip |
s3-netapi Add libnetapi_net_init(), don't double-init common Samba subsystems
The issue here is that libnet and net were both trying to load the
smb.conf files, the case tables and set the debug levels. The set of
the debug levels caused problems, because it would force the level to
0, not (say) 10 as requested on the command line.
This regression was apparently introduced in
cf4de8ec2c8df2ceabbe3d836d296b058e7b19fb when eliminating
AllowDebugChange.
Andrew Bartlett
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_dom.c | 3 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 11 | ||||
-rw-r--r-- | source3/utils/net_rpc_shell.c | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/source3/utils/net_dom.c b/source3/utils/net_dom.c index d07a1d4f04..d1eb9edba8 100644 --- a/source3/utils/net_dom.c +++ b/source3/utils/net_dom.c @@ -22,6 +22,7 @@ #include "../librpc/gen_ndr/cli_initshutdown.h" #include "../librpc/gen_ndr/ndr_winreg.h" #include "lib/netapi/netapi.h" +#include "lib/netapi/netapi_net.h" int net_dom_usage(struct net_context *c, int argc, const char **argv) { @@ -372,7 +373,7 @@ int net_dom(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; - status = libnetapi_init(&c->netapi_ctx); + status = libnetapi_net_init(&c->netapi_ctx); if (status != 0) { return -1; } diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 1b0e469afc..228f7eb852 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -35,6 +35,7 @@ #include "../librpc/gen_ndr/cli_winreg.h" #include "secrets.h" #include "lib/netapi/netapi.h" +#include "lib/netapi/netapi_net.h" #include "rpc_client/init_lsa.h" #include "../libcli/security/security.h" @@ -1050,7 +1051,7 @@ int net_rpc_user(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; - status = libnetapi_init(&c->netapi_ctx); + status = libnetapi_net_init(&c->netapi_ctx); if (status != 0) { return -1; } @@ -2899,7 +2900,7 @@ int net_rpc_group(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; - status = libnetapi_init(&c->netapi_ctx); + status = libnetapi_net_init(&c->netapi_ctx); if (status != 0) { return -1; } @@ -4745,7 +4746,7 @@ int net_rpc_share(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; - status = libnetapi_init(&c->netapi_ctx); + status = libnetapi_net_init(&c->netapi_ctx); if (status != 0) { return -1; } @@ -5021,7 +5022,7 @@ int net_rpc_file(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; - status = libnetapi_init(&c->netapi_ctx); + status = libnetapi_net_init(&c->netapi_ctx); if (status != 0) { return -1; } @@ -7428,7 +7429,7 @@ int net_rpc(struct net_context *c, int argc, const char **argv) {NULL, NULL, 0, NULL, NULL} }; - status = libnetapi_init(&c->netapi_ctx); + status = libnetapi_net_init(&c->netapi_ctx); if (status != 0) { return -1; } diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c index 82f9f29ced..c2384254ab 100644 --- a/source3/utils/net_rpc_shell.c +++ b/source3/utils/net_rpc_shell.c @@ -23,6 +23,7 @@ #include "utils/net.h" #include "../librpc/gen_ndr/ndr_samr.h" #include "lib/netapi/netapi.h" +#include "lib/netapi/netapi_net.h" #include "../libcli/smbreadline/smbreadline.h" static NTSTATUS rpc_sh_info(struct net_context *c, @@ -222,7 +223,7 @@ int net_rpc_shell(struct net_context *c, int argc, const char **argv) return -1; } - if (libnetapi_init(&c->netapi_ctx) != 0) { + if (libnetapi_net_init(&c->netapi_ctx) != 0) { return -1; } libnetapi_set_username(c->netapi_ctx, c->opt_user_name); |