X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fgssd%2Fkrb5_util.c;h=c43eb36254e33a766c0f5897c99fffc43fdbd1a0;hp=2f5e70ed2d78371e18b68ee744925866ad68126a;hb=6e18539119224c930760ab801c24efe92b809a1e;hpb=0f899e6d862994ffb437ae73e087c4a21ab59723 diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 2f5e70e..c43eb36 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -178,6 +178,7 @@ gssd_find_existing_krb5_ccache(uid_t uid, struct dirent **d) struct dirent *best_match_dir = NULL; struct stat best_match_stat, tmp_stat; + memset(&best_match_stat, 0, sizeof(best_match_stat)); *d = NULL; n = scandir(ccachedir, &namelist, select_krb5_ccache, 0); if (n < 0) { @@ -333,6 +334,7 @@ gssd_get_single_krb5_cred(krb5_context context, char cc_name[BUFSIZ]; int code; time_t now = time(0); + char *cache_type; memset(&my_creds, 0, sizeof(my_creds)); @@ -379,7 +381,12 @@ gssd_get_single_krb5_cred(krb5_context context, * Initialize cache file which we're going to be using */ - snprintf(cc_name, sizeof(cc_name), "FILE:%s/%s%s_%s", + if (use_memcache) + cache_type = "MEMORY"; + else + cache_type = "FILE"; + snprintf(cc_name, sizeof(cc_name), "%s:%s/%s%s_%s", + cache_type, GSSD_DEFAULT_CRED_DIR, GSSD_DEFAULT_CRED_PREFIX, GSSD_DEFAULT_MACHINE_CRED_SUFFIX, ple->realm); ple->endtime = my_creds.times.endtime;