Created
November 25, 2021 07:01
-
-
Save mikhailnov/8d40caedc71d12f6e9c081548fc42b74 to your computer and use it in GitHub Desktop.
Check if libkrb5 understands a realm
This file contains hidden or 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
// gcc -g realm.c -o realm -lkrb5 | |
// HOST=XXX.LOC ./realm | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <krb5/krb5.h> | |
int main(){ | |
// nfs-utils/utils/gssd/krb5_util.c, find_keytab_entry() | |
krb5_error_code test; | |
krb5_context context; | |
krb5_init_context(&context); | |
char **realmnames = NULL; | |
const char *host = getenv("HOST"); | |
test = krb5_get_host_realm(context, host, &realmnames); | |
printf("%s\n", realmnames[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment