summaryrefslogtreecommitdiffstats
path: root/source3/lib/netapi/netapi.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-10-29 15:06:36 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-11-02 04:36:04 +0000
commitcf4de8ec2c8df2ceabbe3d836d296b058e7b19fb (patch)
tree9afa59acaf2a8665e9bc9dfc8bdc177db4a7ca36 /source3/lib/netapi/netapi.c
parent9da4ace1d9789d300ab298bc34694c44b2062f30 (diff)
downloadsamba-cf4de8ec2c8df2ceabbe3d836d296b058e7b19fb.tar.gz
samba-cf4de8ec2c8df2ceabbe3d836d296b058e7b19fb.tar.xz
samba-cf4de8ec2c8df2ceabbe3d836d296b058e7b19fb.zip
s3-debug Remove 'AllowDebugChange' and use lp_set_cmdline() instead
By removing this global variable, the API between the two different debug systems is made more similar. Both s3 and s4 now have lp_set_cmdline() which ensures that the smb.conf cannot overwrite these the user-specified log level. Andrew Bartlett
Diffstat (limited to 'source3/lib/netapi/netapi.c')
-rw-r--r--source3/lib/netapi/netapi.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c
index 30042467430..7b3ab321aff 100644
--- a/source3/lib/netapi/netapi.c
+++ b/source3/lib/netapi/netapi.c
@@ -23,8 +23,6 @@
#include "secrets.h"
#include "krb5_env.h"
-extern bool AllowDebugChange;
-
struct libnetapi_ctx *stat_ctx = NULL;
TALLOC_CTX *frame = NULL;
static bool libnetapi_initialized = false;
@@ -75,15 +73,11 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
return W_ERROR_V(WERR_NOMEM);
}
- if (!DEBUGLEVEL) {
- DEBUGLEVEL = 0;
- }
+ lp_set_cmdline("log level", "0");
/* prevent setup_logging() from closing x_stderr... */
setup_logging("libnetapi", DEBUG_STDERR);
- AllowDebugChange = false;
-
load_case_tables();
if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, false)) {
@@ -92,8 +86,6 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
return W_ERROR_V(WERR_GENERAL_FAILURE);
}
- AllowDebugChange = true;
-
init_names();
load_interfaces();
reopen_logs();
@@ -185,9 +177,8 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
const char *debuglevel)
{
- AllowDebugChange = true;
ctx->debuglevel = talloc_strdup(ctx, debuglevel);
- if (!debug_parse_levels(debuglevel)) {
+ if (!lp_set_cmdline("log level", debuglevel)) {
return W_ERROR_V(WERR_GENERAL_FAILURE);
}
return NET_API_STATUS_SUCCESS;