pullup from trunk
authorTom Yu <tlyu@mit.edu>
Fri, 19 Nov 2004 22:17:18 +0000 (22:17 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 19 Nov 2004 22:17:18 +0000 (22:17 +0000)
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
src/lib/krb5/keytab/kt_file.c

index 75363971bf3913b3c50ad40bcb569643cd10e975..4b62fddb705066ea6e221018cb06d9947be6abe1 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-19  Tom Yu  <tlyu@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * kt_file.c (krb5_ktf_keytab_externalize,
index c6f94f2e773808a7efc56bb2529b22bd0399b1ac..d39fc0b3d1266a5ed7e801cea0501dde7046c19e 100644 (file)
@@ -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));