bjaspan: use krb5_err.h, finishing up to go skiing
authorBarry Jaspan <bjaspan@mit.edu>
Tue, 30 Jan 1990 18:01:51 +0000 (18:01 +0000)
committerBarry Jaspan <bjaspan@mit.edu>
Tue, 30 Jan 1990 18:01:51 +0000 (18:01 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@209 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/file/fcc.h
src/lib/krb5/ccache/file/fcc_gennew.c
src/lib/krb5/ccache/file/fcc_nseq.c
src/lib/krb5/ccache/file/fcc_ops.c
src/lib/krb5/ccache/file/fcc_reslv.c
src/lib/krb5/ccache/file/fcc_sflags.c

index cbfb8e77f46ffdc78b23900445799727b8976c5b..f8a2303ea6be56fb9a07350e409fed8f7525c6ee 100644 (file)
 #define __KRB5_FILE_CCACHE__
 
 #include <krb5/krb5.h>
+#include <krb5/krb5_err.h>
 #include "fcc-proto.h"
 #include "fcc-os.h"
 
-/* XXX Until I find out the right #define for this.. XXX */
-#define KRB5_OK -1000
-#define KRB5_NOMEM -1001
-#define KRB5_NOTFOUND -1002
-#define KRB5_EOF -1003
+/* XXX  A hack because I don't feel like updating every file. */
+#define KRB5_OK 0
+#define KRB5_NOMEM ENOMEM
+#define KRB5_NOTFOUND KRB5_CC_NOTFOUND
+#define KRB5_EOF KRB5_CC_END
 #define KRB5_FCC_MAXLEN 100
 
 #ifndef TKT_ROOT
index 2776a7421f6be2b3c6068d83e9bf82ac18e4711f..ecba20bcd6ebce13c238fdba906b2aa3721a6041 100644 (file)
@@ -65,6 +65,8 @@ krb5_fcc_generate_new (id)
          return KRB5_NOMEM;
      }
 
+     ((krb5_fcc_data *) lid->data)->flags = 0;
+     
      /* Set up the filename */
      strcpy(((krb5_fcc_data *) lid->data)->filename, scratch);
 
index ef1a7817c38ac6f585ea52a3f31e9ba510d59ecc..4ed792d4dcfcfb28db0779f7fc1f942d975253b5 100644 (file)
@@ -84,9 +84,9 @@ krb5_fcc_next_cred(id, cursor, creds)
      fcursor->pos = tell(((krb5_fcc_data *) id->data)->fd);
      cursor = (krb5_cc_cursor *) fcursor;
 
-#ifdef OPENCLOSE
-     close(((krb5_fcc_data *) id->data)->fd);
-#endif
+     if (OPENCLOSE(id))
+         close(((krb5_fcc_data *) id->data)->fd);
+
 lose:
      
      return kret;
index 71091c3238a81390a7969897cd4505871aab6af1..ac125436b202caa0c42fc00ba30bbe834724aeff 100644 (file)
@@ -33,7 +33,7 @@ krb5_cc_ops krb5_fcc_ops = {
      krb5_fcc_next_cred,
      krb5_fcc_end_seq_get,
      NULL, /* XXX krb5_fcc_remove, */
-     NULL, /* XXX What is the set_flags field? */
+     krb5_fcc_set_flags,
 };
 
 
index a0f83c67663132cf4f7b083d97df15404384965b..2aa0a4f38097822fa2ec4b6b1444c1cfd38f3b7e 100644 (file)
@@ -68,6 +68,8 @@ krb5_fcc_resolve (id, residual)
          return KRB5_NOMEM;
      }
 
+     ((krb5_fcc_data *) lid->data)->flags = 0;
+     
      /* Set up the filename */
      strcpy(((krb5_fcc_data *) lid->data)->filename, residual);
 
index aaff8faa60629f8aa8a937565c1c703c5833e66c..3fea711c99316d20d0a558fb686415748b9bb22a 100644 (file)
@@ -30,12 +30,12 @@ static char fcc_set_flags_c[] = "$Id$";
  * Sets the operational flags of id to flags.
  */
 krb5_error_code
-krb5_fcc_set_flags(id, flags);
+krb5_fcc_set_flags(id, flags)
    krb5_ccache id;
    krb5_flags flags;
 {
      /* XXX This should check for illegal combinations, if any.. */
-     ((krb5_fcc_data *) lid->data)->flags = flags;
+     ((krb5_fcc_data *) id->data)->flags = flags;
      return KRB5_OK;
 }