From a37de9a95974c138d264d9cb0c7829bb426bb2d6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 10 May 2011 22:08:36 +0200 Subject: s3-libnetapi Don't create a talloc_stackframe() in a global variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also ensures that libnetapi_free() invalidates the global stat_ctx variable, and changes the API so that the behaviour of the error string routines is to consistently return a allocated string. Pair-Programmed-With: Günther Deschner Andrew Bartlett --- source3/lib/netapi/netapi.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/lib/netapi/netapi.h') diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index 9e1549df0e..620d8cf591 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -1411,15 +1411,18 @@ NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx); NET_API_STATUS libnetapi_set_use_ccache(struct libnetapi_ctx *ctx); /**************************************************************** +Return a specific libnetapi error as a string, caller must free with NetApiBufferFree ****************************************************************/ -const char *libnetapi_errstr(NET_API_STATUS status); +char *libnetapi_errstr(NET_API_STATUS status); /**************************************************************** +Return the last libnetapi error as a string, caller must free with NetApiBufferFree +ctx is optional ****************************************************************/ -const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx, - NET_API_STATUS status); +char *libnetapi_get_error_string(struct libnetapi_ctx *ctx, + NET_API_STATUS status); /**************************************************************** NetApiBufferAllocate -- cgit