From: Neil Brown Date: Fri, 16 Mar 2007 03:23:02 +0000 (+1100) Subject: Use lstat rather than stat in gssd_find_existing_krb5_ccache X-Git-Tag: nfs-utils-1-1-0-rc1~70 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=a4fe85a8e98655aa9be534258074312446d337ab Use lstat rather than stat in gssd_find_existing_krb5_ccache As this is a file in /tmp, a symlink could take us anywhere... If it was a NFS filesystem with a dead server, we could block for a long time.. --- diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c index 096f6cf..6af2869 100644 --- a/utils/gssd/krb5_util.c +++ b/utils/gssd/krb5_util.c @@ -191,7 +191,7 @@ gssd_find_existing_krb5_ccache(uid_t uid, struct dirent **d) namelist[i]->d_name); snprintf(statname, sizeof(statname), "%s/%s", ccachedir, namelist[i]->d_name); - if (stat(statname, &tmp_stat)) { + if (lstat(statname, &tmp_stat)) { printerr(0, "Error doing stat on file '%s'\n", statname); free(namelist[i]);