diff options
author | Jeff Layton <jlayton@redhat.com> | 2014-04-30 12:09:14 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-04-30 12:19:11 -0400 |
commit | 4367cacd3c9f52cd7db6c3d0a51e14fb0adef7a4 (patch) | |
tree | b4eac956eea3e953333e576cb4c327b6b93f9196 | |
parent | 7d809fd2b61bc723d1b8092db60ab3083a72c87e (diff) | |
download | nfs-utils-4367cacd3c9f52cd7db6c3d0a51e14fb0adef7a4.tar.gz nfs-utils-4367cacd3c9f52cd7db6c3d0a51e14fb0adef7a4.tar.xz nfs-utils-4367cacd3c9f52cd7db6c3d0a51e14fb0adef7a4.zip |
gssd: add new routine for generating a hostbased principal in a gss_buffer_t
We'll need a gss_buffer_t to pass to the downcall marshalling code.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/gssd/gss_names.c | 15 | ||||
-rw-r--r-- | utils/gssd/gss_names.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/utils/gssd/gss_names.c b/utils/gssd/gss_names.c index aa61e4d..047069d 100644 --- a/utils/gssd/gss_names.c +++ b/utils/gssd/gss_names.c @@ -121,3 +121,18 @@ out_rel_buf: out_err: return res; } + +void +get_hostbased_client_buffer(gss_name_t client_name, gss_OID mech, + gss_buffer_t buf) +{ + char *hname; + + if (!get_hostbased_client_name(client_name, mech, &hname)) { + buf->length = strlen(hname) + 1; + buf->value = hname; + } else { + buf->length = 0; + buf->value = NULL; + } +} diff --git a/utils/gssd/gss_names.h b/utils/gssd/gss_names.h index 1d5f49c..ce182f7 100644 --- a/utils/gssd/gss_names.h +++ b/utils/gssd/gss_names.h @@ -32,3 +32,5 @@ extern int get_hostbased_client_name(gss_name_t client_name, gss_OID mech, char **hostbased_name); +extern void get_hostbased_client_buffer(gss_name_t client_name, + gss_OID mech, gss_buffer_t buf); |