From 51f6693ca1a8cc4b254d8e654a7777290811b0cf Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Fri, 19 Nov 2004 22:17:18 +0000 Subject: [PATCH] pullup from trunk ticket: 2760 version_fixed: 1.4 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@16900 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/ChangeLog | 5 +++++ src/lib/krb5/keytab/kt_file.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/krb5/keytab/ChangeLog b/src/lib/krb5/keytab/ChangeLog index 75363971b..4b62fddb7 100644 --- a/src/lib/krb5/keytab/ChangeLog +++ b/src/lib/krb5/keytab/ChangeLog @@ -1,3 +1,8 @@ +2004-11-19 Tom Yu + + * kt_file.c (krb5_ktfileint_open): Patch from Roland Dowdeswell to + return ENFILE when fopen() returns NULL but doesn't set errno. + 2004-06-22 Ken Raeburn * kt_file.c (krb5_ktf_keytab_externalize, diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index c6f94f2e7..d39fc0b3d 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -1008,10 +1008,10 @@ krb5_ktfileint_open(krb5_context context, krb5_keytab id, int mode) krb5_create_secure_file(context, KTFILENAME(id)); KTFILEP(id) = fopen(KTFILENAME(id), fopen_mode_rbplus); if (!KTFILEP(id)) - return errno; + return errno ? errno : ENFILE; writevno = 1; } else /* some other error */ - return errno; + return errno ? errno : ENFILE; } if ((kerror = krb5_lock_file(context, fileno(KTFILEP(id)), mode))) { (void) fclose(KTFILEP(id)); -- 2.26.2