1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

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
This commit is contained in:
Andrew Bartlett
2011-05-10 22:08:36 +02:00
parent 5db0cd55d4
commit a37de9a959
2 changed files with 37 additions and 16 deletions

View File

@ -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