diff options
author | Simo Sorce <simo@redhat.com> | 2012-01-25 16:31:58 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-01-25 16:55:08 -0500 |
commit | 1f70f9d1361665fcd6b4fc01e23c2544b281421a (patch) | |
tree | 9461fd03227f7041180d64573513362a8416f6ec /proxy/src/gp_conv.c | |
parent | b57763f33402edd9f6980afd02e2e1dd82fdebd2 (diff) | |
download | gss-proxy-1f70f9d1361665fcd6b4fc01e23c2544b281421a.tar.gz gss-proxy-1f70f9d1361665fcd6b4fc01e23c2544b281421a.tar.xz gss-proxy-1f70f9d1361665fcd6b4fc01e23c2544b281421a.zip |
Add helper to return status from rpc functions
Diffstat (limited to 'proxy/src/gp_conv.c')
-rw-r--r-- | proxy/src/gp_conv.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c index 18d7e78..6354c80 100644 --- a/proxy/src/gp_conv.c +++ b/proxy/src/gp_conv.c @@ -333,3 +333,39 @@ done: return ret; } +int gp_conv_status_to_gssx(struct gssx_call_ctx *call_ctx, + uint32_t ret_maj, uint32_t ret_min, + gss_OID mech, struct gssx_status *status) +{ + int ret; + + status->major_status = ret_maj; + + ret = gp_conv_oid_to_gssx(mech, &status->mech); + if (ret) { + goto done; + } + + status->minor_status = ret_min; + + if (ret_maj) { + ret = gp_conv_err_to_gssx_string(ret_maj, GSS_C_GSS_CODE, mech, + &status->major_status_string); + if (ret) { + goto done; + } + } + + if (ret_min) { + ret = gp_conv_err_to_gssx_string(ret_min, GSS_C_MECH_CODE, mech, + &status->minor_status_string); + if (ret) { + goto done; + } + } + + ret = 0; + +done: + return ret; +} |