diff options
author | Luke Howard <lukeh@padl.com> | 2011-03-21 01:03:02 +0000 |
---|---|---|
committer | Luke Howard <lukeh@padl.com> | 2011-03-21 01:03:02 +0000 |
commit | 39870db58216429877b06d7918069382204d3c9e (patch) | |
tree | 4a4af5d18d00c348b6fb070303326c9dfee038a4 /src/appl | |
parent | 245009d3aa6c5312336f654ec32957c03bdef966 (diff) | |
download | krb5-39870db58216429877b06d7918069382204d3c9e.zip krb5-39870db58216429877b06d7918069382204d3c9e.tar.gz krb5-39870db58216429877b06d7918069382204d3c9e.tar.bz2 |
add gss_pname_to_uid test to gss-server
git-svn-id: svn://anonsvn.mit.edu/krb5/users/lhoward/moonshot-mechglue-fixes@24735 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl')
-rw-r--r-- | src/appl/gss-sample/gss-server.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/appl/gss-sample/gss-server.c b/src/appl/gss-sample/gss-server.c index e833267..30ae606 100644 --- a/src/appl/gss-sample/gss-server.c +++ b/src/appl/gss-sample/gss-server.c @@ -69,6 +69,8 @@ static OM_uint32 enumerateAttributes(OM_uint32 *minor, gss_name_t name, int noisy); +static OM_uint32 +showLocalIdentity(OM_uint32 *minor, gss_name_t name); static void usage() @@ -267,6 +269,7 @@ server_establish_context(int s, gss_cred_id_t server_creds, return -1; } enumerateAttributes(&min_stat, client, TRUE); + showLocalIdentity(&min_stat, client); maj_stat = gss_release_name(&min_stat, &client); if (maj_stat != GSS_S_COMPLETE) { display_status("releasing name", maj_stat, min_stat); @@ -876,3 +879,19 @@ enumerateAttributes(OM_uint32 *minor, return major; } + +static OM_uint32 +showLocalIdentity(OM_uint32 *minor, gss_name_t name) +{ + OM_uint32 major; + uid_t uid; + + major = gss_pname_to_uid(minor, name, GSS_C_NO_OID, &uid); + if (major == GSS_S_COMPLETE) { + printf("UID: %d\n", uid); + } else if (major != GSS_S_UNAVAILABLE) { + display_status("gss_pname_to_uid", major, *minor); + } + + return major; +} |