Created
December 4, 2013 12:42
-
-
Save rustymyers/7786880 to your computer and use it in GitHub Desktop.
Trying to find out if the current users Kerberos ticket is the same principal as the kserver variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <gssapi.h> | |
#define kserver "dce.psu.edu" | |
//#define | |
#define minor_status | |
OM_uint32 CHECK_CRED(char *name) { | |
OM_uint32 gss_inquire_cred( | |
OM_uint32 * minor_status, | |
const gss_cred_id_t cred_handle, | |
gss_name_t *name, | |
OM_uint32 * lifetime, | |
gss_cred_usage_t * cred_usage, | |
gss_OID_set * mechanisms ); | |
return (*name); | |
} | |
int main() | |
{ | |
char currentstatus; | |
printf( "Principal to check: "kserver "\n" ); | |
printf( "Checking for ticket \n"); | |
currentstatus = CHECK_CRED(kserver); | |
printf( currentstatus "\n" ); | |
printf( "Hit any key to exit.\n" ); | |
getchar(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment