1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

s3-libnetapi: add libnetapi_set_logfile()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
Günther Deschner
2021-02-15 17:33:46 +01:00
parent 927390bae5
commit 1c62cac7f2
3 changed files with 28 additions and 0 deletions

View File

@ -218,6 +218,25 @@ NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
/****************************************************************
****************************************************************/
NET_API_STATUS libnetapi_set_logfile(struct libnetapi_ctx *ctx,
const char *logfile)
{
TALLOC_CTX *frame = talloc_stackframe();
ctx->logfile = talloc_strdup(ctx, logfile);
if (!lp_set_cmdline("log file", logfile)) {
TALLOC_FREE(frame);
return W_ERROR_V(WERR_GEN_FAILURE);
}
debug_set_logfile(logfile);
setup_logging("libnetapi", DEBUG_FILE);
TALLOC_FREE(frame);
return NET_API_STATUS_SUCCESS;
}
/****************************************************************
****************************************************************/
NET_API_STATUS libnetapi_get_debuglevel(struct libnetapi_ctx *ctx,
char **debuglevel)
{