From: Doug Nazar Date: Mon, 19 Jul 2010 15:08:46 +0000 (-0400) Subject: gssd: picking wrong creds X-Git-Tag: nfs-utils-1-2-3-rc5~24 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=12af21aca517dfbaec465447d8336bcc4769f71d gssd: picking wrong creds When not using machine credentials for root, if the machine credential cache file is newer than the root credential file the wrong file will get picked. Ignore the machine file in this case. Signed-off-by: Steve Dickson --- diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index dccbeb6..d23654f 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -224,6 +224,13 @@ gssd_find_existing_krb5_ccache(uid_t uid, char *dirname, struct dirent **d) free(namelist[i]); continue; } + if (uid == 0 && !root_uses_machine_creds && + strstr(namelist[i]->d_name, "_machine_")) { + printerr(3, "CC file '%s' not available to root\n", + statname); + free(namelist[i]); + continue; + } if (!query_krb5_ccache(buf, &princname, &realm)) { printerr(3, "CC file '%s' is expired or corrupt\n", statname);