aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5/ccache
diff options
context:
space:
mode:
authorChris Provenzano <proven@mit.edu>1995-01-13 21:21:42 +0000
committerChris Provenzano <proven@mit.edu>1995-01-13 21:21:42 +0000
commit5b169bc85d0ddcf7055e694d07cbb704021e6c3c (patch)
tree6c53ff012a508b74c7decb1dffd72bbe7b2bf022 /src/lib/krb5/ccache
parentf33e326f8f7ea7dde5026482f38083275ab8679c (diff)
downloadkrb5-5b169bc85d0ddcf7055e694d07cbb704021e6c3c.zip
krb5-5b169bc85d0ddcf7055e694d07cbb704021e6c3c.tar.gz
krb5-5b169bc85d0ddcf7055e694d07cbb704021e6c3c.tar.bz2
Removed all references to DECLARG and OLDDECLARG.
Added krb5_context to all krb5_routines. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4810 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/ccache')
-rw-r--r--src/lib/krb5/ccache/ChangeLog4
-rw-r--r--src/lib/krb5/ccache/ccbase.c21
-rw-r--r--src/lib/krb5/ccache/ccdefault.c7
-rw-r--r--src/lib/krb5/ccache/file/ChangeLog4
-rw-r--r--src/lib/krb5/ccache/file/fcc-proto.h130
-rw-r--r--src/lib/krb5/ccache/file/fcc.h12
-rw-r--r--src/lib/krb5/ccache/file/fcc_close.c5
-rw-r--r--src/lib/krb5/ccache/file/fcc_defnam.c3
-rw-r--r--src/lib/krb5/ccache/file/fcc_destry.c15
-rw-r--r--src/lib/krb5/ccache/file/fcc_errs.c3
-rw-r--r--src/lib/krb5/ccache/file/fcc_eseq.c5
-rw-r--r--src/lib/krb5/ccache/file/fcc_gennew.c9
-rw-r--r--src/lib/krb5/ccache/file/fcc_getnam.c3
-rw-r--r--src/lib/krb5/ccache/file/fcc_gprin.c9
-rw-r--r--src/lib/krb5/ccache/file/fcc_init.c13
-rw-r--r--src/lib/krb5/ccache/file/fcc_maybe.c12
-rw-r--r--src/lib/krb5/ccache/file/fcc_nseq.c33
-rw-r--r--src/lib/krb5/ccache/file/fcc_read.c108
-rw-r--r--src/lib/krb5/ccache/file/fcc_reslv.c3
-rw-r--r--src/lib/krb5/ccache/file/fcc_retrv.c37
-rw-r--r--src/lib/krb5/ccache/file/fcc_sflags.c7
-rw-r--r--src/lib/krb5/ccache/file/fcc_skip.c7
-rw-r--r--src/lib/krb5/ccache/file/fcc_sseq.c9
-rw-r--r--src/lib/krb5/ccache/file/fcc_store.c31
-rw-r--r--src/lib/krb5/ccache/file/fcc_test.c16
-rw-r--r--src/lib/krb5/ccache/file/fcc_write.c102
-rw-r--r--src/lib/krb5/ccache/stdio/ChangeLog4
-rw-r--r--src/lib/krb5/ccache/stdio/scc-proto.h200
-rw-r--r--src/lib/krb5/ccache/stdio/scc.h8
-rw-r--r--src/lib/krb5/ccache/stdio/scc_close.c5
-rw-r--r--src/lib/krb5/ccache/stdio/scc_defnam.c3
-rw-r--r--src/lib/krb5/ccache/stdio/scc_destry.c13
-rw-r--r--src/lib/krb5/ccache/stdio/scc_errs.c3
-rw-r--r--src/lib/krb5/ccache/stdio/scc_eseq.c5
-rw-r--r--src/lib/krb5/ccache/stdio/scc_gennew.c9
-rw-r--r--src/lib/krb5/ccache/stdio/scc_getnam.c3
-rw-r--r--src/lib/krb5/ccache/stdio/scc_gprin.c9
-rw-r--r--src/lib/krb5/ccache/stdio/scc_init.c13
-rw-r--r--src/lib/krb5/ccache/stdio/scc_maybe.c30
-rw-r--r--src/lib/krb5/ccache/stdio/scc_nseq.c33
-rw-r--r--src/lib/krb5/ccache/stdio/scc_read.c108
-rw-r--r--src/lib/krb5/ccache/stdio/scc_reslv.c3
-rw-r--r--src/lib/krb5/ccache/stdio/scc_retrv.c27
-rw-r--r--src/lib/krb5/ccache/stdio/scc_sflags.c7
-rw-r--r--src/lib/krb5/ccache/stdio/scc_skip.c7
-rw-r--r--src/lib/krb5/ccache/stdio/scc_sseq.c9
-rw-r--r--src/lib/krb5/ccache/stdio/scc_store.c29
-rw-r--r--src/lib/krb5/ccache/stdio/scc_test.c4
-rw-r--r--src/lib/krb5/ccache/stdio/scc_write.c103
49 files changed, 757 insertions, 486 deletions
diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog
index 0de41cc..0736641 100644
--- a/src/lib/krb5/ccache/ChangeLog
+++ b/src/lib/krb5/ccache/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu)
+
+ * Added krb5_context to all krb5_routines
+
Thu Oct 13 17:23:08 1994 Theodore Y. Ts'o (tytso@maytag)
* configure.in: Add ISODE_DEFS
diff --git a/src/lib/krb5/ccache/ccbase.c b/src/lib/krb5/ccache/ccbase.c
index dfcefbe..c9e295c 100644
--- a/src/lib/krb5/ccache/ccbase.c
+++ b/src/lib/krb5/ccache/ccbase.c
@@ -42,10 +42,10 @@ static struct krb5_cc_typelist *cc_typehead = 0;
*/
krb5_error_code
-krb5_cc_register(DECLARG(krb5_cc_ops *,ops),
- DECLARG(krb5_boolean,override))
-OLDDECLARG(krb5_cc_ops *,ops)
-OLDDECLARG(krb5_boolean,override)
+krb5_cc_register(context, ops, override)
+ krb5_context context;
+ krb5_cc_ops *ops;
+ krb5_boolean override;
{
struct krb5_cc_typelist *t;
for (t = cc_typehead;t && strcmp(t->ops->prefix,ops->prefix);t = t->next)
@@ -75,9 +75,10 @@ OLDDECLARG(krb5_boolean,override)
* particular cache type.
*/
-krb5_error_code krb5_cc_resolve (name, cache)
- char *name;
- krb5_ccache *cache;
+krb5_error_code krb5_cc_resolve (context, name, cache)
+ krb5_context context;
+ char *name;
+ krb5_ccache *cache;
{
struct krb5_cc_typelist *tlist;
char *pfx, *resid, *cp;
@@ -86,7 +87,7 @@ krb5_error_code krb5_cc_resolve (name, cache)
cp = strchr (name, ':');
if (!cp) {
if (krb5_cc_dfl_ops)
- return (*krb5_cc_dfl_ops->resolve)(cache, name);
+ return (*krb5_cc_dfl_ops->resolve)(context, cache, name);
else
return KRB5_CC_BADNAME;
}
@@ -106,12 +107,12 @@ krb5_error_code krb5_cc_resolve (name, cache)
for (tlist = cc_typehead; tlist; tlist = tlist->next) {
if (strcmp (tlist->ops->prefix, pfx) == 0) {
free(pfx);
- return (*tlist->ops->resolve)(cache, resid);
+ return (*tlist->ops->resolve)(context, cache, resid);
}
}
if (krb5_cc_dfl_ops && !strcmp (pfx, krb5_cc_dfl_ops->prefix)) {
free (pfx);
- return (*krb5_cc_dfl_ops->resolve)(cache, resid);
+ return (*krb5_cc_dfl_ops->resolve)(context, cache, resid);
}
free(pfx);
return KRB5_CC_UNKNOWN_TYPE;
diff --git a/src/lib/krb5/ccache/ccdefault.c b/src/lib/krb5/ccache/ccdefault.c
index e1f5f65..3400fa2 100644
--- a/src/lib/krb5/ccache/ccdefault.c
+++ b/src/lib/krb5/ccache/ccdefault.c
@@ -27,8 +27,9 @@
#include <krb5/krb5.h>
-krb5_error_code krb5_cc_default(ccache)
-krb5_ccache *ccache;
+krb5_error_code krb5_cc_default(context, ccache)
+ krb5_context context;
+ krb5_ccache *ccache;
{
- return krb5_cc_resolve(krb5_cc_default_name(), ccache);
+ return krb5_cc_resolve(context, krb5_cc_default_name(context), ccache);
}
diff --git a/src/lib/krb5/ccache/file/ChangeLog b/src/lib/krb5/ccache/file/ChangeLog
index 3234f48..e105df3 100644
--- a/src/lib/krb5/ccache/file/ChangeLog
+++ b/src/lib/krb5/ccache/file/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu)
+
+ * Added krb5_context to all krb5_routines
+
Wed Dec 7 16:58:59 1994 <tytso@rsx-11.mit.edu>
* fcc_write.c (krb5_fcc_store_addrs): If a null addresses is
diff --git a/src/lib/krb5/ccache/file/fcc-proto.h b/src/lib/krb5/ccache/file/fcc-proto.h
index 56d4a1d..e7bee70 100644
--- a/src/lib/krb5/ccache/file/fcc-proto.h
+++ b/src/lib/krb5/ccache/file/fcc-proto.h
@@ -29,85 +29,133 @@
#define KRB5_FCC_PROTO__
/* fcc_close.c */
-krb5_error_code krb5_fcc_close PROTOTYPE((krb5_ccache id ));
+krb5_error_code krb5_fcc_close
+ PROTOTYPE((krb5_context, krb5_ccache id ));
/* fcc_defnam.c */
-char *krb5_fcc_default_name PROTOTYPE((void ));
+char *krb5_fcc_default_name
+ PROTOTYPE((krb5_context));
/* fcc_destry.c */
-krb5_error_code krb5_fcc_destroy PROTOTYPE((krb5_ccache id ));
+krb5_error_code krb5_fcc_destroy
+ PROTOTYPE((krb5_context, krb5_ccache id ));
/* fcc_eseq.c */
-krb5_error_code krb5_fcc_end_seq_get PROTOTYPE((krb5_ccache id , krb5_cc_cursor *cursor ));
+krb5_error_code krb5_fcc_end_seq_get
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_cc_cursor *cursor ));
/* fcc_gennew.c */
-krb5_error_code krb5_fcc_generate_new PROTOTYPE((krb5_ccache *id ));
+krb5_error_code krb5_fcc_generate_new
+ PROTOTYPE((krb5_context, krb5_ccache *id ));
/* fcc_getnam.c */
-char *krb5_fcc_get_name PROTOTYPE((krb5_ccache id ));
+char *krb5_fcc_get_name
+ PROTOTYPE((krb5_context, krb5_ccache id ));
/* fcc_gprin.c */
-krb5_error_code krb5_fcc_get_principal PROTOTYPE((krb5_ccache id , krb5_principal *princ ));
+krb5_error_code krb5_fcc_get_principal
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_principal *princ ));
/* fcc_init.c */
-krb5_error_code krb5_fcc_initialize PROTOTYPE((krb5_ccache id , krb5_principal princ ));
+krb5_error_code krb5_fcc_initialize
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_principal princ ));
/* fcc_nseq.c */
-krb5_error_code krb5_fcc_next_cred PROTOTYPE((krb5_ccache id , krb5_cc_cursor *cursor , krb5_creds *creds ));
+krb5_error_code krb5_fcc_next_cred
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_cc_cursor *cursor ,
+ krb5_creds *creds ));
/* fcc_read.c */
-krb5_error_code krb5_fcc_read_principal PROTOTYPE((krb5_ccache id , krb5_principal *princ ));
-krb5_error_code krb5_fcc_read_keyblock PROTOTYPE((krb5_ccache id , krb5_keyblock *keyblock ));
-krb5_error_code krb5_fcc_read_data PROTOTYPE((krb5_ccache id , krb5_data *data ));
-krb5_error_code krb5_fcc_read_int32 PROTOTYPE((krb5_ccache id , krb5_int32 *i ));
-krb5_error_code krb5_fcc_read_ui_2 PROTOTYPE((krb5_ccache id , krb5_ui_2 *i ));
-krb5_error_code krb5_fcc_read_octet PROTOTYPE((krb5_ccache id , krb5_octet *i ));
-krb5_error_code krb5_fcc_read_times PROTOTYPE((krb5_ccache id , krb5_ticket_times *t ));
-krb5_error_code krb5_fcc_read_addrs PROTOTYPE((krb5_ccache, krb5_address ***));
-krb5_error_code krb5_fcc_read_addr PROTOTYPE((krb5_ccache, krb5_address *));
-krb5_error_code krb5_fcc_read_authdata PROTOTYPE((krb5_ccache , krb5_authdata ***));
-krb5_error_code krb5_fcc_read_authdatum PROTOTYPE((krb5_ccache , krb5_authdata *));
+krb5_error_code krb5_fcc_read_principal
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_principal *princ ));
+krb5_error_code krb5_fcc_read_keyblock
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_keyblock *keyblock ));
+krb5_error_code krb5_fcc_read_data
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_data *data ));
+krb5_error_code krb5_fcc_read_int32
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_int32 *i ));
+krb5_error_code krb5_fcc_read_ui_2
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_ui_2 *i ));
+krb5_error_code krb5_fcc_read_octet
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_octet *i ));
+krb5_error_code krb5_fcc_read_times
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_ticket_times *t ));
+krb5_error_code krb5_fcc_read_addrs
+ PROTOTYPE((krb5_context, krb5_ccache, krb5_address ***));
+krb5_error_code krb5_fcc_read_addr
+ PROTOTYPE((krb5_context, krb5_ccache, krb5_address *));
+krb5_error_code krb5_fcc_read_authdata
+ PROTOTYPE((krb5_context, krb5_ccache , krb5_authdata ***));
+krb5_error_code krb5_fcc_read_authdatum
+ PROTOTYPE((krb5_context, krb5_ccache , krb5_authdata *));
/* fcc_reslv.c */
-krb5_error_code krb5_fcc_resolve PROTOTYPE((krb5_ccache *id , char *residual ));
+krb5_error_code krb5_fcc_resolve
+ PROTOTYPE((krb5_context, krb5_ccache *id , char *residual ));
/* fcc_retrv.c */
-krb5_error_code krb5_fcc_retrieve PROTOTYPE((krb5_ccache id , krb5_flags whichfields , krb5_creds *mcreds , krb5_creds *creds ));
+krb5_error_code krb5_fcc_retrieve
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_flags whichfields ,
+ krb5_creds *mcreds ,
+ krb5_creds *creds ));
/* fcc_sseq.c */
-krb5_error_code krb5_fcc_start_seq_get PROTOTYPE((krb5_ccache id , krb5_cc_cursor *cursor ));
+krb5_error_code krb5_fcc_start_seq_get
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_cc_cursor *cursor ));
/* fcc_store.c */
-krb5_error_code krb5_fcc_store PROTOTYPE((krb5_ccache id , krb5_creds *creds ));
+krb5_error_code krb5_fcc_store
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_creds *creds ));
/* fcc_skip.c */
-krb5_error_code krb5_fcc_skip_principal PROTOTYPE((krb5_ccache id ));
+krb5_error_code krb5_fcc_skip_principal
+ PROTOTYPE((krb5_context, krb5_ccache id ));
/* fcc_sflags.c */
-krb5_error_code krb5_fcc_set_flags PROTOTYPE((krb5_ccache id , krb5_flags flags ));
+krb5_error_code krb5_fcc_set_flags
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_flags flags ));
/* fcc_ops.c */
extern krb5_cc_ops krb5_cc_file_ops;
/* fcc_write.c */
-krb5_error_code krb5_fcc_write PROTOTYPE((krb5_ccache id , krb5_pointer buf , int len ));
-krb5_error_code krb5_fcc_store_principal PROTOTYPE((krb5_ccache id , krb5_principal princ ));
-krb5_error_code krb5_fcc_store_keyblock PROTOTYPE((krb5_ccache id , krb5_keyblock *keyblock ));
-krb5_error_code krb5_fcc_store_data PROTOTYPE((krb5_ccache id , krb5_data *data ));
-krb5_error_code krb5_fcc_store_int32 PROTOTYPE((krb5_ccache id , krb5_int32 i ));
-krb5_error_code krb5_fcc_store_ui_2 PROTOTYPE((krb5_ccache id , krb5_int32 i ));
-krb5_error_code krb5_fcc_store_octet PROTOTYPE((krb5_ccache id , krb5_int32 i ));
-krb5_error_code krb5_fcc_store_times PROTOTYPE((krb5_ccache id , krb5_ticket_times *t ));
-krb5_error_code krb5_fcc_store_addrs PROTOTYPE((krb5_ccache , krb5_address ** ));
-krb5_error_code krb5_fcc_store_addr PROTOTYPE((krb5_ccache , krb5_address * ));
-krb5_error_code krb5_fcc_store_authdata PROTOTYPE((krb5_ccache , krb5_authdata **));
-krb5_error_code krb5_fcc_store_authdatum PROTOTYPE((krb5_ccache , krb5_authdata *));
+krb5_error_code krb5_fcc_write
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_pointer buf , int len ));
+krb5_error_code krb5_fcc_store_principal
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_principal princ ));
+krb5_error_code krb5_fcc_store_keyblock
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_keyblock *keyblock ));
+krb5_error_code krb5_fcc_store_data
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_data *data ));
+krb5_error_code krb5_fcc_store_int32
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_int32 i ));
+krb5_error_code krb5_fcc_store_ui_2
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_int32 i ));
+krb5_error_code krb5_fcc_store_octet
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_int32 i ));
+krb5_error_code krb5_fcc_store_times
+ PROTOTYPE((krb5_context, krb5_ccache id , krb5_ticket_times *t ));
+krb5_error_code krb5_fcc_store_addrs
+ PROTOTYPE((krb5_context, krb5_ccache , krb5_address ** ));
+krb5_error_code krb5_fcc_store_addr
+ PROTOTYPE((krb5_context, krb5_ccache , krb5_address * ));
+krb5_error_code krb5_fcc_store_authdata
+ PROTOTYPE((krb5_context, krb5_ccache , krb5_authdata **));
+krb5_error_code krb5_fcc_store_authdatum
+ PROTOTYPE((krb5_context, krb5_ccache , krb5_authdata *));
/* fcc_errs.c */
-krb5_error_code krb5_fcc_interpret PROTOTYPE((int ));
+krb5_error_code krb5_fcc_interpret
+ PROTOTYPE((krb5_context, int ));
/* fcc_maybe.c */
-krb5_error_code krb5_fcc_close_file PROTOTYPE((krb5_ccache));
-krb5_error_code krb5_fcc_open_file PROTOTYPE((krb5_ccache, int));
+krb5_error_code krb5_fcc_close_file
+ PROTOTYPE((krb5_context, krb5_ccache));
+krb5_error_code krb5_fcc_open_file
+ PROTOTYPE((krb5_context, krb5_ccache, int));
#endif /* KRB5_FCC_PROTO__ */
diff --git a/src/lib/krb5/ccache/file/fcc.h b/src/lib/krb5/ccache/file/fcc.h
index 18d560a..bd7f0f9 100644
--- a/src/lib/krb5/ccache/file/fcc.h
+++ b/src/lib/krb5/ccache/file/fcc.h
@@ -85,22 +85,22 @@ typedef struct _krb5_fcc_cursor {
off_t pos;
} krb5_fcc_cursor;
-#define MAYBE_OPEN(ID, MODE) \
+#define MAYBE_OPEN(CONTEXT, ID, MODE) \
{ \
if (OPENCLOSE (ID)) { \
- krb5_error_code maybe_open_ret = krb5_fcc_open_file (ID,MODE); \
+ krb5_error_code maybe_open_ret = krb5_fcc_open_file (CONTEXT,ID,MODE); \
if (maybe_open_ret) return maybe_open_ret; } }
-#define MAYBE_CLOSE(ID, RET) \
+#define MAYBE_CLOSE(CONTEXT, ID, RET) \
{ \
if (OPENCLOSE (ID)) { \
- krb5_error_code maybe_close_ret = krb5_fcc_close_file (ID); \
+ krb5_error_code maybe_close_ret = krb5_fcc_close_file (CONTEXT,ID); \
if (!(RET)) RET = maybe_close_ret; } }
-#define MAYBE_CLOSE_IGNORE(ID) \
+#define MAYBE_CLOSE_IGNORE(CONTEXT, ID) \
{ \
if (OPENCLOSE (ID)) { \
- (void) krb5_fcc_close_file (ID); } }
+ (void) krb5_fcc_close_file (CONTEXT,ID); } }
/* DO NOT ADD ANYTHING AFTER THIS #endif */
#endif /* __KRB5_FILE_CCACHE__ */
diff --git a/src/lib/krb5/ccache/file/fcc_close.c b/src/lib/krb5/ccache/file/fcc_close.c
index 30961d8..d59516e 100644
--- a/src/lib/krb5/ccache/file/fcc_close.c
+++ b/src/lib/krb5/ccache/file/fcc_close.c
@@ -37,13 +37,14 @@
* associated with the cache.
*/
krb5_error_code
-krb5_fcc_close(id)
+krb5_fcc_close(context, id)
+ krb5_context context;
krb5_ccache id;
{
register int closeval = KRB5_OK;
if (((krb5_fcc_data *) id->data)->fd >= 0)
- krb5_fcc_close_file(id);
+ krb5_fcc_close_file(context, id);
krb5_xfree(((krb5_fcc_data *) id->data)->filename);
krb5_xfree(((krb5_fcc_data *) id->data));
diff --git a/src/lib/krb5/ccache/file/fcc_defnam.c b/src/lib/krb5/ccache/file/fcc_defnam.c
index f8265d5..5926aca 100644
--- a/src/lib/krb5/ccache/file/fcc_defnam.c
+++ b/src/lib/krb5/ccache/file/fcc_defnam.c
@@ -49,7 +49,8 @@ static char krb5_default_name_string[KRB5_FCC_MAXLEN] = "";
*/
char *
-krb5_fcc_default_name ()
+krb5_fcc_default_name (context)
+ krb5_context context;
{
char *krb5ccache, *getenv();
int len;
diff --git a/src/lib/krb5/ccache/file/fcc_destry.c b/src/lib/krb5/ccache/file/fcc_destry.c
index 6a3298b..9fb13f6 100644
--- a/src/lib/krb5/ccache/file/fcc_destry.c
+++ b/src/lib/krb5/ccache/file/fcc_destry.c
@@ -35,7 +35,8 @@
* Errors:
* system errors
*/
-krb5_error_code krb5_fcc_destroy(id)
+krb5_error_code krb5_fcc_destroy(context, id)
+ krb5_context context;
krb5_ccache id;
{
struct stat buf;
@@ -46,7 +47,7 @@ krb5_error_code krb5_fcc_destroy(id)
if (OPENCLOSE(id)) {
ret = open(((krb5_fcc_data *) id->data)->filename, O_RDWR, 0);
if (ret < 0) {
- ret = krb5_fcc_interpret(errno);
+ ret = krb5_fcc_interpret(context, errno);
goto cleanup;
}
((krb5_fcc_data *) id->data)->fd = ret;
@@ -56,7 +57,7 @@ krb5_error_code krb5_fcc_destroy(id)
ret = unlink(((krb5_fcc_data *) id->data)->filename);
if (ret < 0) {
- ret = krb5_fcc_interpret(errno);
+ ret = krb5_fcc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) close(((krb5_fcc_data *)id->data)->fd);
((krb5_fcc_data *) id->data)->fd = -1;
@@ -66,7 +67,7 @@ krb5_error_code krb5_fcc_destroy(id)
ret = fstat(((krb5_fcc_data *) id->data)->fd, &buf);
if (ret < 0) {
- ret = krb5_fcc_interpret(errno);
+ ret = krb5_fcc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) close(((krb5_fcc_data *)id->data)->fd);
((krb5_fcc_data *) id->data)->fd = -1;
@@ -80,7 +81,7 @@ krb5_error_code krb5_fcc_destroy(id)
memset(zeros, 0, BUFSIZ);
for (i=0; i < size / BUFSIZ; i++)
if (write(((krb5_fcc_data *) id->data)->fd, zeros, BUFSIZ) < 0) {
- ret = krb5_fcc_interpret(errno);
+ ret = krb5_fcc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) close(((krb5_fcc_data *)id->data)->fd);
((krb5_fcc_data *) id->data)->fd = -1;
@@ -89,7 +90,7 @@ krb5_error_code krb5_fcc_destroy(id)
}
if (write(((krb5_fcc_data *) id->data)->fd, zeros, size % BUFSIZ) < 0) {
- ret = krb5_fcc_interpret(errno);
+ ret = krb5_fcc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) close(((krb5_fcc_data *)id->data)->fd);
((krb5_fcc_data *) id->data)->fd = -1;
@@ -101,7 +102,7 @@ krb5_error_code krb5_fcc_destroy(id)
((krb5_fcc_data *) id->data)->fd = -1;
if (ret)
- ret = krb5_fcc_interpret(errno);
+ ret = krb5_fcc_interpret(context, errno);
cleanup:
krb5_xfree(((krb5_fcc_data *) id->data)->filename);
diff --git a/src/lib/krb5/ccache/file/fcc_errs.c b/src/lib/krb5/ccache/file/fcc_errs.c
index 1dd9678..8a4834a 100644
--- a/src/lib/krb5/ccache/file/fcc_errs.c
+++ b/src/lib/krb5/ccache/file/fcc_errs.c
@@ -29,7 +29,8 @@
#include "fcc.h"
krb5_error_code
-krb5_fcc_interpret(errnum)
+krb5_fcc_interpret(context, errnum)
+ krb5_context context;
int errnum;
{
register int retval;
diff --git a/src/lib/krb5/ccache/file/fcc_eseq.c b/src/lib/krb5/ccache/file/fcc_eseq.c
index d60a5b7..d2b5f1f 100644
--- a/src/lib/krb5/ccache/file/fcc_eseq.c
+++ b/src/lib/krb5/ccache/file/fcc_eseq.c
@@ -41,7 +41,8 @@
*/
/* ARGSUSED */
krb5_error_code
-krb5_fcc_end_seq_get(id, cursor)
+krb5_fcc_end_seq_get(context, id, cursor)
+ krb5_context context;
krb5_ccache id;
krb5_cc_cursor *cursor;
{
@@ -50,7 +51,7 @@ krb5_fcc_end_seq_get(id, cursor)
/* don't close; it may be left open by the caller,
and if not, fcc_start_seq_get and/or fcc_next_cred will do the
MAYBE_CLOSE.
- MAYBE_CLOSE(id, kret); */
+ MAYBE_CLOSE(context, id, kret); */
krb5_xfree((krb5_fcc_cursor *) *cursor);
return kret;
diff --git a/src/lib/krb5/ccache/file/fcc_gennew.c b/src/lib/krb5/ccache/file/fcc_gennew.c
index 36d00aa..9b843ee 100644
--- a/src/lib/krb5/ccache/file/fcc_gennew.c
+++ b/src/lib/krb5/ccache/file/fcc_gennew.c
@@ -52,7 +52,8 @@ extern krb5_cc_ops krb5_fcc_ops;
* system errors (from open)
*/
krb5_error_code
-krb5_fcc_generate_new (id)
+krb5_fcc_generate_new (context, id)
+ krb5_context context;
krb5_ccache *id;
{
krb5_ccache lid;
@@ -100,7 +101,7 @@ krb5_fcc_generate_new (id)
ret = open(((krb5_fcc_data *) lid->data)->filename,
O_CREAT | O_EXCL | O_WRONLY, 0);
if (ret == -1) {
- retcode = krb5_fcc_interpret(errno);
+ retcode = krb5_fcc_interpret(context, errno);
goto err_out;
} else {
krb5_int16 fcc_fvno = htons(KRB5_FCC_DEFAULT_FVNO);
@@ -117,13 +118,13 @@ krb5_fcc_generate_new (id)
errsave = errno;
(void) close(ret);
(void) unlink(((krb5_fcc_data *) lid->data)->filename);
- retcode = (cnt == -1) ? krb5_fcc_interpret(errsave) : KRB5_CC_IO;
+ retcode = (cnt == -1) ? krb5_fcc_interpret(context, errsave) : KRB5_CC_IO;
goto err_out;
}
if (close(ret) == -1) {
errsave = errno;
(void) unlink(((krb5_fcc_data *) lid->data)->filename);
- retcode = krb5_fcc_interpret(errsave);
+ retcode = krb5_fcc_interpret(context, errsave);
goto err_out;
}
diff --git a/src/lib/krb5/ccache/file/fcc_getnam.c b/src/lib/krb5/ccache/file/fcc_getnam.c
index 76faf88..f3357f1 100644
--- a/src/lib/krb5/ccache/file/fcc_getnam.c
+++ b/src/lib/krb5/ccache/file/fcc_getnam.c
@@ -36,7 +36,8 @@
* The name of the file cred cache id.
*/
char *
-krb5_fcc_get_name (id)
+krb5_fcc_get_name (context, id)
+ krb5_context context;
krb5_ccache id;
{
return (char *) ((krb5_fcc_data *) id->data)->filename;
diff --git a/src/lib/krb5/ccache/file/fcc_gprin.c b/src/lib/krb5/ccache/file/fcc_gprin.c
index f239c6d..a97abd6 100644
--- a/src/lib/krb5/ccache/file/fcc_gprin.c
+++ b/src/lib/krb5/ccache/file/fcc_gprin.c
@@ -41,19 +41,20 @@
* KRB5_CC_NOMEM
*/
krb5_error_code
-krb5_fcc_get_principal(id, princ)
+krb5_fcc_get_principal(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal *princ;
{
krb5_error_code kret = KRB5_OK;
- MAYBE_OPEN(id, FCC_OPEN_RDONLY);
+ MAYBE_OPEN(context, id, FCC_OPEN_RDONLY);
/* make sure we're beyond the vno */
lseek(((krb5_fcc_data *) id->data)->fd, sizeof(krb5_int16), SEEK_SET);
- kret = krb5_fcc_read_principal(id, princ);
+ kret = krb5_fcc_read_principal(context, id, princ);
- MAYBE_CLOSE(id, kret);
+ MAYBE_CLOSE(context, id, kret);
return kret;
}
diff --git a/src/lib/krb5/ccache/file/fcc_init.c b/src/lib/krb5/ccache/file/fcc_init.c
index 019640f..fffc09a 100644
--- a/src/lib/krb5/ccache/file/fcc_init.c
+++ b/src/lib/krb5/ccache/file/fcc_init.c
@@ -41,13 +41,14 @@
* permission errors
*/
krb5_error_code
-krb5_fcc_initialize(id, princ)
+krb5_fcc_initialize(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal princ;
{
int ret = KRB5_OK;
- MAYBE_OPEN(id, FCC_OPEN_AND_ERASE);
+ MAYBE_OPEN(context, id, FCC_OPEN_AND_ERASE);
#ifdef NOFCHMOD
ret = chmod(((krb5_fcc_data *) id->data)->filename, S_IREAD | S_IWRITE);
@@ -55,13 +56,13 @@ krb5_fcc_initialize(id, princ)
ret = fchmod(((krb5_fcc_data *) id->data)->fd, S_IREAD | S_IWRITE);
#endif
if (ret == -1) {
- ret = krb5_fcc_interpret(errno);
- MAYBE_CLOSE(id, ret);
+ ret = krb5_fcc_interpret(context, errno);
+ MAYBE_CLOSE(context, id, ret);
return ret;
}
- krb5_fcc_store_principal(id, princ);
+ krb5_fcc_store_principal(context, id, princ);
- MAYBE_CLOSE(id, ret);
+ MAYBE_CLOSE(context, id, ret);
return ret;
}
diff --git a/src/lib/krb5/ccache/file/fcc_maybe.c b/src/lib/krb5/ccache/file/fcc_maybe.c
index 5fcfc3a..e72e812 100644
--- a/src/lib/krb5/ccache/file/fcc_maybe.c
+++ b/src/lib/krb5/ccache/file/fcc_maybe.c
@@ -118,7 +118,8 @@ int lockunlock;
}
krb5_error_code
-krb5_fcc_close_file (id)
+krb5_fcc_close_file (context, id)
+ krb5_context context;
krb5_ccache id;
{
int ret;
@@ -134,11 +135,12 @@ krb5_fcc_close_file (id)
if (retval)
return retval;
else
- return (ret == -1) ? krb5_fcc_interpret (errno) : 0;
+ return (ret == -1) ? krb5_fcc_interpret (context, errno) : 0;
}
krb5_error_code
-krb5_fcc_open_file (id, mode)
+krb5_fcc_open_file (context, id, mode)
+ krb5_context context;
krb5_ccache id;
int mode;
{
@@ -170,7 +172,7 @@ krb5_fcc_open_file (id, mode)
fd = open (data->filename, open_flag, 0600);
if (fd == -1)
- return krb5_fcc_interpret (errno);
+ return krb5_fcc_interpret (context, errno);
if (retval = fcc_lock_file(data, fd, LOCK_IT)) {
(void) close(fd);
@@ -188,7 +190,7 @@ krb5_fcc_open_file (id, mode)
errsave = errno;
(void) fcc_lock_file(data, fd, UNLOCK_IT);
(void) close(fd);
- return (cnt == -1) ? krb5_fcc_interpret(errsave) : KRB5_CC_IO;
+ return (cnt == -1) ? krb5_fcc_interpret(context, errsave) : KRB5_CC_IO;
}
} else {
/* verify a valid version number is there */
diff --git a/src/lib/krb5/ccache/file/fcc_nseq.c b/src/lib/krb5/ccache/file/fcc_nseq.c
index 08746a6..1a85acd 100644
--- a/src/lib/krb5/ccache/file/fcc_nseq.c
+++ b/src/lib/krb5/ccache/file/fcc_nseq.c
@@ -49,7 +49,8 @@
* system errors
*/
krb5_error_code
-krb5_fcc_next_cred(id, cursor, creds)
+krb5_fcc_next_cred(context, id, cursor, creds)
+ krb5_context context;
krb5_ccache id;
krb5_cc_cursor *cursor;
krb5_creds *creds;
@@ -63,47 +64,47 @@ krb5_fcc_next_cred(id, cursor, creds)
memset((char *)creds, 0, sizeof(*creds));
- MAYBE_OPEN(id, FCC_OPEN_RDONLY);
+ MAYBE_OPEN(context, id, FCC_OPEN_RDONLY);
fcursor = (krb5_fcc_cursor *) *cursor;
ret = lseek(((krb5_fcc_data *) id->data)->fd, fcursor->pos, SEEK_SET);
if (ret < 0) {
- ret = krb5_fcc_interpret(errno);
- MAYBE_CLOSE(id, ret);
+ ret = krb5_fcc_interpret(context, errno);
+ MAYBE_CLOSE(context, id, ret);
return ret;
}
- kret = krb5_fcc_read_principal(id, &creds->client);
+ kret = krb5_fcc_read_principal(context, id, &creds->client);
TCHECK(kret);
- kret = krb5_fcc_read_principal(id, &creds->server);
+ kret = krb5_fcc_read_principal(context, id, &creds->server);
TCHECK(kret);
- kret = krb5_fcc_read_keyblock(id, &creds->keyblock);
+ kret = krb5_fcc_read_keyblock(context, id, &creds->keyblock);
TCHECK(kret);
- kret = krb5_fcc_read_times(id, &creds->times);
+ kret = krb5_fcc_read_times(context, id, &creds->times);
TCHECK(kret);
- kret = krb5_fcc_read_octet(id, &octet);
+ kret = krb5_fcc_read_octet(context, id, &octet);
TCHECK(kret);
creds->is_skey = octet;
- kret = krb5_fcc_read_int32(id, &int32);
+ kret = krb5_fcc_read_int32(context, id, &int32);
TCHECK(kret);
creds->ticket_flags = int32;
- kret = krb5_fcc_read_addrs(id, &creds->addresses);
+ kret = krb5_fcc_read_addrs(context, id, &creds->addresses);
TCHECK(kret);
- kret = krb5_fcc_read_authdata(id, &creds->authdata);
+ kret = krb5_fcc_read_authdata(context, id, &creds->authdata);
TCHECK(kret);
- kret = krb5_fcc_read_data(id, &creds->ticket);
+ kret = krb5_fcc_read_data(context, id, &creds->ticket);
TCHECK(kret);
- kret = krb5_fcc_read_data(id, &creds->second_ticket);
+ kret = krb5_fcc_read_data(context, id, &creds->second_ticket);
TCHECK(kret);
fcursor->pos = lseek(((krb5_fcc_data *) id->data)->fd, 0, SEEK_CUR);
cursor = (krb5_cc_cursor *) fcursor;
lose:
- MAYBE_CLOSE(id, kret); /* won't overwrite kret
+ MAYBE_CLOSE(context, id, kret); /* won't overwrite kret
if already set */
if (kret != KRB5_OK)
- krb5_free_cred_contents(creds);
+ krb5_free_cred_contents(context, creds);
return kret;
}
diff --git a/src/lib/krb5/ccache/file/fcc_read.c b/src/lib/krb5/ccache/file/fcc_read.c
index 7a91d6a..801cb75 100644
--- a/src/lib/krb5/ccache/file/fcc_read.c
+++ b/src/lib/krb5/ccache/file/fcc_read.c
@@ -41,7 +41,8 @@
* system errors (read)
*/
krb5_error_code
-krb5_fcc_read(id, buf, len)
+krb5_fcc_read(context, id, buf, len)
+ krb5_context context;
krb5_ccache id;
krb5_pointer buf;
int len;
@@ -50,7 +51,7 @@ krb5_fcc_read(id, buf, len)
ret = read(((krb5_fcc_data *) id->data)->fd, (char *) buf, len);
if (ret == -1)
- return krb5_fcc_interpret(errno);
+ return krb5_fcc_interpret(context, errno);
else if (ret != len)
return KRB5_CC_END;
else
@@ -75,7 +76,8 @@ krb5_fcc_read(id, buf, len)
*/
krb5_error_code
-krb5_fcc_read_principal(id, princ)
+krb5_fcc_read_principal(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal *princ;
{
@@ -89,13 +91,13 @@ krb5_fcc_read_principal(id, princ)
type = KRB5_NT_UNKNOWN;
} else {
/* Read principal type */
- kret = krb5_fcc_read_int32(id, &type);
+ kret = krb5_fcc_read_int32(context, id, &type);
if (kret != KRB5_OK)
return kret;
}
/* Read the number of components */
- kret = krb5_fcc_read_int32(id, &length);
+ kret = krb5_fcc_read_int32(context, id, &length);
if (kret != KRB5_OK)
return kret;
@@ -121,13 +123,13 @@ krb5_fcc_read_principal(id, princ)
tmpprinc->length = length;
tmpprinc->type = type;
- kret = krb5_fcc_read_data(id, krb5_princ_realm(tmpprinc));
+ kret = krb5_fcc_read_data(context, id, krb5_princ_realm(context, tmpprinc));
i = 0;
CHECK(kret);
for (i=0; i < length; i++) {
- kret = krb5_fcc_read_data(id, krb5_princ_component(tmpprinc, i));
+ kret = krb5_fcc_read_data(context, id, krb5_princ_component(context, tmpprinc, i));
CHECK(kret);
}
*princ = tmpprinc;
@@ -135,14 +137,15 @@ krb5_fcc_read_principal(id, princ)
errout:
while(--i >= 0)
- free(krb5_princ_component(tmpprinc, i)->data);
+ free(krb5_princ_component(context, tmpprinc, i)->data);
free((char *)tmpprinc->data);
free((char *)tmpprinc);
return kret;
}
krb5_error_code
-krb5_fcc_read_addrs(id, addrs)
+krb5_fcc_read_addrs(context, id, addrs)
+ krb5_context context;
krb5_ccache id;
krb5_address ***addrs;
{
@@ -153,7 +156,7 @@ krb5_fcc_read_addrs(id, addrs)
*addrs = 0;
/* Read the number of components */
- kret = krb5_fcc_read_int32(id, &length);
+ kret = krb5_fcc_read_int32(context, id, &length);
CHECK(kret);
/* Make *addrs able to hold length pointers to krb5_address structs
@@ -166,22 +169,23 @@ krb5_fcc_read_addrs(id, addrs)
for (i=0; i < length; i++) {
(*addrs)[i] = (krb5_address *) malloc(sizeof(krb5_address));
if ((*addrs)[i] == NULL) {
- krb5_free_addresses(*addrs);
+ krb5_free_addresses(context, *addrs);
return KRB5_CC_NOMEM;
}
- kret = krb5_fcc_read_addr(id, (*addrs)[i]);
+ kret = krb5_fcc_read_addr(context, id, (*addrs)[i]);
CHECK(kret);
}
return KRB5_OK;
errout:
if (*addrs)
- krb5_free_addresses(*addrs);
+ krb5_free_addresses(context, *addrs);
return kret;
}
krb5_error_code
-krb5_fcc_read_keyblock(id, keyblock)
+krb5_fcc_read_keyblock(context, id, keyblock)
+ krb5_context context;
krb5_ccache id;
krb5_keyblock *keyblock;
{
@@ -193,19 +197,19 @@ krb5_fcc_read_keyblock(id, keyblock)
keyblock->magic = KV5M_KEYBLOCK;
keyblock->contents = 0;
- kret = krb5_fcc_read_ui_2(id, &ui2);
+ kret = krb5_fcc_read_ui_2(context, id, &ui2);
keyblock->keytype = ui2;
CHECK(kret);
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2))
keyblock->etype = ETYPE_UNKNOWN;
else {
- kret = krb5_fcc_read_ui_2(id, &ui2);
+ kret = krb5_fcc_read_ui_2(context, id, &ui2);
keyblock->etype = ui2;
CHECK(kret);
}
- kret = krb5_fcc_read_int32(id, &int32);
+ kret = krb5_fcc_read_int32(context, id, &int32);
CHECK(kret);
keyblock->length = int32;
if ( keyblock->length == 0 )
@@ -215,7 +219,7 @@ krb5_fcc_read_keyblock(id, keyblock)
if (keyblock->contents == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_fcc_read(id, keyblock->contents, keyblock->length);
+ kret = krb5_fcc_read(context, id, keyblock->contents, keyblock->length);
if (kret)
goto errout;
@@ -227,7 +231,8 @@ krb5_fcc_read_keyblock(id, keyblock)
}
krb5_error_code
-krb5_fcc_read_data(id, data)
+krb5_fcc_read_data(context, id, data)
+ krb5_context context;
krb5_ccache id;
krb5_data *data;
{
@@ -236,7 +241,7 @@ krb5_fcc_read_data(id, data)
data->magic = KV5M_DATA;
data->data = 0;
- kret = krb5_fcc_read_int32(id, &data->length);
+ kret = krb5_fcc_read_int32(context, id, &data->length);
CHECK(kret);
if (data->length == 0) {
@@ -248,7 +253,7 @@ krb5_fcc_read_data(id, data)
if (data->data == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_fcc_read(id, data->data, data->length);
+ kret = krb5_fcc_read(context, id, data->data, data->length);
CHECK(kret);
data->data[data->length] = 0; /* Null terminate, just in case.... */
@@ -260,7 +265,8 @@ krb5_fcc_read_data(id, data)
}
krb5_error_code
-krb5_fcc_read_addr(id, addr)
+krb5_fcc_read_addr(context, id, addr)
+ krb5_context context;
krb5_ccache id;
krb5_address *addr;
{
@@ -271,11 +277,11 @@ krb5_fcc_read_addr(id, addr)
addr->magic = KV5M_ADDRESS;
addr->contents = 0;
- kret = krb5_fcc_read_ui_2(id, &ui2);
+ kret = krb5_fcc_read_ui_2(context, id, &ui2);
CHECK(kret);
addr->addrtype = ui2;
- kret = krb5_fcc_read_int32(id, &int32);
+ kret = krb5_fcc_read_int32(context, id, &int32);
CHECK(kret);
addr->length = int32;
@@ -286,7 +292,7 @@ krb5_fcc_read_addr(id, addr)
if (addr->contents == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_fcc_read(id, addr->contents, addr->length);
+ kret = krb5_fcc_read(context, id, addr->contents, addr->length);
CHECK(kret);
return KRB5_OK;
@@ -297,7 +303,8 @@ krb5_fcc_read_addr(id, addr)
}
krb5_error_code
-krb5_fcc_read_int32(id, i)
+krb5_fcc_read_int32(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 *i;
{
@@ -307,9 +314,9 @@ krb5_fcc_read_int32(id, i)
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2))
- return krb5_fcc_read(id, (krb5_pointer) i, sizeof(krb5_int32));
+ return krb5_fcc_read(context, id, (krb5_pointer) i, sizeof(krb5_int32));
else {
- retval = krb5_fcc_read(id, buf, 4);
+ retval = krb5_fcc_read(context, id, buf, 4);
if (retval)
return retval;
*i = (((((buf[0] << 8) + buf[1]) << 8 ) + buf[2]) << 8) + buf[3];
@@ -318,7 +325,8 @@ krb5_fcc_read_int32(id, i)
}
krb5_error_code
-krb5_fcc_read_ui_2(id, i)
+krb5_fcc_read_ui_2(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_ui_2 *i;
{
@@ -328,9 +336,9 @@ krb5_fcc_read_ui_2(id, i)
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2))
- return krb5_fcc_read(id, (krb5_pointer) i, sizeof(krb5_ui_2));
+ return krb5_fcc_read(context, id, (krb5_pointer) i, sizeof(krb5_ui_2));
else {
- retval = krb5_fcc_read(id, buf, 2);
+ retval = krb5_fcc_read(context, id, buf, 2);
if (retval)
return retval;
*i = (buf[0] << 8) + buf[1];
@@ -339,16 +347,18 @@ krb5_fcc_read_ui_2(id, i)
}
krb5_error_code
-krb5_fcc_read_octet(id, i)
+krb5_fcc_read_octet(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_octet *i;
{
- return krb5_fcc_read(id, (krb5_pointer) i, 1);
+ return krb5_fcc_read(context, id, (krb5_pointer) i, 1);
}
krb5_error_code
-krb5_fcc_read_times(id, t)
+krb5_fcc_read_times(context, id, t)
+ krb5_context context;
krb5_ccache id;
krb5_ticket_times *t;
{
@@ -358,21 +368,21 @@ krb5_fcc_read_times(id, t)
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2))
- return krb5_fcc_read(id, (krb5_pointer) t, sizeof(krb5_ticket_times));
+ return krb5_fcc_read(context, id, (krb5_pointer) t, sizeof(krb5_ticket_times));
else {
- retval = krb5_fcc_read_int32(id, &i);
+ retval = krb5_fcc_read_int32(context, id, &i);
CHECK(retval);
t->authtime = i;
- retval = krb5_fcc_read_int32(id, &i);
+ retval = krb5_fcc_read_int32(context, id, &i);
CHECK(retval);
t->starttime = i;
- retval = krb5_fcc_read_int32(id, &i);
+ retval = krb5_fcc_read_int32(context, id, &i);
CHECK(retval);
t->endtime = i;
- retval = krb5_fcc_read_int32(id, &i);
+ retval = krb5_fcc_read_int32(context, id, &i);
CHECK(retval);
t->renew_till = i;
}
@@ -382,7 +392,8 @@ errout:
}
krb5_error_code
-krb5_fcc_read_authdata(id, a)
+krb5_fcc_read_authdata(context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata ***a;
{
@@ -393,7 +404,7 @@ krb5_fcc_read_authdata(id, a)
*a = 0;
/* Read the number of components */
- kret = krb5_fcc_read_int32(id, &length);
+ kret = krb5_fcc_read_int32(context, id, &length);
CHECK(kret);
if (length == 0)
@@ -409,22 +420,23 @@ krb5_fcc_read_authdata(id, a)
for (i=0; i < length; i++) {
(*a)[i] = (krb5_authdata *) malloc(sizeof(krb5_authdata));
if ((*a)[i] == NULL) {
- krb5_free_authdata(*a);
+ krb5_free_authdata(context, *a);
return KRB5_CC_NOMEM;
}
- kret = krb5_fcc_read_authdatum(id, (*a)[i]);
+ kret = krb5_fcc_read_authdatum(context, id, (*a)[i]);
CHECK(kret);
}
return KRB5_OK;
errout:
if (*a)
- krb5_free_authdata(*a);
+ krb5_free_authdata(context, *a);
return kret;
}
krb5_error_code
-krb5_fcc_read_authdatum(id, a)
+krb5_fcc_read_authdatum(context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata *a;
{
@@ -435,9 +447,9 @@ krb5_fcc_read_authdatum(id, a)
a->magic = KV5M_AUTHDATA;
a->contents = NULL;
- kret = krb5_fcc_read_ui_2(id, &a->ad_type);
+ kret = krb5_fcc_read_ui_2(context, id, &a->ad_type);
CHECK(kret);
- kret = krb5_fcc_read_int32(id, &int32);
+ kret = krb5_fcc_read_int32(context, id, &int32);
CHECK(kret);
a->length = int32;
@@ -448,7 +460,7 @@ krb5_fcc_read_authdatum(id, a)
if (a->contents == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_fcc_read(id, a->contents, a->length);
+ kret = krb5_fcc_read(context, id, a->contents, a->length);
CHECK(kret);
return KRB5_OK;
diff --git a/src/lib/krb5/ccache/file/fcc_reslv.c b/src/lib/krb5/ccache/file/fcc_reslv.c
index 7c61ec5..2944f43 100644
--- a/src/lib/krb5/ccache/file/fcc_reslv.c
+++ b/src/lib/krb5/ccache/file/fcc_reslv.c
@@ -50,7 +50,8 @@ extern krb5_cc_ops krb5_fcc_ops;
* permission errors
*/
krb5_error_code
-krb5_fcc_resolve (id, residual)
+krb5_fcc_resolve (context, id, residual)
+ krb5_context context;
krb5_ccache *id;
char *residual;
{
diff --git a/src/lib/krb5/ccache/file/fcc_retrv.c b/src/lib/krb5/ccache/file/fcc_retrv.c
index cf96ce0..b9d3242 100644
--- a/src/lib/krb5/ccache/file/fcc_retrv.c
+++ b/src/lib/krb5/ccache/file/fcc_retrv.c
@@ -33,11 +33,13 @@
static krb5_boolean times_match PROTOTYPE((const krb5_ticket_times *,
const krb5_ticket_times *));
static krb5_boolean standard_fields_match
- PROTOTYPE((const krb5_creds *,
+ PROTOTYPE((krb5_context,
+ const krb5_creds *,
const krb5_creds *));
static krb5_boolean srvname_match
- PROTOTYPE((const krb5_creds *,
+ PROTOTYPE((krb5_context,
+ const krb5_creds *,
const krb5_creds *));
static krb5_boolean authdata_match
@@ -83,7 +85,8 @@ register const krb5_data *data1, *data2;
* KRB5_CC_NOMEM
*/
krb5_error_code
-krb5_fcc_retrieve(id, whichfields, mcreds, creds)
+krb5_fcc_retrieve(context, id, whichfields, mcreds, creds)
+ krb5_context context;
krb5_ccache id;
krb5_flags whichfields;
krb5_creds *mcreds;
@@ -96,14 +99,14 @@ krb5_fcc_retrieve(id, whichfields, mcreds, creds)
krb5_error_code kret;
krb5_creds fetchcreds;
- kret = krb5_fcc_start_seq_get(id, &cursor);
+ kret = krb5_fcc_start_seq_get(context, id, &cursor);
if (kret != KRB5_OK)
return kret;
- while ((kret = krb5_fcc_next_cred(id, &cursor, &fetchcreds)) == KRB5_OK) {
+ while ((kret = krb5_fcc_next_cred(context, id, &cursor, &fetchcreds)) == KRB5_OK) {
if (((set(KRB5_TC_MATCH_SRV_NAMEONLY) &&
- srvname_match(mcreds, &fetchcreds)) ||
- standard_fields_match(mcreds, &fetchcreds))
+ srvname_match(context, mcreds, &fetchcreds)) ||
+ standard_fields_match(context, mcreds, &fetchcreds))
&&
(! set(KRB5_TC_MATCH_IS_SKEY) ||
mcreds->is_skey == fetchcreds.is_skey)
@@ -127,17 +130,17 @@ krb5_fcc_retrieve(id, whichfields, mcreds, creds)
data_match (&mcreds->second_ticket, &fetchcreds.second_ticket))
)
{
- krb5_fcc_end_seq_get(id, &cursor);
+ krb5_fcc_end_seq_get(context, id, &cursor);
*creds = fetchcreds;
return KRB5_OK;
}
/* This one doesn't match */
- krb5_free_cred_contents(&fetchcreds);
+ krb5_free_cred_contents(context, &fetchcreds);
}
/* If we get here, a match wasn't found */
- krb5_fcc_end_seq_get(id, &cursor);
+ krb5_fcc_end_seq_get(context, id, &cursor);
return KRB5_CC_NOTFOUND;
}
@@ -159,23 +162,25 @@ register const krb5_ticket_times *t2;
}
static krb5_boolean
-standard_fields_match(mcreds, creds)
+standard_fields_match(context, mcreds, creds)
+ krb5_context context;
register const krb5_creds *mcreds, *creds;
{
- return (krb5_principal_compare(mcreds->client,creds->client) &&
- krb5_principal_compare(mcreds->server,creds->server));
+ return (krb5_principal_compare(context, mcreds->client,creds->client) &&
+ krb5_principal_compare(context, mcreds->server,creds->server));
}
/* only match the server name portion, not the server realm portion */
static krb5_boolean
-srvname_match(mcreds, creds)
+srvname_match(context, mcreds, creds)
+ krb5_context context;
register const krb5_creds *mcreds, *creds;
{
krb5_boolean retval;
krb5_principal_data p1, p2;
- retval = krb5_principal_compare(mcreds->client,creds->client);
+ retval = krb5_principal_compare(context, mcreds->client,creds->client);
if (retval != TRUE)
return retval;
/*
@@ -184,7 +189,7 @@ register const krb5_creds *mcreds, *creds;
p1 = *mcreds->server;
p2 = *creds->server;
p1.realm = p2.realm;
- return krb5_principal_compare(&p1, &p2);
+ return krb5_principal_compare(context, &p1, &p2);
}
static krb5_boolean
diff --git a/src/lib/krb5/ccache/file/fcc_sflags.c b/src/lib/krb5/ccache/file/fcc_sflags.c
index 1eb42af..ac4b5a9 100644
--- a/src/lib/krb5/ccache/file/fcc_sflags.c
+++ b/src/lib/krb5/ccache/file/fcc_sflags.c
@@ -40,7 +40,8 @@
* Sets the operational flags of id to flags.
*/
krb5_error_code
-krb5_fcc_set_flags(id, flags)
+krb5_fcc_set_flags(context, id, flags)
+ krb5_context context;
krb5_ccache id;
krb5_flags flags;
{
@@ -48,12 +49,12 @@ krb5_fcc_set_flags(id, flags)
if (flags & KRB5_TC_OPENCLOSE) {
/* asking to turn on OPENCLOSE mode */
if (!OPENCLOSE(id)) {
- (void) krb5_fcc_close_file (id);
+ (void) krb5_fcc_close_file (context, id);
}
} else {
/* asking to turn off OPENCLOSE mode, meaning it must be
left open. We open if it's not yet open */
- MAYBE_OPEN(id, FCC_OPEN_RDONLY);
+ MAYBE_OPEN(context, id, FCC_OPEN_RDONLY);
}
((krb5_fcc_data *) id->data)->flags = flags;
diff --git a/src/lib/krb5/ccache/file/fcc_skip.c b/src/lib/krb5/ccache/file/fcc_skip.c
index 2cafdb0..15aa43b 100644
--- a/src/lib/krb5/ccache/file/fcc_skip.c
+++ b/src/lib/krb5/ccache/file/fcc_skip.c
@@ -29,17 +29,18 @@
#include "fcc.h"
krb5_error_code
-krb5_fcc_skip_principal(id)
+krb5_fcc_skip_principal(context, id)
+ krb5_context context;
krb5_ccache id;
{
krb5_error_code kret;
krb5_principal princ;
- kret = krb5_fcc_read_principal(id, &princ);
+ kret = krb5_fcc_read_principal(context, id, &princ);
if (kret != KRB5_OK)
return kret;
- krb5_free_principal(princ);
+ krb5_free_principal(context, princ);
return KRB5_OK;
}
diff --git a/src/lib/krb5/ccache/file/fcc_sseq.c b/src/lib/krb5/ccache/file/fcc_sseq.c
index 1cdc013..622cd57 100644
--- a/src/lib/krb5/ccache/file/fcc_sseq.c
+++ b/src/lib/krb5/ccache/file/fcc_sseq.c
@@ -41,7 +41,8 @@
* system errors
*/
krb5_error_code
-krb5_fcc_start_seq_get(id, cursor)
+krb5_fcc_start_seq_get(context, id, cursor)
+ krb5_context context;
krb5_ccache id;
krb5_cc_cursor *cursor;
{
@@ -52,7 +53,7 @@ krb5_fcc_start_seq_get(id, cursor)
if (fcursor == NULL)
return KRB5_CC_NOMEM;
if (OPENCLOSE(id)) {
- ret = krb5_fcc_open_file(id, FCC_OPEN_RDONLY);
+ ret = krb5_fcc_open_file(context, id, FCC_OPEN_RDONLY);
if (ret) {
krb5_xfree(fcursor);
return ret;
@@ -64,10 +65,10 @@ krb5_fcc_start_seq_get(id, cursor)
/* Make sure we start reading right after the primary principal */
- krb5_fcc_skip_principal(id);
+ krb5_fcc_skip_principal(context, id);
fcursor->pos = lseek(((krb5_fcc_data *) id->data)->fd, 0, SEEK_CUR);
*cursor = (krb5_cc_cursor) fcursor;
- MAYBE_CLOSE(id, ret);
+ MAYBE_CLOSE(context, id, ret);
return ret;
}
diff --git a/src/lib/krb5/ccache/file/fcc_store.c b/src/lib/krb5/ccache/file/fcc_store.c
index 9586f74..352cae7 100644
--- a/src/lib/krb5/ccache/file/fcc_store.c
+++ b/src/lib/krb5/ccache/file/fcc_store.c
@@ -42,45 +42,46 @@
* storage failure errors
*/
krb5_error_code
-krb5_fcc_store(id, creds)
+krb5_fcc_store(context, id, creds)
+ krb5_context context;
krb5_ccache id;
krb5_creds *creds;
{
#define TCHECK(ret) if (ret != KRB5_OK) goto lose;
krb5_error_code ret;
- MAYBE_OPEN(id, FCC_OPEN_RDWR);
+ MAYBE_OPEN(context, id, FCC_OPEN_RDWR);
/* Make sure we are writing to the end of the file */
ret = lseek(((krb5_fcc_data *) id->data)->fd, 0, SEEK_END);
if (ret < 0) {
- MAYBE_CLOSE_IGNORE(id);
- return krb5_fcc_interpret(errno);
+ MAYBE_CLOSE_IGNORE(context, id);
+ return krb5_fcc_interpret(context, errno);
}
- ret = krb5_fcc_store_principal(id, creds->client);
+ ret = krb5_fcc_store_principal(context, id, creds->client);
TCHECK(ret);
- ret = krb5_fcc_store_principal(id, creds->server);
+ ret = krb5_fcc_store_principal(context, id, creds->server);
TCHECK(ret);
- ret = krb5_fcc_store_keyblock(id, &creds->keyblock);
+ ret = krb5_fcc_store_keyblock(context, id, &creds->keyblock);
TCHECK(ret);
- ret = krb5_fcc_store_times(id, &creds->times);
+ ret = krb5_fcc_store_times(context, id, &creds->times);
TCHECK(ret);
- ret = krb5_fcc_store_octet(id, creds->is_skey);
+ ret = krb5_fcc_store_octet(context, id, creds->is_skey);
TCHECK(ret);
- ret = krb5_fcc_store_int32(id, creds->ticket_flags);
+ ret = krb5_fcc_store_int32(context, id, creds->ticket_flags);
TCHECK(ret);
- ret = krb5_fcc_store_addrs(id, creds->addresses);
+ ret = krb5_fcc_store_addrs(context, id, creds->addresses);
TCHECK(ret);
- ret = krb5_fcc_store_authdata(id, creds->authdata);
+ ret = krb5_fcc_store_authdata(context, id, creds->authdata);
TCHECK(ret);
- ret = krb5_fcc_store_data(id, &creds->ticket);
+ ret = krb5_fcc_store_data(context, id, &creds->ticket);
TCHECK(ret);
- ret = krb5_fcc_store_data(id, &creds->second_ticket);
+ ret = krb5_fcc_store_data(context, id, &creds->second_ticket);
TCHECK(ret);
lose:
- MAYBE_CLOSE(id, ret);
+ MAYBE_CLOSE(context, id, ret);
return ret;
#undef TCHECK
}
diff --git a/src/lib/krb5/ccache/file/fcc_test.c b/src/lib/krb5/ccache/file/fcc_test.c
index 497e9c5..3e3b5c5 100644
--- a/src/lib/krb5/ccache/file/fcc_test.c
+++ b/src/lib/krb5/ccache/file/fcc_test.c
@@ -111,27 +111,27 @@ void fcc_test()
init_test_cred();
- kret = krb5_fcc_resolve(&id, "/tmp/tkt_test");
+ kret = krb5_fcc_resolve(context, &id, "/tmp/tkt_test");
CHECK(kret, "resolve");
- kret = krb5_fcc_initialize(id, test_creds.client);
+ kret = krb5_fcc_initialize(context, id, test_creds.client);
CHECK(kret, "initialize");
- kret = krb5_fcc_store(id, &test_creds);
+ kret = krb5_fcc_store(context, id, &test_creds);
CHECK(kret, "store");
- kret = krb5_fcc_start_seq_get(id, &cursor);
+ kret = krb5_fcc_start_seq_get(context, id, &cursor);
CHECK(kret, "start_seq_get");
kret = 0;
while (kret != KRB5_CC_END) {
printf("Calling next_cred\n");
- kret = krb5_fcc_next_cred(id, &cursor, &creds);
+ kret = krb5_fcc_next_cred(context, id, &cursor, &creds);
CHECK(kret, "next_cred");
}
- kret = krb5_fcc_end_seq_get(id, &cursor);
+ kret = krb5_fcc_end_seq_get(context, id, &cursor);
CHECK(kret, "end_seq_get");
- kret = krb5_fcc_destroy(id);
+ kret = krb5_fcc_destroy(context, id);
CHECK(kret, "destroy");
- kret = krb5_fcc_close(id);
+ kret = krb5_fcc_close(context, id);
CHECK(kret, "close");
}
diff --git a/src/lib/krb5/ccache/file/fcc_write.c b/src/lib/krb5/ccache/file/fcc_write.c
index 2633bd5..f5c8f8c 100644
--- a/src/lib/krb5/ccache/file/fcc_write.c
+++ b/src/lib/krb5/ccache/file/fcc_write.c
@@ -42,7 +42,8 @@
* system errors
*/
krb5_error_code
-krb5_fcc_write(id, buf, len)
+krb5_fcc_write(context, id, buf, len)
+ krb5_context context;
krb5_ccache id;
krb5_pointer buf;
int len;
@@ -51,7 +52,7 @@ krb5_fcc_write(id, buf, len)
ret = write(((krb5_fcc_data *)id->data)->fd, (char *) buf, len);
if (ret < 0)
- return krb5_fcc_interpret(errno);
+ return krb5_fcc_interpret(context, errno);
if (ret != len)
return KRB5_CC_WRITE;
return KRB5_OK;
@@ -72,7 +73,8 @@ krb5_fcc_write(id, buf, len)
*/
krb5_error_code
-krb5_fcc_store_principal(id, princ)
+krb5_fcc_store_principal(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal princ;
{
@@ -80,8 +82,8 @@ krb5_fcc_store_principal(id, princ)
krb5_error_code ret;
krb5_int32 i, length, tmp, type;
- type = krb5_princ_type(princ);
- tmp = length = krb5_princ_size(princ);
+ type = krb5_princ_type(context, princ);
+ tmp = length = krb5_princ_size(context, princ);
if (data->version == KRB5_FCC_FVNO_1) {
/*
@@ -91,18 +93,18 @@ krb5_fcc_store_principal(id, princ)
*/
tmp++;
} else {
- ret = krb5_fcc_store_int32(id, type);
+ ret = krb5_fcc_store_int32(context, id, type);
CHECK(ret);
}
- ret = krb5_fcc_store_int32(id, tmp);
+ ret = krb5_fcc_store_int32(context, id, tmp);
CHECK(ret);
- ret = krb5_fcc_store_data(id, krb5_princ_realm(princ));
+ ret = krb5_fcc_store_data(context, id, krb5_princ_realm(context, princ));
CHECK(ret);
for (i=0; i < length; i++) {
- ret = krb5_fcc_store_data(id, krb5_princ_component(princ, i));
+ ret = krb5_fcc_store_data(context, id, krb5_princ_component(context, princ, i));
CHECK(ret);
}
@@ -110,7 +112,8 @@ krb5_fcc_store_principal(id, princ)
}
krb5_error_code
-krb5_fcc_store_addrs(id, addrs)
+krb5_fcc_store_addrs(context, id, addrs)
+ krb5_context context;
krb5_ccache id;
krb5_address ** addrs;
{
@@ -125,10 +128,10 @@ krb5_fcc_store_addrs(id, addrs)
length += 1;
}
- ret = krb5_fcc_store_int32(id, length);
+ ret = krb5_fcc_store_int32(context, id, length);
CHECK(ret);
for (i=0; i < length; i++) {
- ret = krb5_fcc_store_addr(id, addrs[i]);
+ ret = krb5_fcc_store_addr(context, id, addrs[i]);
CHECK(ret);
}
@@ -136,54 +139,58 @@ krb5_fcc_store_addrs(id, addrs)
}
krb5_error_code
-krb5_fcc_store_keyblock(id, keyblock)
+krb5_fcc_store_keyblock(context, id, keyblock)
+ krb5_context context;
krb5_ccache id;
krb5_keyblock *keyblock;
{
krb5_fcc_data *data = (krb5_fcc_data *)id->data;
krb5_error_code ret;
- ret = krb5_fcc_store_ui_2(id, keyblock->keytype);
+ ret = krb5_fcc_store_ui_2(context, id, keyblock->keytype);
CHECK(ret);
if ((data->version != KRB5_FCC_FVNO_1) &&
(data->version != KRB5_FCC_FVNO_2)) {
- ret = krb5_fcc_store_ui_2(id, keyblock->etype);
+ ret = krb5_fcc_store_ui_2(context, id, keyblock->etype);
CHECK(ret);
}
- ret = krb5_fcc_store_int32(id, keyblock->length);
+ ret = krb5_fcc_store_int32(context, id, keyblock->length);
CHECK(ret);
- return krb5_fcc_write(id, (char *) keyblock->contents, keyblock->length);
+ return krb5_fcc_write(context, id, (char *) keyblock->contents, keyblock->length);
}
krb5_error_code
-krb5_fcc_store_addr(id, addr)
+krb5_fcc_store_addr(context, id, addr)
+ krb5_context context;
krb5_ccache id;
krb5_address *addr;
{
krb5_error_code ret;
- ret = krb5_fcc_store_ui_2(id, addr->addrtype);
+ ret = krb5_fcc_store_ui_2(context, id, addr->addrtype);
CHECK(ret);
- ret = krb5_fcc_store_int32(id, addr->length);
+ ret = krb5_fcc_store_int32(context, id, addr->length);
CHECK(ret);
- return krb5_fcc_write(id, (char *) addr->contents, addr->length);
+ return krb5_fcc_write(context, id, (char *) addr->contents, addr->length);
}
krb5_error_code
-krb5_fcc_store_data(id, data)
+krb5_fcc_store_data(context, id, data)
+ krb5_context context;
krb5_ccache id;
krb5_data *data;
{
krb5_error_code ret;
- ret = krb5_fcc_store_int32(id, data->length);
+ ret = krb5_fcc_store_int32(context, id, data->length);
CHECK(ret);
- return krb5_fcc_write(id, data->data, data->length);
+ return krb5_fcc_write(context, id, data->data, data->length);
}
krb5_error_code
-krb5_fcc_store_int32(id, i)
+krb5_fcc_store_int32(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 i;
{
@@ -192,7 +199,7 @@ krb5_fcc_store_int32(id, i)
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2))
- return krb5_fcc_write(id, (char *) &i, sizeof(krb5_int32));
+ return krb5_fcc_write(context, id, (char *) &i, sizeof(krb5_int32));
else {
buf[3] = i & 0xFF;
i >>= 8;
@@ -202,12 +209,13 @@ krb5_fcc_store_int32(id, i)
i >>= 8;
buf[0] = i & 0xFF;
- return krb5_fcc_write(id, buf, 4);
+ return krb5_fcc_write(context, id, buf, 4);
}
}
krb5_error_code
-krb5_fcc_store_ui_2(id, i)
+krb5_fcc_store_ui_2(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 i;
{
@@ -218,29 +226,31 @@ krb5_fcc_store_ui_2(id, i)
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2)) {
ibuf = i;
- return krb5_fcc_write(id, (char *) &ibuf, sizeof(krb5_ui_2));
+ return krb5_fcc_write(context, id, (char *) &ibuf, sizeof(krb5_ui_2));
} else {
buf[1] = i & 0xFF;
i >>= 8;
buf[0] = i & 0xFF;
- return krb5_fcc_write(id, buf, 2);
+ return krb5_fcc_write(context, id, buf, 2);
}
}
krb5_error_code
-krb5_fcc_store_octet(id, i)
+krb5_fcc_store_octet(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 i;
{
krb5_octet ibuf;
ibuf = i;
- return krb5_fcc_write(id, (char *) &ibuf, 1);
+ return krb5_fcc_write(context, id, (char *) &ibuf, 1);
}
krb5_error_code
-krb5_fcc_store_times(id, t)
+krb5_fcc_store_times(context, id, t)
+ krb5_context context;
krb5_ccache id;
krb5_ticket_times *t;
{
@@ -249,22 +259,23 @@ krb5_fcc_store_times(id, t)
if ((data->version == KRB5_FCC_FVNO_1) ||
(data->version == KRB5_FCC_FVNO_2))
- return krb5_fcc_write(id, (char *) t, sizeof(krb5_ticket_times));
+ return krb5_fcc_write(context, id, (char *) t, sizeof(krb5_ticket_times));
else {
- retval = krb5_fcc_store_int32(id, t->authtime);
+ retval = krb5_fcc_store_int32(context, id, t->authtime);
CHECK(retval);
- retval = krb5_fcc_store_int32(id, t->starttime);
+ retval = krb5_fcc_store_int32(context, id, t->starttime);
CHECK(retval);
- retval = krb5_fcc_store_int32(id, t->endtime);
+ retval = krb5_fcc_store_int32(context, id, t->endtime);
CHECK(retval);
- retval = krb5_fcc_store_int32(id, t->renew_till);
+ retval = krb5_fcc_store_int32(context, id, t->renew_till);
CHECK(retval);
return 0;
}
}
krb5_error_code
-krb5_fcc_store_authdata(id, a)
+krb5_fcc_store_authdata(context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata **a;
{
@@ -277,24 +288,25 @@ krb5_fcc_store_authdata(id, a)
length++;
}
- ret = krb5_fcc_store_int32(id, length);
+ ret = krb5_fcc_store_int32(context, id, length);
CHECK(ret);
for (i=0; i<length; i++) {
- ret = krb5_fcc_store_authdatum (id, a[i]);
+ ret = krb5_fcc_store_authdatum (context, id, a[i]);
CHECK(ret);
}
return KRB5_OK;
}
krb5_error_code
-krb5_fcc_store_authdatum (id, a)
+krb5_fcc_store_authdatum (context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata *a;
{
krb5_error_code ret;
- ret = krb5_fcc_store_ui_2(id, a->ad_type);
+ ret = krb5_fcc_store_ui_2(context, id, a->ad_type);
CHECK(ret);
- ret = krb5_fcc_store_int32(id, a->length);
+ ret = krb5_fcc_store_int32(context, id, a->length);
CHECK(ret);
- return krb5_fcc_write(id, (krb5_pointer) a->contents, a->length);
+ return krb5_fcc_write(context, id, (krb5_pointer) a->contents, a->length);
}
diff --git a/src/lib/krb5/ccache/stdio/ChangeLog b/src/lib/krb5/ccache/stdio/ChangeLog
index 13a9b22..98f59a2 100644
--- a/src/lib/krb5/ccache/stdio/ChangeLog
+++ b/src/lib/krb5/ccache/stdio/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu)
+
+ * Added krb5_context to all krb5_routines
+
Tue Dec 13 15:42:50 1994 <tytso@rsx-11.mit.edu>
* scc_write.c (krb5_scc_store_addrs): If a null addresses is
diff --git a/src/lib/krb5/ccache/stdio/scc-proto.h b/src/lib/krb5/ccache/stdio/scc-proto.h
index 9cae841..cf2e69f 100644
--- a/src/lib/krb5/ccache/stdio/scc-proto.h
+++ b/src/lib/krb5/ccache/stdio/scc-proto.h
@@ -29,85 +29,203 @@
#define KRB5_SCC_PROTO__
/* scc_close.c */
-krb5_error_code krb5_scc_close PROTOTYPE((krb5_ccache id ));
+krb5_error_code krb5_scc_close
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ));
/* scc_defnam.c */
-char *krb5_scc_default_name PROTOTYPE((void ));
+char *krb5_scc_default_name
+ PROTOTYPE((krb5_context));
/* scc_destry.c */
-krb5_error_code krb5_scc_destroy PROTOTYPE((krb5_ccache id ));
+krb5_error_code krb5_scc_destroy
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ));
/* scc_eseq.c */
-krb5_error_code krb5_scc_end_seq_get PROTOTYPE((krb5_ccache id , krb5_cc_cursor *cursor ));
+krb5_error_code krb5_scc_end_seq_get
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_cc_cursor *cursor ));
/* scc_gennew.c */
-krb5_error_code krb5_scc_generate_new PROTOTYPE((krb5_ccache *id ));
+krb5_error_code krb5_scc_generate_new
+ PROTOTYPE((krb5_context,
+ krb5_ccache *id ));
/* scc_getnam.c */
-char *krb5_scc_get_name PROTOTYPE((krb5_ccache id ));
+char *krb5_scc_get_name
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ));
/* scc_gprin.c */
-krb5_error_code krb5_scc_get_principal PROTOTYPE((krb5_ccache id , krb5_principal *princ ));
+krb5_error_code krb5_scc_get_principal
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_principal *princ ));
/* scc_init.c */
-krb5_error_code krb5_scc_initialize PROTOTYPE((krb5_ccache id , krb5_principal princ ));
+krb5_error_code krb5_scc_initialize
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_principal princ ));
/* scc_maybe.c */
-krb5_error_code krb5_scc_close_file PROTOTYPE((krb5_ccache));
-krb5_error_code krb5_scc_open_file PROTOTYPE((krb5_ccache,int));
+krb5_error_code krb5_scc_close_file
+ PROTOTYPE((krb5_context,
+ krb5_ccache));
+krb5_error_code krb5_scc_open_file
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ int));
/* scc_nseq.c */
-krb5_error_code krb5_scc_next_cred PROTOTYPE((krb5_ccache id , krb5_cc_cursor *cursor , krb5_creds *creds ));
+krb5_error_code krb5_scc_next_cred
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_cc_cursor *cursor ,
+ krb5_creds *creds ));
/* scc_read.c */
-krb5_error_code krb5_scc_read_principal PROTOTYPE((krb5_ccache id , krb5_principal *princ ));
-krb5_error_code krb5_scc_read_keyblock PROTOTYPE((krb5_ccache id , krb5_keyblock *keyblock ));
-krb5_error_code krb5_scc_read_data PROTOTYPE((krb5_ccache id , krb5_data *data ));
-krb5_error_code krb5_scc_read_int32 PROTOTYPE((krb5_ccache id , krb5_int32 *i ));
-krb5_error_code krb5_scc_read_ui_2 PROTOTYPE((krb5_ccache id , krb5_ui_2 *i ));
-krb5_error_code krb5_scc_read_octet PROTOTYPE((krb5_ccache id , krb5_octet *i ));
-krb5_error_code krb5_scc_read_times PROTOTYPE((krb5_ccache id , krb5_ticket_times *t ));
-krb5_error_code krb5_scc_read_addrs PROTOTYPE((krb5_ccache, krb5_address ***));
-krb5_error_code krb5_scc_read_addr PROTOTYPE((krb5_ccache, krb5_address *));
-krb5_error_code krb5_scc_read_authdata PROTOTYPE((krb5_ccache, krb5_authdata***));
-krb5_error_code krb5_scc_read_authdatum PROTOTYPE((krb5_ccache, krb5_authdata*));
+krb5_error_code krb5_scc_read_principal
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_principal *princ ));
+krb5_error_code krb5_scc_read_keyblock
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_keyblock *keyblock ));
+krb5_error_code krb5_scc_read_data
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_data *data ));
+krb5_error_code krb5_scc_read_int32
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_int32 *i ));
+krb5_error_code krb5_scc_read_ui_2
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_ui_2 *i ));
+krb5_error_code krb5_scc_read_octet
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_octet *i ));
+krb5_error_code krb5_scc_read_times
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_ticket_times *t ));
+krb5_error_code krb5_scc_read_addrs
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ krb5_address ***));
+krb5_error_code krb5_scc_read_addr
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ krb5_address *));
+krb5_error_code krb5_scc_read_authdata
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ krb5_authdata***));
+krb5_error_code krb5_scc_read_authdatum
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ krb5_authdata*));
/* scc_reslv.c */
-krb5_error_code krb5_scc_resolve PROTOTYPE((krb5_ccache *id , char *residual ));
+krb5_error_code krb5_scc_resolve
+ PROTOTYPE((krb5_context,
+ krb5_ccache *id ,
+ char *residual ));
/* scc_retrv.c */
-krb5_error_code krb5_scc_retrieve PROTOTYPE((krb5_ccache id , krb5_flags whichfields , krb5_creds *mcreds , krb5_creds *creds ));
+krb5_error_code krb5_scc_retrieve
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_flags whichfields ,
+ krb5_creds *mcreds ,
+ krb5_creds *creds ));
/* scc_sseq.c */
-krb5_error_code krb5_scc_start_seq_get PROTOTYPE((krb5_ccache id , krb5_cc_cursor *cursor ));
+krb5_error_code krb5_scc_start_seq_get
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_cc_cursor *cursor ));
/* scc_store.c */
-krb5_error_code krb5_scc_store PROTOTYPE((krb5_ccache id , krb5_creds *creds ));
+krb5_error_code krb5_scc_store
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_creds *creds ));
/* scc_skip.c */
-krb5_error_code krb5_scc_skip_principal PROTOTYPE((krb5_ccache id ));
+krb5_error_code krb5_scc_skip_principal
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ));
/* scc_sflags.c */
-krb5_error_code krb5_scc_set_flags PROTOTYPE((krb5_ccache id , krb5_flags flags ));
+krb5_error_code krb5_scc_set_flags
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_flags flags ));
/* scc_ops.c */
extern krb5_cc_ops krb5_scc_ops;
/* scc_write.c */
-krb5_error_code krb5_scc_write PROTOTYPE((krb5_ccache id , krb5_pointer buf , int len ));
-krb5_error_code krb5_scc_store_principal PROTOTYPE((krb5_ccache id , krb5_principal princ ));
-krb5_error_code krb5_scc_store_keyblock PROTOTYPE((krb5_ccache id , krb5_keyblock *keyblock ));
-krb5_error_code krb5_scc_store_data PROTOTYPE((krb5_ccache id , krb5_data *data ));
-krb5_error_code krb5_scc_store_int32 PROTOTYPE((krb5_ccache id , krb5_int32 i ));
-krb5_error_code krb5_scc_store_ui_2 PROTOTYPE((krb5_ccache id , krb5_int32 i ));
-krb5_error_code krb5_scc_store_octet PROTOTYPE((krb5_ccache id , krb5_int32 i ));
-krb5_error_code krb5_scc_store_times PROTOTYPE((krb5_ccache id , krb5_ticket_times *t ));
-krb5_error_code krb5_scc_store_addrs PROTOTYPE((krb5_ccache , krb5_address ** ));
-krb5_error_code krb5_scc_store_addr PROTOTYPE((krb5_ccache , krb5_address * ));
-krb5_error_code krb5_scc_store_authdata PROTOTYPE((krb5_ccache, krb5_authdata **));
-krb5_error_code krb5_scc_store_authdatum PROTOTYPE((krb5_ccache, krb5_authdata *));
+krb5_error_code krb5_scc_write
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_pointer buf ,
+ int len ));
+krb5_error_code krb5_scc_store_principal
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_principal princ ));
+krb5_error_code krb5_scc_store_keyblock
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_keyblock *keyblock ));
+krb5_error_code krb5_scc_store_data
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_data *data ));
+krb5_error_code krb5_scc_store_int32
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_int32 i ));
+krb5_error_code krb5_scc_store_ui_2
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_int32 i ));
+krb5_error_code krb5_scc_store_octet
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_int32 i ));
+krb5_error_code krb5_scc_store_times
+ PROTOTYPE((krb5_context,
+ krb5_ccache id ,
+ krb5_ticket_times *t ));
+krb5_error_code krb5_scc_store_addrs
+ PROTOTYPE((krb5_context,
+ krb5_ccache ,
+ krb5_address ** ));
+krb5_error_code krb5_scc_store_addr
+ PROTOTYPE((krb5_context,
+ krb5_ccache ,
+ krb5_address * ));
+krb5_error_code krb5_scc_store_authdata
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ krb5_authdata **));
+krb5_error_code krb5_scc_store_authdatum
+ PROTOTYPE((krb5_context,
+ krb5_ccache,
+ krb5_authdata *));
/* scc_errs.c */
-krb5_error_code krb5_scc_interpret PROTOTYPE((int ));
+krb5_error_code krb5_scc_interpret
+ PROTOTYPE((krb5_context,
+ int ));
#endif /* KRB5_SCC_PROTO__ */
diff --git a/src/lib/krb5/ccache/stdio/scc.h b/src/lib/krb5/ccache/stdio/scc.h
index 203b316..0a7ae01 100644
--- a/src/lib/krb5/ccache/stdio/scc.h
+++ b/src/lib/krb5/ccache/stdio/scc.h
@@ -79,16 +79,16 @@ typedef struct _krb5_scc_cursor {
long pos;
} krb5_scc_cursor;
-#define MAYBE_OPEN(ID, MODE) \
+#define MAYBE_OPEN(context, ID, MODE) \
{ \
if (OPENCLOSE (ID)) { \
- krb5_error_code maybe_open_ret = krb5_scc_open_file (ID,MODE); \
+ krb5_error_code maybe_open_ret = krb5_scc_open_file (context, ID,MODE); \
if (maybe_open_ret) return maybe_open_ret; } }
-#define MAYBE_CLOSE(ID, RET) \
+#define MAYBE_CLOSE(context, ID, RET) \
{ \
if (OPENCLOSE (ID)) { \
- krb5_error_code maybe_close_ret = krb5_scc_close_file (ID); \
+ krb5_error_code maybe_close_ret = krb5_scc_close_file (context, ID); \
if (!(RET)) RET = maybe_close_ret; } }
/* DO NOT ADD ANYTHING AFTER THIS #endif */
diff --git a/src/lib/krb5/ccache/stdio/scc_close.c b/src/lib/krb5/ccache/stdio/scc_close.c
index 760aed3..77f6d6b 100644
--- a/src/lib/krb5/ccache/stdio/scc_close.c
+++ b/src/lib/krb5/ccache/stdio/scc_close.c
@@ -37,7 +37,8 @@
* associated with the cache.
*/
krb5_error_code
-krb5_scc_close(id)
+krb5_scc_close(context, id)
+ krb5_context context;
krb5_ccache id;
{
register int closeval = KRB5_OK;
@@ -47,7 +48,7 @@ krb5_scc_close(id)
closeval = fclose (data->file);
data->file = 0;
if (closeval == -1) {
- closeval = krb5_scc_interpret(errno);
+ closeval = krb5_scc_interpret(context, errno);
} else
closeval = KRB5_OK;
diff --git a/src/lib/krb5/ccache/stdio/scc_defnam.c b/src/lib/krb5/ccache/stdio/scc_defnam.c
index c62a598..bf4d15d 100644
--- a/src/lib/krb5/ccache/stdio/scc_defnam.c
+++ b/src/lib/krb5/ccache/stdio/scc_defnam.c
@@ -49,7 +49,8 @@ static char krb5_default_name_string[KRB5_SCC_MAXLEN] = "";
*/
char *
-krb5_scc_default_name ()
+krb5_scc_default_name (context)
+ krb5_context context;
{
char *krb5ccache, *getenv();
int len;
diff --git a/src/lib/krb5/ccache/stdio/scc_destry.c b/src/lib/krb5/ccache/stdio/scc_destry.c
index 88e261c..7b1db87 100644
--- a/src/lib/krb5/ccache/stdio/scc_destry.c
+++ b/src/lib/krb5/ccache/stdio/scc_destry.c
@@ -39,7 +39,8 @@
* Errors:
* system errors
*/
-krb5_error_code krb5_scc_destroy(id)
+krb5_error_code krb5_scc_destroy(context, id)
+ krb5_context context;
krb5_ccache id;
{
#if 0
@@ -56,7 +57,7 @@ krb5_error_code krb5_scc_destroy(id)
ret = remove (data->filename);
if (ret < 0) {
- ret = krb5_scc_interpret(errno);
+ ret = krb5_scc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) fclose(data->file);
data->file = 0;
@@ -72,7 +73,7 @@ krb5_error_code krb5_scc_destroy(id)
*/
ret = fstat(fileno(data->file), &buf);
if (ret < 0) {
- ret = krb5_scc_interpret(errno);
+ ret = krb5_scc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) fclose(data->file);
data->file = 0;
@@ -86,7 +87,7 @@ krb5_error_code krb5_scc_destroy(id)
memset (zeros, 0, BUFSIZ);
for (i=0; i < size / BUFSIZ; i++)
if (fwrite(data->file, zeros, BUFSIZ) < 0) {
- ret = krb5_scc_interpret(errno);
+ ret = krb5_scc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) fclose(data->file);
data->file = 0;
@@ -95,7 +96,7 @@ krb5_error_code krb5_scc_destroy(id)
}
if (fwrite(data->file, zeros, size % BUFSIZ) < 0) {
- ret = krb5_scc_interpret(errno);
+ ret = krb5_scc_interpret(context, errno);
if (OPENCLOSE(id)) {
(void) fclose(data->file);
data->file = 0;
@@ -108,7 +109,7 @@ krb5_error_code krb5_scc_destroy(id)
#endif
if (ret)
- ret = krb5_scc_interpret(errno);
+ ret = krb5_scc_interpret(context, errno);
cleanup:
krb5_xfree(data->filename);
diff --git a/src/lib/krb5/ccache/stdio/scc_errs.c b/src/lib/krb5/ccache/stdio/scc_errs.c
index ad3c645..77ad352 100644
--- a/src/lib/krb5/ccache/stdio/scc_errs.c
+++ b/src/lib/krb5/ccache/stdio/scc_errs.c
@@ -29,7 +29,8 @@
#include "scc.h"
krb5_error_code
-krb5_scc_interpret(errnum)
+krb5_scc_interpret(context, errnum)
+ krb5_context context;
int errnum;
{
register int retval;
diff --git a/src/lib/krb5/ccache/stdio/scc_eseq.c b/src/lib/krb5/ccache/stdio/scc_eseq.c
index d49b7b8..f8cf9c0 100644
--- a/src/lib/krb5/ccache/stdio/scc_eseq.c
+++ b/src/lib/krb5/ccache/stdio/scc_eseq.c
@@ -41,12 +41,13 @@
*/
/* ARGSUSED */
krb5_error_code
-krb5_scc_end_seq_get(id, cursor)
+krb5_scc_end_seq_get(context, id, cursor)
+ krb5_context context;
krb5_ccache id;
krb5_cc_cursor *cursor;
{
int ret = KRB5_OK;
-/* MAYBE_CLOSE (id, ret);*/
+/* MAYBE_CLOSE (context, id, ret);*/
krb5_xfree((krb5_scc_cursor *) *cursor);
diff --git a/src/lib/krb5/ccache/stdio/scc_gennew.c b/src/lib/krb5/ccache/stdio/scc_gennew.c
index 7775a6f..8851ddb 100644
--- a/src/lib/krb5/ccache/stdio/scc_gennew.c
+++ b/src/lib/krb5/ccache/stdio/scc_gennew.c
@@ -52,7 +52,8 @@ extern krb5_cc_ops krb5_scc_ops;
* system errors (from open)
*/
krb5_error_code
-krb5_scc_generate_new (id)
+krb5_scc_generate_new (context, id)
+ krb5_context context;
krb5_ccache *id;
{
krb5_ccache lid;
@@ -99,19 +100,19 @@ krb5_scc_generate_new (id)
f = fopen (((krb5_scc_data *) lid->data)->filename, "w+");
#endif
if (!f) {
- retcode = krb5_scc_interpret (errno);
+ retcode = krb5_scc_interpret (context, errno);
goto err_out;
} else {
krb5_int16 scc_fvno = htons(KRB5_SCC_DEFAULT_FVNO);
if (!fwrite((char *)&scc_fvno, sizeof(scc_fvno), 1, f)) {
- retcode = krb5_scc_interpret(errno);
+ retcode = krb5_scc_interpret(context, errno);
(void) fclose(f);
(void) remove(((krb5_scc_data *) lid->data)->filename);
goto err_out;
}
if (fclose(f) == EOF) {
- retcode = krb5_scc_interpret(errno);
+ retcode = krb5_scc_interpret(context, errno);
(void) remove(((krb5_scc_data *) lid->data)->filename);
goto err_out;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_getnam.c b/src/lib/krb5/ccache/stdio/scc_getnam.c
index 61f55d1..0303c10 100644
--- a/src/lib/krb5/ccache/stdio/scc_getnam.c
+++ b/src/lib/krb5/ccache/stdio/scc_getnam.c
@@ -36,7 +36,8 @@
* The name of the file cred cache id.
*/
char *
-krb5_scc_get_name (id)
+krb5_scc_get_name (context, id)
+ krb5_context context;
krb5_ccache id;
{
return (char *) ((krb5_scc_data *) id->data)->filename;
diff --git a/src/lib/krb5/ccache/stdio/scc_gprin.c b/src/lib/krb5/ccache/stdio/scc_gprin.c
index 2054fed..3f6c90d 100644
--- a/src/lib/krb5/ccache/stdio/scc_gprin.c
+++ b/src/lib/krb5/ccache/stdio/scc_gprin.c
@@ -41,18 +41,19 @@
* KRB5_CC_NOMEM
*/
krb5_error_code
-krb5_scc_get_principal(id, princ)
+krb5_scc_get_principal(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal *princ;
{
krb5_error_code kret;
- MAYBE_OPEN (id, SCC_OPEN_RDONLY);
+ MAYBE_OPEN (context, id, SCC_OPEN_RDONLY);
/* skip over vno at beginning of file */
fseek(((krb5_scc_data *) id->data)->file, sizeof(krb5_int16), 0);
- kret = krb5_scc_read_principal(id, princ);
+ kret = krb5_scc_read_principal(context, id, princ);
- MAYBE_CLOSE (id, kret);
+ MAYBE_CLOSE (context, id, kret);
return kret;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_init.c b/src/lib/krb5/ccache/stdio/scc_init.c
index b3bde42..ff765f9 100644
--- a/src/lib/krb5/ccache/stdio/scc_init.c
+++ b/src/lib/krb5/ccache/stdio/scc_init.c
@@ -41,20 +41,21 @@
* permission errors
*/
krb5_error_code
-krb5_scc_initialize(id, princ)
+krb5_scc_initialize(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal princ;
{
int ret;
- ret = krb5_scc_open_file (id, SCC_OPEN_AND_ERASE);
+ ret = krb5_scc_open_file (context, id, SCC_OPEN_AND_ERASE);
if (ret < 0)
- return krb5_scc_interpret(errno);
+ return krb5_scc_interpret(context, errno);
#if 0
ret = fchmod(((krb5_scc_data *) id->data)->fd, S_IREAD | S_IWRITE);
if (ret == -1) {
- ret = krb5_scc_interpret(errno);
+ ret = krb5_scc_interpret(context, errno);
if (OPENCLOSE(id)) {
close(((krb5_scc_data *)id->data)->fd);
((krb5_scc_data *) id->data)->fd = -1;
@@ -62,9 +63,9 @@ krb5_scc_initialize(id, princ)
return ret;
}
#endif
- krb5_scc_store_principal(id, princ);
+ krb5_scc_store_principal(context, id, princ);
- MAYBE_CLOSE (id, ret);
+ MAYBE_CLOSE (context, id, ret);
return ret;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_maybe.c b/src/lib/krb5/ccache/stdio/scc_maybe.c
index 410dc6b..e337fe5 100644
--- a/src/lib/krb5/ccache/stdio/scc_maybe.c
+++ b/src/lib/krb5/ccache/stdio/scc_maybe.c
@@ -40,7 +40,8 @@
int krb5_scc_default_format = KRB5_SCC_DEFAULT_FVNO;
krb5_error_code
-krb5_scc_close_file (id)
+krb5_scc_close_file (context, id)
+ krb5_context context;
krb5_ccache id;
{
krb5_scc_data *data;
@@ -63,22 +64,23 @@ krb5_scc_close_file (id)
memset (data->stdio_buffer, 0, sizeof (data->stdio_buffer));
if (ret == EOF) {
int errsave = errno;
- (void) krb5_unlock_file(data->file, data->filename);
+ (void) krb5_unlock_file(context, data->file, data->filename);
(void) fclose (data->file);
data->file = 0;
- return krb5_scc_interpret (errsave);
+ return krb5_scc_interpret (context, errsave);
}
- retval = krb5_unlock_file(data->file, data->filename);
+ retval = krb5_unlock_file(context, data->file, data->filename);
ret = fclose (data->file);
data->file = 0;
if (retval)
return retval;
else
- return ret ? krb5_scc_interpret (errno) : 0;
+ return ret ? krb5_scc_interpret (context, errno) : 0;
}
krb5_error_code
-krb5_scc_open_file (id, mode)
+krb5_scc_open_file (context, id, mode)
+ krb5_context context;
krb5_ccache id;
int mode;
{
@@ -91,7 +93,7 @@ krb5_scc_open_file (id, mode)
data = (krb5_scc_data *) id->data;
if (data->file) {
/* Don't know what state it's in; shut down and start anew. */
- (void) krb5_unlock_file(data->file, data->filename);
+ (void) krb5_unlock_file(context, data->file, data->filename);
(void) fclose (data->file);
data->file = 0;
}
@@ -125,7 +127,7 @@ krb5_scc_open_file (id, mode)
f = fopen (data->filename, open_flag);
if (!f)
- return krb5_scc_interpret (errno);
+ return krb5_scc_interpret (context, errno);
#ifdef HAS_SETVBUF
setvbuf(f, data->stdio_buffer, _IOFBF, sizeof (data->stdio_buffer));
#else
@@ -133,14 +135,14 @@ krb5_scc_open_file (id, mode)
#endif
switch (mode) {
case SCC_OPEN_RDONLY:
- if (retval = krb5_lock_file(f, data->filename, KRB5_LOCKMODE_SHARED)) {
+ if (retval = krb5_lock_file(context, f, data->filename, KRB5_LOCKMODE_SHARED)) {
(void) fclose(f);
return retval;
}
break;
case SCC_OPEN_RDWR:
case SCC_OPEN_AND_ERASE:
- if (retval = krb5_lock_file(f, data->filename,
+ if (retval = krb5_lock_file(context, f, data->filename,
KRB5_LOCKMODE_EXCLUSIVE)) {
(void) fclose(f);
return retval;
@@ -155,21 +157,21 @@ krb5_scc_open_file (id, mode)
data->version = krb5_scc_default_format;
if (!fwrite((char *)&scc_fvno, sizeof(scc_fvno), 1, f)) {
errsave = errno;
- (void) krb5_unlock_file(f, data->filename);
+ (void) krb5_unlock_file(context, f, data->filename);
(void) fclose(f);
- return krb5_scc_interpret(errsave);
+ return krb5_scc_interpret(context, errsave);
}
} else {
/* verify a valid version number is there */
if (!fread((char *)&scc_fvno, sizeof(scc_fvno), 1, f)) {
- (void) krb5_unlock_file(f, data->filename);
+ (void) krb5_unlock_file(context, f, data->filename);
(void) fclose(f);
return KRB5_CCACHE_BADVNO;
}
if ((scc_fvno != htons(KRB5_SCC_FVNO_1)) &&
(scc_fvno != htons(KRB5_SCC_FVNO_2)) &&
(scc_fvno != htons(KRB5_SCC_FVNO_3))) {
- (void) krb5_unlock_file(f, data->filename);
+ (void) krb5_unlock_file(context, f, data->filename);
(void) fclose(f);
return KRB5_CCACHE_BADVNO;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_nseq.c b/src/lib/krb5/ccache/stdio/scc_nseq.c
index 365f573..49f9e25 100644
--- a/src/lib/krb5/ccache/stdio/scc_nseq.c
+++ b/src/lib/krb5/ccache/stdio/scc_nseq.c
@@ -49,7 +49,8 @@
* system errors
*/
krb5_error_code
-krb5_scc_next_cred(id, cursor, creds)
+krb5_scc_next_cred(context, id, cursor, creds)
+ krb5_context context;
krb5_ccache id;
krb5_cc_cursor *cursor;
krb5_creds *creds;
@@ -71,37 +72,37 @@ krb5_scc_next_cred(id, cursor, creds)
Z (addresses);
#undef Z
- MAYBE_OPEN (id, SCC_OPEN_RDONLY);
+ MAYBE_OPEN (context, id, SCC_OPEN_RDONLY);
fcursor = (krb5_scc_cursor *) *cursor;
ret = fseek(((krb5_scc_data *) id->data)->file, fcursor->pos, 0);
if (ret < 0) {
- ret = krb5_scc_interpret(errno);
- MAYBE_CLOSE (id, ret);
+ ret = krb5_scc_interpret(context, errno);
+ MAYBE_CLOSE (context, id, ret);
return ret;
}
- kret = krb5_scc_read_principal(id, &creds->client);
+ kret = krb5_scc_read_principal(context, id, &creds->client);
TCHECK(kret);
- kret = krb5_scc_read_principal(id, &creds->server);
+ kret = krb5_scc_read_principal(context, id, &creds->server);
TCHECK(kret);
- kret = krb5_scc_read_keyblock(id, &creds->keyblock);
+ kret = krb5_scc_read_keyblock(context, id, &creds->keyblock);
TCHECK(kret);
- kret = krb5_scc_read_times(id, &creds->times);
+ kret = krb5_scc_read_times(context, id, &creds->times);
TCHECK(kret);
- kret = krb5_scc_read_octet(id, &octet);
+ kret = krb5_scc_read_octet(context, id, &octet);
TCHECK(kret);
creds->is_skey = octet;
- kret = krb5_scc_read_int32(id, &int32);
+ kret = krb5_scc_read_int32(context, id, &int32);
TCHECK(kret);
creds->ticket_flags = int32;
- kret = krb5_scc_read_addrs(id, &creds->addresses);
+ kret = krb5_scc_read_addrs(context, id, &creds->addresses);
TCHECK(kret);
- kret = krb5_scc_read_authdata (id, &creds->authdata);
+ kret = krb5_scc_read_authdata (context, id, &creds->authdata);
TCHECK (kret);
- kret = krb5_scc_read_data(id, &creds->ticket);
+ kret = krb5_scc_read_data(context, id, &creds->ticket);
TCHECK(kret);
- kret = krb5_scc_read_data(id, &creds->second_ticket);
+ kret = krb5_scc_read_data(context, id, &creds->second_ticket);
TCHECK(kret);
fcursor->pos = ftell(((krb5_scc_data *) id->data)->file);
@@ -109,8 +110,8 @@ krb5_scc_next_cred(id, cursor, creds)
lose:
if (kret != KRB5_OK) {
- krb5_free_cred_contents(creds);
+ krb5_free_cred_contents(context, creds);
}
- MAYBE_CLOSE (id, kret);
+ MAYBE_CLOSE (context, id, kret);
return kret;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_read.c b/src/lib/krb5/ccache/stdio/scc_read.c
index 1a7ee5a..29dbdb9 100644
--- a/src/lib/krb5/ccache/stdio/scc_read.c
+++ b/src/lib/krb5/ccache/stdio/scc_read.c
@@ -39,7 +39,8 @@
* system errors (read)
*/
krb5_error_code
-krb5_scc_read(id, buf, len)
+krb5_scc_read(context, id, buf, len)
+ krb5_context context;
krb5_ccache id;
krb5_pointer buf;
int len;
@@ -49,7 +50,7 @@ krb5_scc_read(id, buf, len)
errno = 0;
ret = fread((char *) buf, 1, len, ((krb5_scc_data *) id->data)->file);
if ((ret == 0) && errno)
- return krb5_scc_interpret(errno);
+ return krb5_scc_interpret(context, errno);
else if (ret != len)
return KRB5_CC_END;
else
@@ -74,7 +75,8 @@ krb5_scc_read(id, buf, len)
*/
krb5_error_code
-krb5_scc_read_principal(id, princ)
+krb5_scc_read_principal(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal *princ;
{
@@ -88,13 +90,13 @@ krb5_scc_read_principal(id, princ)
type = KRB5_NT_UNKNOWN;
} else {
/* Read principal type */
- kret = krb5_scc_read_int32(id, &type);
+ kret = krb5_scc_read_int32(context, id, &type);
if (kret != KRB5_OK)
return kret;
}
/* Read the number of components */
- kret = krb5_scc_read_int32(id, &length);
+ kret = krb5_scc_read_int32(context, id, &length);
if (kret != KRB5_OK)
return kret;
@@ -120,13 +122,13 @@ krb5_scc_read_principal(id, princ)
tmpprinc->length = length;
tmpprinc->type = type;
- kret = krb5_scc_read_data(id, krb5_princ_realm(tmpprinc));
+ kret = krb5_scc_read_data(context, id, krb5_princ_realm(context, tmpprinc));
i = 0;
CHECK(kret);
for (i=0; i < length; i++) {
- kret = krb5_scc_read_data(id, krb5_princ_component(tmpprinc, i));
+ kret = krb5_scc_read_data(context, id, krb5_princ_component(context, tmpprinc, i));
CHECK(kret);
}
*princ = tmpprinc;
@@ -134,14 +136,15 @@ krb5_scc_read_principal(id, princ)
errout:
while(--i >= 0)
- free(krb5_princ_component(tmpprinc, i)->data);
+ free(krb5_princ_component(context, tmpprinc, i)->data);
free((char *)tmpprinc->data);
free((char *)tmpprinc);
return kret;
}
krb5_error_code
-krb5_scc_read_addrs(id, addrs)
+krb5_scc_read_addrs(context, id, addrs)
+ krb5_context context;
krb5_ccache id;
krb5_address ***addrs;
{
@@ -152,7 +155,7 @@ krb5_scc_read_addrs(id, addrs)
*addrs = 0;
/* Read the number of components */
- kret = krb5_scc_read_int32(id, &length);
+ kret = krb5_scc_read_int32(context, id, &length);
CHECK(kret);
/* Make *addrs able to hold length pointers to krb5_address structs
@@ -165,22 +168,23 @@ krb5_scc_read_addrs(id, addrs)
for (i=0; i < length; i++) {
(*addrs)[i] = (krb5_address *) malloc(sizeof(krb5_address));
if ((*addrs)[i] == NULL) {
- krb5_free_addresses(*addrs);
+ krb5_free_addresses(context, *addrs);
return KRB5_CC_NOMEM;
}
- kret = krb5_scc_read_addr(id, (*addrs)[i]);
+ kret = krb5_scc_read_addr(context, id, (*addrs)[i]);
CHECK(kret);
}
return KRB5_OK;
errout:
if (*addrs)
- krb5_free_addresses(*addrs);
+ krb5_free_addresses(context, *addrs);
return kret;
}
krb5_error_code
-krb5_scc_read_keyblock(id, keyblock)
+krb5_scc_read_keyblock(context, id, keyblock)
+ krb5_context context;
krb5_ccache id;
krb5_keyblock *keyblock;
{
@@ -192,19 +196,19 @@ krb5_scc_read_keyblock(id, keyblock)
keyblock->magic = KV5M_KEYBLOCK;
keyblock->contents = 0;
- kret = krb5_scc_read_ui_2(id, &ui2);
+ kret = krb5_scc_read_ui_2(context, id, &ui2);
keyblock->keytype = ui2;
CHECK(kret);
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2))
keyblock->etype = ETYPE_UNKNOWN;
else {
- kret = krb5_scc_read_ui_2(id, &ui2);
+ kret = krb5_scc_read_ui_2(context, id, &ui2);
keyblock->etype = ui2;
CHECK(kret);
}
- kret = krb5_scc_read_int32(id, &int32);
+ kret = krb5_scc_read_int32(context, id, &int32);
CHECK(kret);
keyblock->length = int32;
if ( keyblock->length == 0 )
@@ -214,7 +218,7 @@ krb5_scc_read_keyblock(id, keyblock)
if (keyblock->contents == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_scc_read(id, keyblock->contents, keyblock->length);
+ kret = krb5_scc_read(context, id, keyblock->contents, keyblock->length);
if (kret)
goto errout;
@@ -226,7 +230,8 @@ krb5_scc_read_keyblock(id, keyblock)
}
krb5_error_code
-krb5_scc_read_data(id, data)
+krb5_scc_read_data(context, id, data)
+ krb5_context context;
krb5_ccache id;
krb5_data *data;
{
@@ -235,7 +240,7 @@ krb5_scc_read_data(id, data)
data->magic = KV5M_DATA;
data->data = 0;
- kret = krb5_scc_read_int32(id, &data->length);
+ kret = krb5_scc_read_int32(context, id, &data->length);
CHECK(kret);
if (data->length == 0) {
@@ -247,7 +252,7 @@ krb5_scc_read_data(id, data)
if (data->data == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_scc_read(id, data->data, data->length);
+ kret = krb5_scc_read(context, id, data->data, data->length);
CHECK(kret);
data->data[data->length] = 0; /* Null terminate, just in case.... */
@@ -259,7 +264,8 @@ krb5_scc_read_data(id, data)
}
krb5_error_code
-krb5_scc_read_addr(id, addr)
+krb5_scc_read_addr(context, id, addr)
+ krb5_context context;
krb5_ccache id;
krb5_address *addr;
{
@@ -270,11 +276,11 @@ krb5_scc_read_addr(id, addr)
addr->magic = KV5M_ADDRESS;
addr->contents = 0;
- kret = krb5_scc_read_ui_2(id, &ui2);
+ kret = krb5_scc_read_ui_2(context, id, &ui2);
CHECK(kret);
addr->addrtype = ui2;
- kret = krb5_scc_read_int32(id, &int32);
+ kret = krb5_scc_read_int32(context, id, &int32);
CHECK(kret);
addr->length = int32;
@@ -285,7 +291,7 @@ krb5_scc_read_addr(id, addr)
if (addr->contents == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_scc_read(id, addr->contents, addr->length);
+ kret = krb5_scc_read(context, id, addr->contents, addr->length);
CHECK(kret);
return KRB5_OK;
@@ -296,7 +302,8 @@ krb5_scc_read_addr(id, addr)
}
krb5_error_code
-krb5_scc_read_int32(id, i)
+krb5_scc_read_int32(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 *i;
{
@@ -306,9 +313,9 @@ krb5_scc_read_int32(id, i)
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2))
- return krb5_scc_read(id, (krb5_pointer) i, sizeof(krb5_int32));
+ return krb5_scc_read(context, id, (krb5_pointer) i, sizeof(krb5_int32));
else {
- retval = krb5_scc_read(id, buf, 4);
+ retval = krb5_scc_read(context, id, buf, 4);
if (retval)
return retval;
*i = (((((buf[0] << 8) + buf[1]) << 8 ) + buf[2]) << 8) + buf[3];
@@ -317,7 +324,8 @@ krb5_scc_read_int32(id, i)
}
krb5_error_code
-krb5_scc_read_ui_2(id, i)
+krb5_scc_read_ui_2(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_ui_2 *i;
{
@@ -327,9 +335,9 @@ krb5_scc_read_ui_2(id, i)
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2))
- return krb5_scc_read(id, (krb5_pointer) i, sizeof(krb5_ui_2));
+ return krb5_scc_read(context, id, (krb5_pointer) i, sizeof(krb5_ui_2));
else {
- retval = krb5_scc_read(id, buf, 2);
+ retval = krb5_scc_read(context, id, buf, 2);
if (retval)
return retval;
*i = (buf[0] << 8) + buf[1];
@@ -338,16 +346,18 @@ krb5_scc_read_ui_2(id, i)
}
krb5_error_code
-krb5_scc_read_octet(id, i)
+krb5_scc_read_octet(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_octet *i;
{
- return krb5_scc_read(id, (krb5_pointer) i, 1);
+ return krb5_scc_read(context, id, (krb5_pointer) i, 1);
}
krb5_error_code
-krb5_scc_read_times(id, t)
+krb5_scc_read_times(context, id, t)
+ krb5_context context;
krb5_ccache id;
krb5_ticket_times *t;
{
@@ -357,21 +367,21 @@ krb5_scc_read_times(id, t)
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2))
- return krb5_scc_read(id, (krb5_pointer) t, sizeof(krb5_ticket_times));
+ return krb5_scc_read(context, id, (krb5_pointer) t, sizeof(krb5_ticket_times));
else {
- retval = krb5_scc_read_int32(id, &i);
+ retval = krb5_scc_read_int32(context, id, &i);
CHECK(retval);
t->authtime = i;
- retval = krb5_scc_read_int32(id, &i);
+ retval = krb5_scc_read_int32(context, id, &i);
CHECK(retval);
t->starttime = i;
- retval = krb5_scc_read_int32(id, &i);
+ retval = krb5_scc_read_int32(context, id, &i);
CHECK(retval);
t->endtime = i;
- retval = krb5_scc_read_int32(id, &i);
+ retval = krb5_scc_read_int32(context, id, &i);
CHECK(retval);
t->renew_till = i;
}
@@ -381,7 +391,8 @@ errout:
}
krb5_error_code
-krb5_scc_read_authdata(id, a)
+krb5_scc_read_authdata(context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata ***a;
{
@@ -392,7 +403,7 @@ krb5_scc_read_authdata(id, a)
*a = 0;
/* Read the number of components */
- kret = krb5_scc_read_int32(id, &length);
+ kret = krb5_scc_read_int32(context, id, &length);
CHECK(kret);
if (length == 0)
@@ -408,22 +419,23 @@ krb5_scc_read_authdata(id, a)
for (i=0; i < length; i++) {
(*a)[i] = (krb5_authdata *) malloc(sizeof(krb5_authdata));
if ((*a)[i] == NULL) {
- krb5_free_authdata(*a);
+ krb5_free_authdata(context, *a);
return KRB5_CC_NOMEM;
}
- kret = krb5_scc_read_authdatum(id, (*a)[i]);
+ kret = krb5_scc_read_authdatum(context, id, (*a)[i]);
CHECK(kret);
}
return KRB5_OK;
errout:
if (*a)
- krb5_free_authdata(*a);
+ krb5_free_authdata(context, *a);
return kret;
}
krb5_error_code
-krb5_scc_read_authdatum(id, a)
+krb5_scc_read_authdatum(context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata *a;
{
@@ -434,9 +446,9 @@ krb5_scc_read_authdatum(id, a)
a->magic = KV5M_AUTHDATA;
a->contents = NULL;
- kret = krb5_scc_read_ui_2(id, &a->ad_type);
+ kret = krb5_scc_read_ui_2(context, id, &a->ad_type);
CHECK(kret);
- kret = krb5_scc_read_int32(id, &int32);
+ kret = krb5_scc_read_int32(context, id, &int32);
CHECK(kret);
a->length = int32;
@@ -447,7 +459,7 @@ krb5_scc_read_authdatum(id, a)
if (a->contents == NULL)
return KRB5_CC_NOMEM;
- kret = krb5_scc_read(id, a->contents, a->length);
+ kret = krb5_scc_read(context, id, a->contents, a->length);
CHECK(kret);
return KRB5_OK;
diff --git a/src/lib/krb5/ccache/stdio/scc_reslv.c b/src/lib/krb5/ccache/stdio/scc_reslv.c
index 40c3e81..1add343 100644
--- a/src/lib/krb5/ccache/stdio/scc_reslv.c
+++ b/src/lib/krb5/ccache/stdio/scc_reslv.c
@@ -50,7 +50,8 @@ extern krb5_cc_ops krb5_scc_ops;
* permission errors
*/
krb5_error_code
-krb5_scc_resolve (id, residual)
+krb5_scc_resolve (context, id, residual)
+ krb5_context context;
krb5_ccache *id;
char *residual;
{
diff --git a/src/lib/krb5/ccache/stdio/scc_retrv.c b/src/lib/krb5/ccache/stdio/scc_retrv.c
index 865bdcb..5b20ad5 100644
--- a/src/lib/krb5/ccache/stdio/scc_retrv.c
+++ b/src/lib/krb5/ccache/stdio/scc_retrv.c
@@ -57,23 +57,25 @@ times_match_exact (t1, t2)
}
static krb5_boolean
-standard_fields_match(mcreds, creds)
+standard_fields_match(context, mcreds, creds)
+ krb5_context context;
register const krb5_creds *mcreds, *creds;
{
- return (krb5_principal_compare(mcreds->client,creds->client) &&
- krb5_principal_compare(mcreds->server,creds->server));
+ return (krb5_principal_compare(context, mcreds->client,creds->client) &&
+ krb5_principal_compare(context, mcreds->server,creds->server));
}
/* only match the server name portion, not the server realm portion */
static krb5_boolean
-srvname_match(mcreds, creds)
+srvname_match(context, mcreds, creds)
+ krb5_context context;
register const krb5_creds *mcreds, *creds;
{
krb5_boolean retval;
krb5_principal_data p1, p2;
- retval = krb5_principal_compare(mcreds->client,creds->client);
+ retval = krb5_principal_compare(context, mcreds->client,creds->client);
if (retval != TRUE)
return retval;
/*
@@ -82,7 +84,7 @@ register const krb5_creds *mcreds, *creds;
p1 = *mcreds->server;
p2 = *creds->server;
p1.realm = p2.realm;
- return krb5_principal_compare(&p1, &p2);
+ return krb5_principal_compare(context, &p1, &p2);
}
@@ -153,7 +155,8 @@ register const krb5_data *data1, *data2;
* KRB5_CC_NOMEM
*/
krb5_error_code
-krb5_scc_retrieve(id, whichfields, mcreds, creds)
+krb5_scc_retrieve(context, id, whichfields, mcreds, creds)
+ krb5_context context;
krb5_ccache id;
krb5_flags whichfields;
krb5_creds *mcreds;
@@ -166,11 +169,11 @@ krb5_scc_retrieve(id, whichfields, mcreds, creds)
krb5_error_code kret;
krb5_creds fetchcreds;
- kret = krb5_scc_start_seq_get(id, &cursor);
+ kret = krb5_scc_start_seq_get(context, id, &cursor);
if (kret != KRB5_OK)
return kret;
- while ((kret = krb5_scc_next_cred(id, &cursor, &fetchcreds)) == KRB5_OK) {
+ while ((kret = krb5_scc_next_cred(context, id, &cursor, &fetchcreds)) == KRB5_OK) {
if (((set(KRB5_TC_MATCH_SRV_NAMEONLY) &&
srvname_match(mcreds, &fetchcreds)) ||
standard_fields_match(mcreds, &fetchcreds))
@@ -197,16 +200,16 @@ krb5_scc_retrieve(id, whichfields, mcreds, creds)
data_match (&mcreds->second_ticket, &fetchcreds.second_ticket))
)
{
- krb5_scc_end_seq_get(id, &cursor);
+ krb5_scc_end_seq_get(context, id, &cursor);
*creds = fetchcreds;
return KRB5_OK;
}
/* This one doesn't match */
- krb5_free_cred_contents(&fetchcreds);
+ krb5_free_cred_contents(context, &fetchcreds);
}
/* If we get here, a match wasn't found */
- krb5_scc_end_seq_get(id, &cursor);
+ krb5_scc_end_seq_get(context, id, &cursor);
return KRB5_CC_NOTFOUND;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_sflags.c b/src/lib/krb5/ccache/stdio/scc_sflags.c
index f025898..89ec826 100644
--- a/src/lib/krb5/ccache/stdio/scc_sflags.c
+++ b/src/lib/krb5/ccache/stdio/scc_sflags.c
@@ -40,7 +40,8 @@
* Sets the operational flags of id to flags.
*/
krb5_error_code
-krb5_scc_set_flags(id, flags)
+krb5_scc_set_flags(context, id, flags)
+ krb5_context context;
krb5_ccache id;
krb5_flags flags;
{
@@ -50,12 +51,12 @@ krb5_scc_set_flags(id, flags)
if (flags & KRB5_TC_OPENCLOSE) {
/* asking to turn on OPENCLOSE mode */
if (!OPENCLOSE(id))
- ret = krb5_scc_close_file (id);
+ ret = krb5_scc_close_file (context, id);
} else {
/* asking to turn off OPENCLOSE mode, meaning it must be
left open. We open if it's not yet open */
if (OPENCLOSE(id)) {
- ret = krb5_scc_open_file (id, SCC_OPEN_RDWR);
+ ret = krb5_scc_open_file (context, id, SCC_OPEN_RDWR);
}
}
diff --git a/src/lib/krb5/ccache/stdio/scc_skip.c b/src/lib/krb5/ccache/stdio/scc_skip.c
index 40ea25b..0182402 100644
--- a/src/lib/krb5/ccache/stdio/scc_skip.c
+++ b/src/lib/krb5/ccache/stdio/scc_skip.c
@@ -29,17 +29,18 @@
#include "scc.h"
krb5_error_code
-krb5_scc_skip_principal(id)
+krb5_scc_skip_principal(context, id)
+ krb5_context context;
krb5_ccache id;
{
krb5_error_code kret;
krb5_principal princ;
- kret = krb5_scc_read_principal(id, &princ);
+ kret = krb5_scc_read_principal(context, id, &princ);
if (kret != KRB5_OK)
return kret;
- krb5_free_principal(princ);
+ krb5_free_principal(context, princ);
return KRB5_OK;
}
diff --git a/src/lib/krb5/ccache/stdio/scc_sseq.c b/src/lib/krb5/ccache/stdio/scc_sseq.c
index 2aec05b..f1971c5 100644
--- a/src/lib/krb5/ccache/stdio/scc_sseq.c
+++ b/src/lib/krb5/ccache/stdio/scc_sseq.c
@@ -42,7 +42,8 @@
* system errors
*/
krb5_error_code
-krb5_scc_start_seq_get(id, cursor)
+krb5_scc_start_seq_get(context, id, cursor)
+ krb5_context context;
krb5_ccache id;
krb5_cc_cursor *cursor;
{
@@ -54,14 +55,14 @@ krb5_scc_start_seq_get(id, cursor)
return KRB5_CC_NOMEM;
/* Make sure we start reading right after the primary principal */
- MAYBE_OPEN (id, SCC_OPEN_RDONLY);
+ MAYBE_OPEN (context, id, SCC_OPEN_RDONLY);
/* skip over vno at beginning of file */
fseek(((krb5_scc_data *) id->data)->file, sizeof(krb5_int16), 0);
- krb5_scc_skip_principal(id);
+ krb5_scc_skip_principal(context, id);
fcursor->pos = ftell(((krb5_scc_data *) id->data)->file);
*cursor = (krb5_cc_cursor) fcursor;
- MAYBE_CLOSE (id, ret);
+ MAYBE_CLOSE (context, id, ret);
return(ret);
}
diff --git a/src/lib/krb5/ccache/stdio/scc_store.c b/src/lib/krb5/ccache/stdio/scc_store.c
index f8bd090..71b0621 100644
--- a/src/lib/krb5/ccache/stdio/scc_store.c
+++ b/src/lib/krb5/ccache/stdio/scc_store.c
@@ -40,7 +40,8 @@
* storage failure errors
*/
krb5_error_code
-krb5_scc_store(id, creds)
+krb5_scc_store(context, id, creds)
+ krb5_context context;
krb5_ccache id;
krb5_creds *creds;
{
@@ -48,36 +49,36 @@ krb5_scc_store(id, creds)
krb5_error_code ret;
/* Make sure we are writing to the end of the file */
- MAYBE_OPEN (id, SCC_OPEN_RDWR);
+ MAYBE_OPEN (context, id, SCC_OPEN_RDWR);
ret = fseek(((krb5_scc_data *) id->data)->file, 0, 2);
if (ret < 0)
- return krb5_scc_interpret(errno);
+ return krb5_scc_interpret(context, errno);
- ret = krb5_scc_store_principal(id, creds->client);
+ ret = krb5_scc_store_principal(context, id, creds->client);
TCHECK(ret);
- ret = krb5_scc_store_principal(id, creds->server);
+ ret = krb5_scc_store_principal(context, id, creds->server);
TCHECK(ret);
- ret = krb5_scc_store_keyblock(id, &creds->keyblock);
+ ret = krb5_scc_store_keyblock(context, id, &creds->keyblock);
TCHECK(ret);
- ret = krb5_scc_store_times(id, &creds->times);
+ ret = krb5_scc_store_times(context, id, &creds->times);
TCHECK(ret);
- ret = krb5_scc_store_octet(id, creds->is_skey);
+ ret = krb5_scc_store_octet(context, id, creds->is_skey);
TCHECK(ret);
- ret = krb5_scc_store_int32(id, creds->ticket_flags);
+ ret = krb5_scc_store_int32(context, id, creds->ticket_flags);
TCHECK(ret);
- ret = krb5_scc_store_addrs(id, creds->addresses);
+ ret = krb5_scc_store_addrs(context, id, creds->addresses);
TCHECK(ret);
- ret = krb5_scc_store_authdata(id, creds->authdata);
+ ret = krb5_scc_store_authdata(context, id, creds->authdata);
TCHECK(ret);
- ret = krb5_scc_store_data(id, &creds->ticket);
+ ret = krb5_scc_store_data(context, id, &creds->ticket);
TCHECK(ret);
- ret = krb5_scc_store_data(id, &creds->second_ticket);
+ ret = krb5_scc_store_data(context, id, &creds->second_ticket);
TCHECK(ret);
lose:
- MAYBE_CLOSE (id, ret);
+ MAYBE_CLOSE (context, id, ret);
return ret;
#undef TCHECK
}
diff --git a/src/lib/krb5/ccache/stdio/scc_test.c b/src/lib/krb5/ccache/stdio/scc_test.c
index c76058e..d948292 100644
--- a/src/lib/krb5/ccache/stdio/scc_test.c
+++ b/src/lib/krb5/ccache/stdio/scc_test.c
@@ -125,9 +125,9 @@ void scc_test()
init_test_cred();
- kret = krb5_scc_resolve(&id, "/tmp/tkt_test");
+ kret = krb5_scc_resolve(context, &id, "/tmp/tkt_test");
CHECK(kret, "resolve");
- kret = krb5_scc_initialize(id, test_creds.client);
+ kret = krb5_scc_initialize(context, id, test_creds.client);
CHECK(kret, "initialize");
kret = krb5_scc_store(id, &test_creds);
CHECK(kret, "store");
diff --git a/src/lib/krb5/ccache/stdio/scc_write.c b/src/lib/krb5/ccache/stdio/scc_write.c
index db6015d..9226bb1 100644
--- a/src/lib/krb5/ccache/stdio/scc_write.c
+++ b/src/lib/krb5/ccache/stdio/scc_write.c
@@ -41,7 +41,8 @@
* system errors
*/
krb5_error_code
-krb5_scc_write(id, buf, len)
+krb5_scc_write(context, id, buf, len)
+ krb5_context context;
krb5_ccache id;
krb5_pointer buf;
int len;
@@ -51,7 +52,7 @@ krb5_scc_write(id, buf, len)
errno = 0;
ret = fwrite((char *) buf, 1, len, ((krb5_scc_data *)id->data)->file);
if ((ret == 0) && errno) {
- return krb5_scc_interpret (errno);
+ return krb5_scc_interpret (context, errno);
} else if (ret != len)
return KRB5_CC_END;
return KRB5_OK;
@@ -72,7 +73,8 @@ krb5_scc_write(id, buf, len)
*/
krb5_error_code
-krb5_scc_store_principal(id, princ)
+krb5_scc_store_principal(context, id, princ)
+ krb5_context context;
krb5_ccache id;
krb5_principal princ;
{
@@ -80,8 +82,8 @@ krb5_scc_store_principal(id, princ)
krb5_error_code ret;
krb5_int32 i, length, tmp, type;
- type = krb5_princ_type(princ);
- tmp = length = krb5_princ_size(princ);
+ type = krb5_princ_type(context, princ);
+ tmp = length = krb5_princ_size(context, princ);
if (data->version == KRB5_SCC_FVNO_1) {
/*
@@ -91,18 +93,19 @@ krb5_scc_store_principal(id, princ)
*/
tmp++;
} else {
- ret = krb5_scc_store_int32(id, type);
+ ret = krb5_scc_store_int32(context, id, type);
CHECK(ret);
}
- ret = krb5_scc_store_int32(id, tmp);
+ ret = krb5_scc_store_int32(context, id, tmp);
CHECK(ret);
- ret = krb5_scc_store_data(id, krb5_princ_realm(princ));
+ ret = krb5_scc_store_data(context, id, krb5_princ_realm(context, princ));
CHECK(ret);
for (i=0; i < length; i++) {
- ret = krb5_scc_store_data(id, krb5_princ_component(princ, i));
+ ret = krb5_scc_store_data(context, id,
+ krb5_princ_component(context, princ, i));
CHECK(ret);
}
@@ -110,7 +113,8 @@ krb5_scc_store_principal(id, princ)
}
krb5_error_code
-krb5_scc_store_addrs(id, addrs)
+krb5_scc_store_addrs(context, id, addrs)
+ krb5_context context;
krb5_ccache id;
krb5_address ** addrs;
{
@@ -125,10 +129,10 @@ krb5_scc_store_addrs(id, addrs)
length += 1;
}
- ret = krb5_scc_store_int32(id, length);
+ ret = krb5_scc_store_int32(context, id, length);
CHECK(ret);
for (i=0; i < length; i++) {
- ret = krb5_scc_store_addr(id, addrs[i]);
+ ret = krb5_scc_store_addr(context, id, addrs[i]);
CHECK(ret);
}
@@ -136,54 +140,58 @@ krb5_scc_store_addrs(id, addrs)
}
krb5_error_code
-krb5_scc_store_keyblock(id, keyblock)
+krb5_scc_store_keyblock(context, id, keyblock)
+ krb5_context context;
krb5_ccache id;
krb5_keyblock *keyblock;
{
krb5_scc_data *data = (krb5_scc_data *)id->data;
krb5_error_code ret;
- ret = krb5_scc_store_ui_2(id, keyblock->keytype);
+ ret = krb5_scc_store_ui_2(context, id, keyblock->keytype);
CHECK(ret);
if ((data->version != KRB5_SCC_FVNO_1) &&
(data->version != KRB5_SCC_FVNO_2)) {
- ret = krb5_scc_store_ui_2(id, keyblock->etype);
+ ret = krb5_scc_store_ui_2(context, id, keyblock->etype);
CHECK(ret);
}
- ret = krb5_scc_store_int32(id, keyblock->length);
+ ret = krb5_scc_store_int32(context, id, keyblock->length);
CHECK(ret);
- return krb5_scc_write(id, (char *) keyblock->contents, keyblock->length);
+ return krb5_scc_write(context, id, (char *) keyblock->contents, keyblock->length);
}
krb5_error_code
-krb5_scc_store_addr(id, addr)
+krb5_scc_store_addr(context, id, addr)
+ krb5_context context;
krb5_ccache id;
krb5_address *addr;
{
krb5_error_code ret;
- ret = krb5_scc_store_ui_2(id, addr->addrtype);
+ ret = krb5_scc_store_ui_2(context, id, addr->addrtype);
CHECK(ret);
- ret = krb5_scc_store_int32(id, addr->length);
+ ret = krb5_scc_store_int32(context, id, addr->length);
CHECK(ret);
- return krb5_scc_write(id, (char *) addr->contents, addr->length);
+ return krb5_scc_write(context, id, (char *) addr->contents, addr->length);
}
krb5_error_code
-krb5_scc_store_data(id, data)
+krb5_scc_store_data(context, id, data)
+ krb5_context context;
krb5_ccache id;
krb5_data *data;
{
krb5_error_code ret;
- ret = krb5_scc_store_int32(id, data->length);
+ ret = krb5_scc_store_int32(context, id, data->length);
CHECK(ret);
- return krb5_scc_write(id, data->data, data->length);
+ return krb5_scc_write(context, id, data->data, data->length);
}
krb5_error_code
-krb5_scc_store_int32(id, i)
+krb5_scc_store_int32(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 i;
{
@@ -192,7 +200,7 @@ krb5_scc_store_int32(id, i)
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2))
- return krb5_scc_write(id, (char *) &i, sizeof(krb5_int32));
+ return krb5_scc_write(context, id, (char *) &i, sizeof(krb5_int32));
else {
buf[3] = i & 0xFF;
i >>= 8;
@@ -202,12 +210,13 @@ krb5_scc_store_int32(id, i)
i >>= 8;
buf[0] = i & 0xFF;
- return krb5_scc_write(id, buf, 4);
+ return krb5_scc_write(context, id, buf, 4);
}
}
krb5_error_code
-krb5_scc_store_ui_2(id, i)
+krb5_scc_store_ui_2(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 i;
{
@@ -218,29 +227,31 @@ krb5_scc_store_ui_2(id, i)
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2)) {
ibuf = i;
- return krb5_scc_write(id, (char *) &ibuf, sizeof(krb5_ui_2));
+ return krb5_scc_write(context, id, (char *) &ibuf, sizeof(krb5_ui_2));
} else {
buf[1] = i & 0xFF;
i >>= 8;
buf[0] = i & 0xFF;
- return krb5_scc_write(id, buf, 2);
+ return krb5_scc_write(context, id, buf, 2);
}
}
krb5_error_code
-krb5_scc_store_octet(id, i)
+krb5_scc_store_octet(context, id, i)
+ krb5_context context;
krb5_ccache id;
krb5_int32 i;
{
krb5_octet ibuf;
ibuf = i;
- return krb5_scc_write(id, (char *) &ibuf, 1);
+ return krb5_scc_write(context, id, (char *) &ibuf, 1);
}
krb5_error_code
-krb5_scc_store_times(id, t)
+krb5_scc_store_times(context, id, t)
+ krb5_context context;
krb5_ccache id;
krb5_ticket_times *t;
{
@@ -249,22 +260,23 @@ krb5_scc_store_times(id, t)
if ((data->version == KRB5_SCC_FVNO_1) ||
(data->version == KRB5_SCC_FVNO_2))
- return krb5_scc_write(id, (char *) t, sizeof(krb5_ticket_times));
+ return krb5_scc_write(context, id, (char *) t, sizeof(krb5_ticket_times));
else {
- retval = krb5_scc_store_int32(id, t->authtime);
+ retval = krb5_scc_store_int32(context, id, t->authtime);
CHECK(retval);
- retval = krb5_scc_store_int32(id, t->starttime);
+ retval = krb5_scc_store_int32(context, id, t->starttime);
CHECK(retval);
- retval = krb5_scc_store_int32(id, t->endtime);
+ retval = krb5_scc_store_int32(context, id, t->endtime);
CHECK(retval);
- retval = krb5_scc_store_int32(id, t->renew_till);
+ retval = krb5_scc_store_int32(context, id, t->renew_till);
CHECK(retval);
return 0;
}
}
krb5_error_code
-krb5_scc_store_authdata(id, a)
+krb5_scc_store_authdata(context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata **a;
{
@@ -277,24 +289,25 @@ krb5_scc_store_authdata(id, a)
length++;
}
- ret = krb5_scc_store_int32(id, length);
+ ret = krb5_scc_store_int32(context, id, length);
CHECK(ret);
for (i=0; i<length; i++) {
- ret = krb5_scc_store_authdatum (id, a[i]);
+ ret = krb5_scc_store_authdatum (context, id, a[i]);
CHECK(ret);
}
return KRB5_OK;
}
krb5_error_code
-krb5_scc_store_authdatum (id, a)
+krb5_scc_store_authdatum (context, id, a)
+ krb5_context context;
krb5_ccache id;
krb5_authdata *a;
{
krb5_error_code ret;
- ret = krb5_scc_store_ui_2(id, a->ad_type);
+ ret = krb5_scc_store_ui_2(context, id, a->ad_type);
CHECK(ret);
- ret = krb5_scc_store_int32(id, a->length);
+ ret = krb5_scc_store_int32(context, id, a->length);
CHECK(ret);
- return krb5_scc_write(id, (krb5_pointer) a->contents, a->length);
+ return krb5_scc_write(context, id, (krb5_pointer) a->contents, a->length);
}