diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-05-10 22:08:36 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-05-13 18:50:23 +0200 |
commit | a37de9a95974c138d264d9cb0c7829bb426bb2d6 (patch) | |
tree | 50d0a69eeac2de49cc193d094376ddf259f0d897 /source3/lib/netapi/netapi.h | |
parent | 5db0cd55d4db9cc71f32dc0097e2f014c22967bc (diff) | |
download | samba-a37de9a95974c138d264d9cb0c7829bb426bb2d6.tar.gz samba-a37de9a95974c138d264d9cb0c7829bb426bb2d6.tar.bz2 samba-a37de9a95974c138d264d9cb0c7829bb426bb2d6.zip |
s3-libnetapi Don't create a talloc_stackframe() in a global variable
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 <gd@samba.org>
Andrew Bartlett
Diffstat (limited to 'source3/lib/netapi/netapi.h')
-rw-r--r-- | source3/lib/netapi/netapi.h | 9 |
1 files changed, 6 insertions, 3 deletions
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 |