diff options
author | Gerald (Jerry) Carter <jerry@samba.org> | 2008-01-14 09:49:47 -0600 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2008-01-14 09:49:47 -0600 |
commit | 582bd8071f168190e0cf1f6d1637f79ebee287c3 (patch) | |
tree | d10d1f8ebab5bdd0d6644f6fbf98d7a825ce6f84 /source3/lib/netapi/netapi.c | |
parent | 84f12a59600bc3f686959d0e17cf972319059e02 (diff) | |
parent | 351377a90e44d8011a697779d2e9e225427e5cbb (diff) | |
download | samba-582bd8071f168190e0cf1f6d1637f79ebee287c3.tar.gz samba-582bd8071f168190e0cf1f6d1637f79ebee287c3.tar.bz2 samba-582bd8071f168190e0cf1f6d1637f79ebee287c3.zip |
Merge commit 'samba/v3-2-test' into v3-2-stable
(This used to be commit 6811ea1ce2d46f7303b4edf661e27d2edf54724f)
Diffstat (limited to 'source3/lib/netapi/netapi.c')
-rw-r--r-- | source3/lib/netapi/netapi.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source3/lib/netapi/netapi.c b/source3/lib/netapi/netapi.c index d4cb3a9fe2..ce00054e6e 100644 --- a/source3/lib/netapi/netapi.c +++ b/source3/lib/netapi/netapi.c @@ -192,8 +192,7 @@ NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx, /**************************************************************** ****************************************************************/ -const char *libnetapi_errstr(struct libnetapi_ctx *ctx, - NET_API_STATUS status) +const char *libnetapi_errstr(NET_API_STATUS status) { if (status & 0xc0000000) { return get_friendly_nt_error_msg(NT_STATUS(status)); @@ -220,9 +219,23 @@ NET_API_STATUS libnetapi_set_error_string(struct libnetapi_ctx *ctx, /**************************************************************** ****************************************************************/ -const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx) +const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx, + NET_API_STATUS status) { - return ctx->error_string; + struct libnetapi_ctx *tmp_ctx = ctx; + + if (!tmp_ctx) { + status = libnetapi_getctx(&tmp_ctx); + if (status != 0) { + return NULL; + } + } + + if (tmp_ctx->error_string) { + return tmp_ctx->error_string; + } + + return libnetapi_errstr(status); } /**************************************************************** |