From c2ff6c94f2f9ddc2c4b03f7907f7d6e0de951c24 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 18 Jan 2008 01:56:01 +0100 Subject: Improve libnetapi_set_error_string(). Guenther (This used to be commit 96f645553ae5c75aabfe588e1a67f3d4bfacb5cb) --- source3/lib/netapi/netapi.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/lib/netapi/netapi.c') diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index ce00054e6e..5c3f7ec465 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -205,15 +205,20 @@ const char *libnetapi_errstr(NET_API_STATUS status) ****************************************************************/ NET_API_STATUS libnetapi_set_error_string(struct libnetapi_ctx *ctx, - const char *error_string) + const char *format, ...) { + va_list args; + TALLOC_FREE(ctx->error_string); - ctx->error_string = talloc_strdup(ctx, error_string); + + va_start(args, format); + ctx->error_string = talloc_vasprintf(ctx, format, args); + va_end(args); + if (!ctx->error_string) { return W_ERROR_V(WERR_NOMEM); } return NET_API_STATUS_SUCCESS; - } /**************************************************************** -- cgit From a30361ede36af7ef9d8f6d723798a07b360c813b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 25 Jan 2008 15:45:38 +0100 Subject: No need to close registry on libnetapi_free() anymore. Guenther (This used to be commit 6bf75652ef07f5a534cef5034b7aad4fdcbcd265) --- source3/lib/netapi/netapi.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/lib/netapi/netapi.c') diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index 5c3f7ec465..47b3ba93cf 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -119,7 +119,6 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx) gencache_shutdown(); secrets_shutdown(); - regdb_close(); TALLOC_FREE(ctx); TALLOC_FREE(frame); -- cgit From 77a25318105d90ae34a05c8a1e71df84343bb28e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Feb 2008 17:09:47 +0100 Subject: Only set DEBUGLEVEL to 0 in libnetapi when not set already. Guenther (This used to be commit 3ace1601ac5b5d87d6bfd8aa0afe0c75858b6990) --- source3/lib/netapi/netapi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/lib/netapi/netapi.c') diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index 47b3ba93cf..fb091f6e0b 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -50,7 +50,9 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context) return W_ERROR_V(WERR_NOMEM); } - DEBUGLEVEL = 0; + if (!DEBUGLEVEL) { + DEBUGLEVEL = 0; + } setup_logging("libnetapi", true); dbf = x_stderr; -- cgit