Save a detailed message for FCC_NOFILE including the file name
authorKen Raeburn <raeburn@mit.edu>
Wed, 4 Jul 2007 01:49:17 +0000 (01:49 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 4 Jul 2007 01:49:17 +0000 (01:49 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19663 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/cc_file.c

index 28583233179a45d732185c300ee76885473cc367..fc9094b6e86724db99ad01ce52f1c05f81dfd4a1 100644 (file)
@@ -1240,8 +1240,19 @@ krb5_fcc_open_file (krb5_context context, krb5_ccache id, int mode)
     }
 
     f = THREEPARAMOPEN (data->filename, open_flag | O_BINARY, 0600);
-    if (f == NO_FILE)
-       return krb5_fcc_interpret (context, errno);
+    if (f == NO_FILE) {
+       switch (errno) {
+       case ENOENT:
+           retval = KRB5_FCC_NOFILE;
+           fprintf(stderr, "stuffing error message in context %p\n", context);
+           krb5_set_error_message(context, retval,
+                                  "Credentials cache file '%s' not found",
+                                  data->filename);
+           return retval;
+       default:
+           return krb5_fcc_interpret (context, errno);
+       }
+    }
 
     data->mode = mode;