]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/krb5_util.c
Allow gssd ccaches in MEMORY: rather than FILE:
[nfs-utils.git] / utils / gssd / krb5_util.c
index e46715baf32594924fe4f4242154b241ef6ceaab..c43eb36254e33a766c0f5897c99fffc43fdbd1a0 100644 (file)
@@ -334,6 +334,7 @@ gssd_get_single_krb5_cred(krb5_context context,
        char cc_name[BUFSIZ];
        int code;
        time_t now = time(0);
        char cc_name[BUFSIZ];
        int code;
        time_t now = time(0);
+       char *cache_type;
 
        memset(&my_creds, 0, sizeof(my_creds));
 
 
        memset(&my_creds, 0, sizeof(my_creds));
 
@@ -380,7 +381,12 @@ gssd_get_single_krb5_cred(krb5_context context,
         * Initialize cache file which we're going to be using
         */
 
         * 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;
                GSSD_DEFAULT_CRED_DIR, GSSD_DEFAULT_CRED_PREFIX,
                GSSD_DEFAULT_MACHINE_CRED_SUFFIX, ple->realm);
        ple->endtime = my_creds.times.endtime;