+2002-08-14 Ken Raeburn <raeburn@mit.edu>
+
+ * cc_stdio.c (krb5_fcc_next_cred): Use a krb5_error_code to hold
+ the return value from krb5_fcc_interpret.
+ (krb5_fcc_get_principal): Initialize return-value variable.
+ (krb5_fcc_initialize): Likewise.
+ (krb5_fcc_interpret): Change retval to a krb5_error_code. Reorder
+ cases for consistency with cc_file.c.
+
2002-08-09 Ken Raeburn <raeburn@mit.edu>
* cc_file.c: All functions except krb5_change_cache and
return kret;
}
-/* end of former stdio/scc_read.c */
#undef CHECK
#define CHECK(ret) if (ret != KRB5_OK) return ret;
return KRB5_OK;
}
+
/*
* Modifies:
* id
krb5_ccache id;
krb5_principal princ;
{
- krb5_error_code kret;
+ krb5_error_code kret = 0;
kret = krb5_fcc_open_file (context, id, FCC_OPEN_AND_ERASE);
if (kret < 0)
fcursor = (krb5_fcc_cursor *) *cursor;
ret = fseek(((krb5_fcc_data *) id->data)->file, fcursor->pos, 0);
if (ret < 0) {
- ret = krb5_fcc_interpret(context, errno);
- MAYBE_CLOSE (context, id, ret);
- return ret;
+ kret = krb5_fcc_interpret(context, errno);
+ MAYBE_CLOSE (context, id, kret);
+ return kret;
}
kret = krb5_fcc_read_principal(context, id, &creds->client);
cursor = (krb5_cc_cursor *) fcursor;
lose:
- if (kret != KRB5_OK) {
+ if (kret != KRB5_OK)
krb5_free_cred_contents(context, creds);
- }
MAYBE_CLOSE (context, id, kret);
return kret;
}
krb5_ccache id;
krb5_cc_cursor *cursor;
{
-/* MAYBE_CLOSE (context, id, ret); */
-
+/*
+ MAYBE_CLOSE (context, id, kret); */
krb5_xfree((krb5_fcc_cursor *) *cursor);
return 0;
krb5_ccache id;
krb5_principal *princ;
{
- krb5_error_code kret;
+ krb5_error_code kret = KRB5_OK;
MAYBE_OPEN (context, id, FCC_OPEN_RDONLY);
kret = krb5_fcc_skip_header(context, id);
if (kret) goto done;
-
kret = krb5_fcc_read_principal(context, id, princ);
done:
mcreds, creds);
}
+
/*
* Modifies:
* the file cache
MAYBE_OPEN (context, id, FCC_OPEN_RDWR);
ret = fseek(((krb5_fcc_data *) id->data)->file, 0, 2);
- if (ret < 0)
+ if (ret < 0) {
return krb5_fcc_interpret(context, errno);
+ }
ret = krb5_fcc_store_principal(context, id, creds->client);
TCHECK(ret);
TCHECK(ret);
lose:
-
MAYBE_CLOSE (context, id, ret);
return ret;
#undef TCHECK
}
+
/*
* Requires:
* id is a cred cache returned by krb5_fcc_resolve or
krb5_context context;
int errnum;
{
- register int retval;
+ register krb5_error_code retval;
switch (errnum) {
-#ifdef ELOOP
- case ELOOP: /* Bad symlink is like no file. */
-#endif
case ENOENT:
retval = KRB5_FCC_NOFILE;
break;
case EISDIR: /* Mac doesn't have EISDIR */
#endif
case ENOTDIR:
+#ifdef ELOOP
+ case ELOOP: /* Bad symlink is like no file. */
+#endif
#ifdef ETXTBSY
case ETXTBSY:
#endif