From 235119c23f20bdfb29654f2e39ddf5fee407abf0 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 10 Sep 2013 21:51:30 -0400 Subject: [PATCH] fcc_open: disable checks on Windows st_dev and st_ino are not set in a consistent fashion by stat() and fstat() so disable the symlink test. disable the open group/other readable test because st_mode cannot be used to perform such a test on Windows. Change-Id: I1b68c672f882018def7e6d40d4bc7f7add58df36 --- lib/krb5/fcache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/krb5/fcache.c b/lib/krb5/fcache.c index 2af26dcfa..593dbc687 100644 --- a/lib/krb5/fcache.c +++ b/lib/krb5/fcache.c @@ -441,11 +441,14 @@ fcc_open(krb5_context context, return EPERM; } +#ifndef _WIN32 if (sb1.st_dev != sb2.st_dev || sb1.st_ino != sb2.st_ino) { krb5_set_error_message(context, EPERM, N_("Refuses to open symlinks for caches FILE:%s", ""), filename); close(fd); return EPERM; } +#endif + if (sb2.st_nlink != 1) { krb5_set_error_message(context, EPERM, N_("Refuses to open hardlinks for caches FILE:%s", ""), filename); close(fd); @@ -457,14 +460,13 @@ fcc_open(krb5_context context, close(fd); return EPERM; } -#endif if ((sb2.st_mode & 077) != 0) { krb5_set_error_message(context, EPERM, N_("Refuses to open group/other readable files FILE:%s", ""), filename); close(fd); return EPERM; } - +#endif } if((ret = fcc_lock(context, id, fd, exclusive)) != 0) {