#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
return KRB5_NOMEM;
}
+ ((krb5_fcc_data *) lid->data)->flags = 0;
+
/* Set up the filename */
strcpy(((krb5_fcc_data *) lid->data)->filename, scratch);
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;
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,
};
return KRB5_NOMEM;
}
+ ((krb5_fcc_data *) lid->data)->flags = 0;
+
/* Set up the filename */
strcpy(((krb5_fcc_data *) lid->data)->filename, residual);
* 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;
}