diff options
Diffstat (limited to 'source3/lib/netapi/netapi.c')
-rw-r--r-- | source3/lib/netapi/netapi.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index 38b44c769d..454d766ae9 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -42,20 +42,21 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context) } DEBUGLEVEL = 0; - DEBUGLEVEL_CLASS[DBGC_ALL] = 0; + setup_logging("libnetapi", true); + dbf = x_stderr; x_setbuf(x_stderr, NULL); AllowDebugChange = false; load_case_tables(); - setup_logging("libnetapi", true); - if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, false)) { TALLOC_FREE(frame); return W_ERROR_V(WERR_GENERAL_FAILURE); } + AllowDebugChange = true; + init_names(); load_interfaces(); reopen_logs(); @@ -75,6 +76,24 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx) return W_ERROR_V(WERR_OK); } +NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx, + const char *debuglevel) +{ + AllowDebugChange = true; + ctx->debuglevel = debuglevel; + if (!debug_parse_levels(debuglevel)) { + return W_ERROR_V(WERR_GENERAL_FAILURE); + } + return W_ERROR_V(WERR_OK); +} + +NET_API_STATUS libnetapi_get_debuglevel(struct libnetapi_ctx *ctx, + const char **debuglevel) +{ + *debuglevel = ctx->debuglevel; + return W_ERROR_V(WERR_OK); +} + NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx, const char *username) { |