From d30251dac62e3a24130bb1fd8aa7f9bbf818f1a7 Mon Sep 17 00:00:00 2001 From: Chris Provenzano Date: Fri, 13 Jan 1995 21:25:00 +0000 Subject: [PATCH] Removed all references to DECLARG and OLDDECLARG. Added krb5_context to all krb5_routines. Moved init_ctx.c to init_os_ctx.c because a library cannot have more than on file with the same name. See krb5/krb/init_ctx.c git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4811 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/ChangeLog | 7 ++++++ src/lib/krb5/os/Makefile.in | 4 +-- src/lib/krb5/os/an_to_ln.c | 49 +++++++++++++++++++----------------- src/lib/krb5/os/ccdefname.c | 3 ++- src/lib/krb5/os/def_realm.c | 5 ++-- src/lib/krb5/os/free_hstrl.c | 7 +++--- src/lib/krb5/os/free_krbhs.c | 5 ++-- src/lib/krb5/os/full_ipadr.c | 11 ++++---- src/lib/krb5/os/gen_port.c | 11 ++++---- src/lib/krb5/os/gen_rname.c | 11 ++++---- src/lib/krb5/os/get_krbhst.c | 7 +++--- src/lib/krb5/os/hst_realm.c | 9 ++++--- src/lib/krb5/os/krbfileio.c | 6 +++-- src/lib/krb5/os/ktdefname.c | 7 +++--- src/lib/krb5/os/kuserok.c | 11 ++++---- src/lib/krb5/os/locate_kdc.c | 5 ++-- src/lib/krb5/os/lock_file.c | 9 ++++--- src/lib/krb5/os/net_read.c | 9 ++++--- src/lib/krb5/os/net_write.c | 9 ++++--- src/lib/krb5/os/os-proto.h | 12 ++++++--- src/lib/krb5/os/port2ip.c | 9 ++++--- src/lib/krb5/os/read_msg.c | 7 +++--- src/lib/krb5/os/read_pwd.c | 11 ++++---- src/lib/krb5/os/realm_dom.c | 5 ++-- src/lib/krb5/os/sendto_kdc.c | 13 +++++----- src/lib/krb5/os/sn2princ.c | 24 ++++++++---------- src/lib/krb5/os/timeofday.c | 5 ++-- src/lib/krb5/os/unlck_file.c | 9 ++++--- src/lib/krb5/os/ustime.c | 5 ++-- src/lib/krb5/os/write_msg.c | 7 +++--- 30 files changed, 163 insertions(+), 129 deletions(-) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 24e6fa39f..97afbcf2c 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,10 @@ +Fri Jan 13 15:23:47 1995 Chris Provenzano (proven@mit.edu) + + * Added krb5_context to all krb5_routines + + * Moved init_ctx.c to init_os_ctx.c because a library cannot + have more than on file with the same name. See krb/init_ctx.c + Mon Dec 19 15:20:35 1994 Theodore Y. Ts'o (tytso@dcl) * init_ctx.c: New file. Initializes and frees the krb5_os_context diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in index fdde15904..badf4c093 100644 --- a/src/lib/krb5/os/Makefile.in +++ b/src/lib/krb5/os/Makefile.in @@ -15,7 +15,7 @@ OBJS= \ gen_rname.o \ gmt_mktime.o \ hst_realm.o \ - init_ctx.o \ + init_os_ctx.o \ krbfileio.o \ ktdefname.o \ kuserok.o \ @@ -48,7 +48,7 @@ SRCS= \ $(srcdir)/gen_rname.c \ $(srcdir)/gmt_mktime.c \ $(srcdir)/hst_realm.c \ - $(srcdir)/init_ctx.c \ + $(srcdir)/init_os_ctx.c \ $(srcdir)/krbfileio.c \ $(srcdir)/ktdefname.c \ $(srcdir)/kuserok.c \ diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index 1c7c814fd..de4633c9a 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -60,7 +60,8 @@ int krb5_lname_username_fallback = 1; extern char *krb5_lname_file; krb5_error_code -krb5_aname_to_localname(aname, lnsize, lname) +krb5_aname_to_localname(context, aname, lnsize, lname) + krb5_context context; krb5_const_principal aname; const int lnsize; char *lname; @@ -68,9 +69,9 @@ krb5_aname_to_localname(aname, lnsize, lname) struct stat statbuf; if (!stat(krb5_lname_file,&statbuf)) - return dbm_an_to_ln(aname, lnsize, lname); + return dbm_an_to_ln(context, aname, lnsize, lname); if (krb5_lname_username_fallback) - return username_an_to_ln(aname, lnsize, lname); + return username_an_to_ln(context, aname, lnsize, lname); return KRB5_LNAME_CANTOPEN; } @@ -82,17 +83,18 @@ krb5_aname_to_localname(aname, lnsize, lname) * null in the DBM datum.size. */ static krb5_error_code -dbm_an_to_ln(aname, lnsize, lname) -krb5_const_principal aname; -const int lnsize; -char *lname; +dbm_an_to_ln(context, aname, lnsize, lname) + krb5_context context; + krb5_const_principal aname; + const int lnsize; + char *lname; { DBM *db; krb5_error_code retval; datum key, contents; char *princ_name; - if (retval = krb5_unparse_name(aname, &princ_name)) + if (retval = krb5_unparse_name(context, aname, &princ_name)) return(retval); key.dptr = princ_name; key.dsize = strlen(princ_name)+1; /* need to store the NULL for @@ -130,32 +132,33 @@ char *lname; * that name is returned as the lname. */ static krb5_error_code -username_an_to_ln(aname, lnsize, lname) -krb5_const_principal aname; -const int lnsize; -char *lname; +username_an_to_ln(context, aname, lnsize, lname) + krb5_context context; + krb5_const_principal aname; + const int lnsize; + char *lname; { krb5_error_code retval; char *def_realm; int realm_length; - realm_length = krb5_princ_realm(aname)->length; + realm_length = krb5_princ_realm(context, aname)->length; - if (retval = krb5_get_default_realm(&def_realm)) { + if (retval = krb5_get_default_realm(context, &def_realm)) { return(retval); } if ((realm_length != strlen(def_realm)) || - (memcmp(def_realm, krb5_princ_realm(aname)->data, realm_length))) { + (memcmp(def_realm, krb5_princ_realm(context, aname)->data, realm_length))) { free(def_realm); return KRB5_LNAME_NOTRANS; } - if (krb5_princ_size(aname) != 1) { - if (krb5_princ_size(aname) == 2 ) { + if (krb5_princ_size(context, aname) != 1) { + if (krb5_princ_size(context, aname) == 2 ) { /* Check to see if 2nd component is the local realm. */ - if ( strncmp(krb5_princ_component(aname,1)->data,def_realm, + if ( strncmp(krb5_princ_component(context, aname,1)->data,def_realm, realm_length) || - realm_length != krb5_princ_component(aname,1)->length) + realm_length != krb5_princ_component(context, aname,1)->length) return KRB5_LNAME_NOTRANS; } else @@ -165,12 +168,12 @@ char *lname; } free(def_realm); - strncpy(lname, krb5_princ_component(aname,0)->data, - min(krb5_princ_component(aname,0)->length,lnsize)); - if (lnsize < krb5_princ_component(aname,0)->length ) { + strncpy(lname, krb5_princ_component(context, aname,0)->data, + min(krb5_princ_component(context, aname,0)->length,lnsize)); + if (lnsize < krb5_princ_component(context, aname,0)->length ) { retval = KRB5_CONFIG_NOTENUFSPACE; } else { - lname[krb5_princ_component(aname,0)->length] = '\0'; + lname[krb5_princ_component(context, aname,0)->length] = '\0'; retval = 0; } return retval; diff --git a/src/lib/krb5/os/ccdefname.c b/src/lib/krb5/os/ccdefname.c index 9906663a7..dde631c71 100644 --- a/src/lib/krb5/os/ccdefname.c +++ b/src/lib/krb5/os/ccdefname.c @@ -31,7 +31,8 @@ #include #include -char *krb5_cc_default_name() +char *krb5_cc_default_name(context) + krb5_context context; { char *name = getenv(KRB5_ENV_CCNAME); static char *name_buf; diff --git a/src/lib/krb5/os/def_realm.c b/src/lib/krb5/os/def_realm.c index d235baa38..0685d2081 100644 --- a/src/lib/krb5/os/def_realm.c +++ b/src/lib/krb5/os/def_realm.c @@ -55,8 +55,9 @@ extern char *krb5_override_default_realm; char *krb5_override_default_realm = 0; krb5_error_code -krb5_get_default_realm(lrealm) -char **lrealm; +krb5_get_default_realm(context, lrealm) + krb5_context context; + char **lrealm; { FILE *config_file; char realmbuf[BUFSIZ]; diff --git a/src/lib/krb5/os/free_hstrl.c b/src/lib/krb5/os/free_hstrl.c index 25d1756a8..4945dab56 100644 --- a/src/lib/krb5/os/free_hstrl.c +++ b/src/lib/krb5/os/free_hstrl.c @@ -36,9 +36,10 @@ */ krb5_error_code -krb5_free_host_realm(realmlist) -char * const *realmlist; +krb5_free_host_realm(context, realmlist) + krb5_context context; + char * const *realmlist; { /* same format, so why duplicate code? */ - return krb5_free_krbhst(realmlist); + return krb5_free_krbhst(context, realmlist); } diff --git a/src/lib/krb5/os/free_krbhs.c b/src/lib/krb5/os/free_krbhs.c index 482ebeaf6..c0326d612 100644 --- a/src/lib/krb5/os/free_krbhs.c +++ b/src/lib/krb5/os/free_krbhs.c @@ -34,8 +34,9 @@ */ krb5_error_code -krb5_free_krbhst(hostlist) -char * const *hostlist; +krb5_free_krbhst(context, hostlist) + krb5_context context; + char * const *hostlist; { register char * const *cp; diff --git a/src/lib/krb5/os/full_ipadr.c b/src/lib/krb5/os/full_ipadr.c index 474cd2e2c..10d26eb2d 100644 --- a/src/lib/krb5/os/full_ipadr.c +++ b/src/lib/krb5/os/full_ipadr.c @@ -36,12 +36,11 @@ #include krb5_error_code -krb5_make_full_ipaddr(DECLARG(krb5_int32, adr), - DECLARG(krb5_int16, port), - DECLARG(krb5_address **,outaddr)) -OLDDECLARG(krb5_int32, adr) -OLDDECLARG(krb5_int16, port) -OLDDECLARG(krb5_address **,outaddr) +krb5_make_full_ipaddr(context, adr, port, outaddr) + krb5_context context; + krb5_int32 adr; + krb5_int16 port; + krb5_address ** outaddr; { unsigned long smushaddr = (unsigned long) adr; /* already in net order */ unsigned short smushport = (unsigned short) port; /* ditto */ diff --git a/src/lib/krb5/os/gen_port.c b/src/lib/krb5/os/gen_port.c index 4ab65e495..33ebd3d44 100644 --- a/src/lib/krb5/os/gen_port.c +++ b/src/lib/krb5/os/gen_port.c @@ -32,10 +32,11 @@ #include "os-proto.h" krb5_error_code -krb5_gen_portaddr(addr, ptr, outaddr) -const krb5_address *addr; -krb5_const_pointer ptr; -krb5_address **outaddr; +krb5_gen_portaddr(context, addr, ptr, outaddr) + krb5_context context; + const krb5_address *addr; + krb5_const_pointer ptr; + krb5_address **outaddr; { #ifdef KRB5_USE_INET krb5_int32 adr; @@ -46,7 +47,7 @@ krb5_address **outaddr; port = *(krb5_int16 *)ptr; memcpy((char *)&adr, (char *)addr->contents, sizeof(adr)); - return krb5_make_full_ipaddr(adr, port, outaddr); + return krb5_make_full_ipaddr(context, adr, port, outaddr); #else return KRB5_PROG_ATYPE_NOSUPP; #endif diff --git a/src/lib/krb5/os/gen_rname.c b/src/lib/krb5/os/gen_rname.c index e491600b8..26c770fcd 100644 --- a/src/lib/krb5/os/gen_rname.c +++ b/src/lib/krb5/os/gen_rname.c @@ -39,10 +39,11 @@ #endif krb5_error_code -krb5_gen_replay_name(address, uniq, string) -const krb5_address *address; -const char *uniq; -char **string; +krb5_gen_replay_name(context, address, uniq, string) + krb5_context context; + const krb5_address *address; + const char *uniq; + char **string; { #ifdef KRB5_USE_INET krb5_int16 port; @@ -51,7 +52,7 @@ char **string; register char *tmp, *tmp2; struct in_addr inaddr; - if (retval = krb5_unpack_full_ipaddr(address, &addr, &port)) + if (retval = krb5_unpack_full_ipaddr(context, address, &addr, &port)) return retval; inaddr.s_addr = addr; diff --git a/src/lib/krb5/os/get_krbhst.c b/src/lib/krb5/os/get_krbhst.c index 3d9a9c7ff..f39c7302f 100644 --- a/src/lib/krb5/os/get_krbhst.c +++ b/src/lib/krb5/os/get_krbhst.c @@ -60,9 +60,10 @@ extern char *krb5_config_file; /* extern so can be set at load/runtime */ krb5_error_code -krb5_get_krbhst(realm, hostlist) -krb5_data *realm; -char ***hostlist; +krb5_get_krbhst(context, realm, hostlist) + krb5_context context; + krb5_data *realm; + char ***hostlist; { FILE *config_file; char filebuf[BUFSIZ]; diff --git a/src/lib/krb5/os/hst_realm.c b/src/lib/krb5/os/hst_realm.c index 5b8cc7a3f..3f1768b77 100644 --- a/src/lib/krb5/os/hst_realm.c +++ b/src/lib/krb5/os/hst_realm.c @@ -81,9 +81,10 @@ extern char *krb5_trans_file; krb5_error_code -krb5_get_host_realm(host, realmsp) -const char *host; -char ***realmsp; +krb5_get_host_realm(context, host, realmsp) + krb5_context context; + const char *host; + char ***realmsp; { char **retrealms; char *domain; @@ -120,7 +121,7 @@ char ***realmsp; if (islower(*cp)) *cp = toupper(*cp); } else { - if (retval = krb5_get_default_realm(&retrealms[0])) { + if (retval = krb5_get_default_realm(context, &retrealms[0])) { krb5_xfree(retrealms); return retval; } diff --git a/src/lib/krb5/os/krbfileio.c b/src/lib/krb5/os/krbfileio.c index 83bb6b7e1..139493e62 100644 --- a/src/lib/krb5/os/krbfileio.c +++ b/src/lib/krb5/os/krbfileio.c @@ -50,7 +50,8 @@ static char *VersionID = "@(#)krbfileio.c 2 - 08/22/91"; #endif krb5_error_code -krb5_create_secure_file(pathname) +krb5_create_secure_file(context, pathname) + krb5_context context; const char * pathname; { int fd; @@ -88,7 +89,8 @@ krb5_create_secure_file(pathname) } krb5_error_code -krb5_sync_disk_file(fp) +krb5_sync_disk_file(context, fp) + krb5_context context; FILE *fp; { fflush(fp); diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index 620bbaa1a..bc0bf48c3 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -33,9 +33,10 @@ extern char *krb5_defkeyname; krb5_error_code -krb5_kt_default_name(name, namesize) -char *name; -int namesize; +krb5_kt_default_name(context, name, namesize) + krb5_context context; + char *name; + int namesize; { strncpy(name, krb5_defkeyname, namesize); if (namesize < strlen(krb5_defkeyname)) diff --git a/src/lib/krb5/os/kuserok.c b/src/lib/krb5/os/kuserok.c index 589b165e8..e7fa04ad0 100644 --- a/src/lib/krb5/os/kuserok.c +++ b/src/lib/krb5/os/kuserok.c @@ -62,9 +62,10 @@ */ krb5_boolean -krb5_kuserok(principal, luser) -krb5_principal principal; -const char *luser; +krb5_kuserok(context, principal, luser) + krb5_context context; + krb5_principal principal; + const char *luser; { struct stat sbuf; struct passwd *pwd; @@ -91,13 +92,13 @@ const char *luser; * krb5_aname_to_localname to convert the principal to a name * which we can string compare. */ - if (!(krb5_aname_to_localname(principal, + if (!(krb5_aname_to_localname(context, principal, sizeof(kuser), kuser)) && (strcmp(kuser, luser) == 0)) { return(TRUE); } } - if (krb5_unparse_name(principal, &princname)) + if (krb5_unparse_name(context, principal, &princname)) return(FALSE); /* no hope of matching */ /* open ~/.k5login */ diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 0e277935f..fa1f5e04e 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -50,7 +50,8 @@ extern char *krb5_kdc_sec_udp_portname; */ krb5_error_code -krb5_locate_kdc(realm, addr_pp, naddrs) +krb5_locate_kdc(context, realm, addr_pp, naddrs) + krb5_context context; const krb5_data *realm; struct sockaddr **addr_pp; int *naddrs; @@ -69,7 +70,7 @@ krb5_locate_kdc(realm, addr_pp, naddrs) hostlist = 0; - if (code = krb5_get_krbhst (realm, &hostlist)) + if (code = krb5_get_krbhst (context, realm, &hostlist)) return(code); #ifdef KRB5_USE_INET diff --git a/src/lib/krb5/os/lock_file.c b/src/lib/krb5/os/lock_file.c index eb45b4519..9e342f429 100644 --- a/src/lib/krb5/os/lock_file.c +++ b/src/lib/krb5/os/lock_file.c @@ -54,10 +54,11 @@ extern int errno; /*ARGSUSED*/ krb5_error_code -krb5_lock_file(filep, pathname, mode) -FILE *filep; -char *pathname; -int mode; +krb5_lock_file(context, filep, pathname, mode) + krb5_context context; + FILE *filep; + char *pathname; + int mode; { #ifdef POSIX_FILE_LOCKS int lock_cmd = F_SETLKW; diff --git a/src/lib/krb5/os/net_read.c b/src/lib/krb5/os/net_read.c index c996a0c35..89394d564 100644 --- a/src/lib/krb5/os/net_read.c +++ b/src/lib/krb5/os/net_read.c @@ -37,10 +37,11 @@ */ int -krb5_net_read(fd, buf, len) -int fd; -register char *buf; -register int len; +krb5_net_read(context, fd, buf, len) + krb5_context context; + int fd; + register char *buf; + register int len; { int cc, len2 = 0; diff --git a/src/lib/krb5/os/net_write.c b/src/lib/krb5/os/net_write.c index 26a71b337..5d07fd415 100644 --- a/src/lib/krb5/os/net_write.c +++ b/src/lib/krb5/os/net_write.c @@ -36,10 +36,11 @@ */ int -krb5_net_write(fd, buf, len) -int fd; -register const char *buf; -int len; +krb5_net_write(context, fd, buf, len) + krb5_context context; + int fd; + register const char *buf; + int len; { int cc; register int wrlen = len; diff --git a/src/lib/krb5/os/os-proto.h b/src/lib/krb5/os/os-proto.h index fbc6dd53f..f23bb6646 100644 --- a/src/lib/krb5/os/os-proto.h +++ b/src/lib/krb5/os/os-proto.h @@ -29,25 +29,29 @@ #ifdef SOCK_DGRAM /* XXX hack... */ krb5_error_code krb5_locate_kdc - PROTOTYPE((const krb5_data *, + PROTOTYPE((krb5_context, + const krb5_data *, struct sockaddr **, int *)); #endif #ifdef KRB5_USE_INET krb5_error_code krb5_unpack_full_ipaddr - PROTOTYPE((const krb5_address *, + PROTOTYPE((krb5_context, + const krb5_address *, krb5_int32 *, krb5_int16 *)); #ifdef NARROW_PROTOTYPES krb5_error_code krb5_make_full_ipaddr - PROTOTYPE((krb5_int32, + PROTOTYPE((krb5_context, + krb5_int32, krb5_int16, krb5_address **)); #else krb5_error_code krb5_make_full_ipaddr - PROTOTYPE((krb5_int32, + PROTOTYPE((krb5_context, + krb5_int32, int, /* unsigned short promotes to signed int */ krb5_address **)); diff --git a/src/lib/krb5/os/port2ip.c b/src/lib/krb5/os/port2ip.c index 0fee77866..77750752f 100644 --- a/src/lib/krb5/os/port2ip.c +++ b/src/lib/krb5/os/port2ip.c @@ -36,10 +36,11 @@ #include krb5_error_code -krb5_unpack_full_ipaddr(inaddr, adr, port) -const krb5_address *inaddr; -krb5_int32 *adr; -krb5_int16 *port; +krb5_unpack_full_ipaddr(context, inaddr, adr, port) + krb5_context context; + const krb5_address *inaddr; + krb5_int32 *adr; + krb5_int16 *port; { unsigned long smushaddr; unsigned short smushport; diff --git a/src/lib/krb5/os/read_msg.c b/src/lib/krb5/os/read_msg.c index 20e3f67a9..08232a5be 100644 --- a/src/lib/krb5/os/read_msg.c +++ b/src/lib/krb5/os/read_msg.c @@ -36,7 +36,8 @@ #include krb5_error_code -krb5_read_message(fdp, inbuf) +krb5_read_message(context, fdp, inbuf) + krb5_context context; krb5_pointer fdp; krb5_data *inbuf; { @@ -44,7 +45,7 @@ krb5_read_message(fdp, inbuf) char *buf = NULL; int fd = *( (int *) fdp); - if ((len2 = krb5_net_read(fd, (char *)&len, 4)) != 4) + if ((len2 = krb5_net_read(context, fd, (char *)&len, 4)) != 4) return((len2 < 0) ? errno : ECONNABORTED); inbuf->length = len = ntohl(len); if (len) { @@ -54,7 +55,7 @@ krb5_read_message(fdp, inbuf) if (!(buf = malloc(len))) { return(ENOMEM); } - if ((len2 = krb5_net_read(fd, buf, len)) != len) { + if ((len2 = krb5_net_read(context, fd, buf, len)) != len) { krb5_xfree(buf); return((len2 < 0) ? errno : ECONNABORTED); } diff --git a/src/lib/krb5/os/read_pwd.c b/src/lib/krb5/os/read_pwd.c index bdd810b3a..98d9ce47f 100644 --- a/src/lib/krb5/os/read_pwd.c +++ b/src/lib/krb5/os/read_pwd.c @@ -70,11 +70,12 @@ intr_routine() } krb5_error_code -krb5_read_password(prompt, prompt2, return_pwd, size_return) -char *prompt; -char *prompt2; -char *return_pwd; -int *size_return; +krb5_read_password(context, prompt, prompt2, return_pwd, size_return) + krb5_context context; + char *prompt; + char *prompt2; + char *return_pwd; + int *size_return; { /* adapted from Kerberos v4 des/read_password.c */ #if defined(__STDC__) || defined(mips) diff --git a/src/lib/krb5/os/realm_dom.c b/src/lib/krb5/os/realm_dom.c index ff6d56d88..8acf7be9b 100644 --- a/src/lib/krb5/os/realm_dom.c +++ b/src/lib/krb5/os/realm_dom.c @@ -56,7 +56,8 @@ extern char *krb5_trans_file; krb5_error_code -krb5_get_realm_domain(realm, domain) +krb5_get_realm_domain(context, realm, domain) + krb5_context context; const char *realm; char **domain; { @@ -71,7 +72,7 @@ krb5_get_realm_domain(realm, domain) conversion */ if (realm == NULL) { - if (retval = krb5_get_host_realm(NULL, &realmlist)) + if (retval = krb5_get_host_realm(context, NULL, &realmlist)) return retval; realm = realmlist[0]; } diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index e01d1ab14..9a1fcd65a 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -64,12 +64,11 @@ extern int krb5_skdc_timeout_shift; extern int krb5_skdc_timeout_1; krb5_error_code -krb5_sendto_kdc (DECLARG(const krb5_data *, message), - DECLARG(const krb5_data *, realm), - DECLARG(krb5_data *, reply)) -OLDDECLARG(const krb5_data *, message) -OLDDECLARG(const krb5_data *, realm) -OLDDECLARG(krb5_data *, reply) +krb5_sendto_kdc (context, message, realm, reply) + krb5_context context; + const krb5_data * message; + const krb5_data * realm; + krb5_data * reply; { register int timeout, host, i; struct sockaddr *addr; @@ -85,7 +84,7 @@ OLDDECLARG(krb5_data *, reply) * find KDC location(s) for realm */ - if (retval = krb5_locate_kdc (realm, &addr, &naddr)) + if (retval = krb5_locate_kdc (context, realm, &addr, &naddr)) return retval; if (naddr == 0) return KRB5_REALM_UNKNOWN; diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index ac6e7e487..41bfb7a06 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -34,14 +34,12 @@ #include krb5_error_code -krb5_sname_to_principal(DECLARG(const char *,hostname), - DECLARG(const char *,sname), - DECLARG(krb5_int32,type), - DECLARG(krb5_principal *,ret_princ)) -OLDDECLARG(const char *,hostname) -OLDDECLARG(const char *,sname) -OLDDECLARG(krb5_int32,type) -OLDDECLARG(krb5_principal *,ret_princ) +krb5_sname_to_principal(context, hostname, sname, type, ret_princ) + krb5_context context; + const char * hostname; + const char * sname; + krb5_int32 type; + krb5_principal * ret_princ; { struct hostent *hp; char **hrealms, *realm, *remote_host; @@ -106,12 +104,12 @@ OLDDECLARG(krb5_principal *,ret_princ) *cp = tolower(*cp); if (use_local_realm) { - if (retval = krb5_get_default_realm(&realm)) { + if (retval = krb5_get_default_realm(context, &realm)) { free(remote_host); return retval; } } else { - if (retval = krb5_get_host_realm(remote_host, &hrealms)) { + if (retval = krb5_get_host_realm(context, remote_host, &hrealms)) { free(remote_host); return retval; } @@ -123,15 +121,15 @@ OLDDECLARG(krb5_principal *,ret_princ) realm = hrealms[0]; } - retval = krb5_build_principal(ret_princ, strlen(realm), + retval = krb5_build_principal(context, ret_princ, strlen(realm), realm, sname, remote_host, (char *)0); - krb5_princ_type(*ret_princ) = type; + krb5_princ_type(context, *ret_princ) = type; free(remote_host); if (!use_local_realm) - krb5_free_host_realm(hrealms); + krb5_free_host_realm(context, hrealms); return retval; } else { return KRB5_SNAME_UNSUPP_NAMETYPE; diff --git a/src/lib/krb5/os/timeofday.c b/src/lib/krb5/os/timeofday.c index ca33d583a..dc431502a 100644 --- a/src/lib/krb5/os/timeofday.c +++ b/src/lib/krb5/os/timeofday.c @@ -41,8 +41,9 @@ extern int errno; krb5_error_code -krb5_timeofday(timeret) -register krb5_int32 *timeret; +krb5_timeofday(context, timeret) + krb5_context context; + register krb5_int32 *timeret; { timetype tval; diff --git a/src/lib/krb5/os/unlck_file.c b/src/lib/krb5/os/unlck_file.c index b8370c808..681f3c8e6 100644 --- a/src/lib/krb5/os/unlck_file.c +++ b/src/lib/krb5/os/unlck_file.c @@ -32,9 +32,10 @@ #include krb5_error_code -krb5_unlock_file(filep, pathname) -FILE *filep; -char *pathname; +krb5_unlock_file(context, filep, pathname) + krb5_context context; + FILE *filep; + char *pathname; { - return krb5_lock_file(filep, pathname, KRB5_LOCKMODE_UNLOCK); + return krb5_lock_file(context, filep, pathname, KRB5_LOCKMODE_UNLOCK); } diff --git a/src/lib/krb5/os/ustime.c b/src/lib/krb5/os/ustime.c index 8169415c1..9e3c7ae5b 100644 --- a/src/lib/krb5/os/ustime.c +++ b/src/lib/krb5/os/ustime.c @@ -35,8 +35,9 @@ extern int errno; static struct timeval last_tv = {0, 0}; krb5_error_code -krb5_us_timeofday(seconds, microseconds) -register krb5_int32 *seconds, *microseconds; +krb5_us_timeofday(context, seconds, microseconds) + krb5_context context; + register krb5_int32 *seconds, *microseconds; { struct timeval tv; diff --git a/src/lib/krb5/os/write_msg.c b/src/lib/krb5/os/write_msg.c index e791a1023..f1c2f8f4a 100644 --- a/src/lib/krb5/os/write_msg.c +++ b/src/lib/krb5/os/write_msg.c @@ -35,7 +35,8 @@ #include krb5_error_code -krb5_write_message(fdp, outbuf) +krb5_write_message(context, fdp, outbuf) + krb5_context context; krb5_pointer fdp; krb5_data *outbuf; { @@ -43,10 +44,10 @@ krb5_write_message(fdp, outbuf) int fd = *( (int *) fdp); len = htonl(outbuf->length); - if (krb5_net_write(fd, (char *)&len, 4) < 0) { + if (krb5_net_write(context, fd, (char *)&len, 4) < 0) { return(errno); } - if (len && (krb5_net_write(fd, outbuf->data, outbuf->length) < 0)) { + if (len && (krb5_net_write(context, fd, outbuf->data, outbuf->length) < 0)) { return(errno); } return(0); -- 2.26.2