summaryrefslogtreecommitdiffstats
path: root/utils/gssd/krb5_util.c
diff options
context:
space:
mode:
authorneilbrown <neilbrown>2006-03-28 00:50:03 +0000
committerneilbrown <neilbrown>2006-03-28 00:50:03 +0000
commita6037e23a8c9d649bf5946ac9d23114f9097b997 (patch)
tree4218d93c289ba80c5fd6f1993825910272331ca7 /utils/gssd/krb5_util.c
parent804a7ea8bffb1b26a0e8632eb8fb61ef30cdbf68 (diff)
downloadnfs-utils-a6037e23a8c9d649bf5946ac9d23114f9097b997.tar.gz
nfs-utils-a6037e23a8c9d649bf5946ac9d23114f9097b997.tar.xz
nfs-utils-a6037e23a8c9d649bf5946ac9d23114f9097b997.zip
Add option to specify directory to search for credentials cache files
From: Vince Busam <vbusam@google.com> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Add command line option to specify which directory should be searched to find credentials caches. (really this time)
Diffstat (limited to 'utils/gssd/krb5_util.c')
-rw-r--r--utils/gssd/krb5_util.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
index 5f3e490..3030c3f 100644
--- a/utils/gssd/krb5_util.c
+++ b/utils/gssd/krb5_util.c
@@ -158,7 +158,7 @@ select_krb5_ccache(const struct dirent *d)
}
/*
- * Look in the GSSD_DEFAULT_CRED_DIR for files that look like they
+ * Look in the ccachedir for files that look like they
* are Kerberos Credential Cache files for a given UID. Return
* non-zero and the dirent pointer for the entry most likely to be
* what we want. Otherwise, return zero and no dirent pointer.
@@ -179,7 +179,7 @@ gssd_find_existing_krb5_ccache(uid_t uid, struct dirent **d)
struct stat best_match_stat, tmp_stat;
*d = NULL;
- n = scandir(GSSD_DEFAULT_CRED_DIR, &namelist, select_krb5_ccache, 0);
+ n = scandir(ccachedir, &namelist, select_krb5_ccache, 0);
if (n < 0) {
perror("scandir looking for krb5 credentials caches");
}
@@ -195,7 +195,7 @@ gssd_find_existing_krb5_ccache(uid_t uid, struct dirent **d)
if (strstr(namelist[i]->d_name, substring) ||
!strcmp(namelist[i]->d_name, fullstring)) {
snprintf(statname, sizeof(statname),
- "%s/%s", GSSD_DEFAULT_CRED_DIR,
+ "%s/%s", ccachedir,
namelist[i]->d_name);
if (stat(statname, &tmp_stat)) {
printerr(0, "Error doing stat "
@@ -626,13 +626,12 @@ gssd_setup_krb5_user_gss_ccache(uid_t uid, char *servername)
memset(buf, 0, sizeof(buf));
if (gssd_find_existing_krb5_ccache(uid, &d)) {
snprintf(buf, sizeof(buf), "FILE:%s/%s",
- GSSD_DEFAULT_CRED_DIR, d->d_name);
+ ccachedir, d->d_name);
free(d);
}
else
snprintf(buf, sizeof(buf), "FILE:%s/%s%u",
- GSSD_DEFAULT_CRED_DIR,
- GSSD_DEFAULT_CRED_PREFIX, uid);
+ ccachedir, GSSD_DEFAULT_CRED_PREFIX, uid);
printerr(2, "using %s as credentials cache for client with "
"uid %u for server %s\n", buf, uid, servername);
gssd_set_krb5_ccache_name(buf);