From 72e6a0f383dd5e1e00f8d8b590885ba25740035a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 12 Jul 2013 18:19:49 -0400 Subject: [PATCH] fcache: correct build errors on Windows Windows does not have getuid(). Change-Id: Ib92785716b056a69e42c32ec122d8a5f6f12ffbe Signed-off-by: Love Hornquist Astrand --- lib/krb5/fcache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/krb5/fcache.c b/lib/krb5/fcache.c index fb4c51357..2af26dcfa 100644 --- a/lib/krb5/fcache.c +++ b/lib/krb5/fcache.c @@ -395,7 +395,7 @@ fcc_open(krb5_context context, krb5_error_code ret; const char *filename; struct stat sb1, sb2; - int strict_checking;; + int strict_checking; int fd; if (FCACHE(id) == NULL) @@ -451,11 +451,13 @@ fcc_open(krb5_context context, close(fd); return EPERM; } +#ifndef _WIN32 if (sb2.st_uid != getuid()) { krb5_set_error_message(context, EPERM, N_("Refuses to open cache files not own by myself FILE:%s (owned by %d)", ""), filename, (int)sb2.st_uid); 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);