From a83b802bada404e3b2eccf92c3499966deaad171 Mon Sep 17 00:00:00 2001 From: markm Date: Fri, 25 Aug 1995 22:52:32 +0000 Subject: Start the eBones cleanup ball rolling. These are the start of a lot of work to clean up the FreeBSD eBones code. these changes include, but are not limited to: - Create prototypes for all the library routines - Make all the libraries compile clean with -Wall set - Fix numerous small bugs shown up in the above process - Prepare the code for libdes's removal to secure/ - add register, registerd and make_keypair to the make Lots more will follow in days to come. OK'ed by: rgrimes --- eBones/Copyright.MIT | 2 +- eBones/Copyright.SIPB | 2 +- eBones/Makefile | 9 +- eBones/Makefile.inc | 2 +- eBones/README.libdes | 2 +- eBones/acl/Makefile | 4 +- eBones/acl/acl_files.c | 69 ++++------- eBones/acl/acl_files.doc | 4 +- eBones/ext_srvtab/Makefile | 2 +- eBones/ext_srvtab/ext_srvtab.c | 4 +- eBones/include/ChangeLog | 2 +- eBones/include/Makefile | 4 +- eBones/include/addr_comp.h | 2 +- eBones/include/admin_server.h | 2 +- eBones/include/conf-bsd386i.h | 2 +- eBones/include/conf-bsdapollo.h | 2 +- eBones/include/conf-bsdibm032.h | 2 +- eBones/include/conf-bsdm68k.h | 2 +- eBones/include/conf-bsdsparc.h | 2 +- eBones/include/conf-bsdtahoe.h | 2 +- eBones/include/conf-bsdvax.h | 2 +- eBones/include/conf-ibm370.h | 2 +- eBones/include/conf-pc.h | 2 +- eBones/include/conf-pyr.h | 2 +- eBones/include/conf-ultmips2.h | 2 +- eBones/include/conf.h | 2 +- eBones/include/des.h | 2 +- eBones/include/highc.h | 2 +- eBones/include/kdc.h | 2 +- eBones/include/klog.h | 2 +- eBones/include/kparse.h | 2 +- eBones/include/krb.h | 75 +++++++++++- eBones/include/krb_conf.h | 2 +- eBones/include/krb_db.h | 24 ++-- eBones/include/lsb_addr_comp.h | 2 +- eBones/include/osconf.h | 2 +- eBones/include/passwd_server.h | 2 +- eBones/include/principal.h | 2 +- eBones/include/prot.h | 2 +- eBones/kadmin/Makefile | 2 +- eBones/kadmin/kadmin.c | 4 +- eBones/kadmin/kadmin_cmds.ct | 10 +- eBones/kadmind/Makefile | 2 +- eBones/kadmind/kadm_funcs.c | 2 +- eBones/kadmind/kadm_server.h | 6 +- eBones/kdb/Makefile | 4 +- eBones/kdb/krb_cache.c | 43 ++----- eBones/kdb/krb_dbm.c | 135 ++++++++------------- eBones/kdb/krb_kdb_utils.c | 62 +++++----- eBones/kdb/krb_lib.c | 38 ++---- eBones/kdb/print_princ.c | 20 ++-- eBones/kdb_destroy/Makefile | 2 +- eBones/kdb_destroy/kdb_destroy.c | 7 +- eBones/kdb_edit/Makefile | 2 +- eBones/kdb_edit/kdb_edit.c | 4 +- eBones/kdb_edit/maketime.c | 2 +- eBones/kdb_edit/time.h | 2 +- eBones/kdb_init/Makefile | 2 +- eBones/kdb_init/kdb_init.c | 7 +- eBones/kdb_util/Makefile | 2 +- eBones/kdb_util/kdb_util.c | 4 +- eBones/kdestroy/Makefile | 2 +- eBones/kdestroy/kdestroy.c | 4 +- eBones/kerberos/Makefile | 2 +- eBones/kerberos/cr_err_reply.c | 4 +- eBones/kerberos/kerberos.c | 4 +- eBones/kinit/Makefile | 2 +- eBones/kinit/kinit.c | 6 +- eBones/klist/Makefile | 2 +- eBones/klist/klist.c | 4 +- eBones/kprop/Makefile | 2 +- eBones/kprop/kprop.c | 34 +++++- eBones/kprop/kprop.h | 32 ++++- eBones/kpropd/Makefile | 2 +- eBones/kpropd/kpropd.c | 6 +- eBones/krb/Makefile | 4 +- eBones/krb/add_ticket.c | 6 +- eBones/krb/create_auth_reply.c | 7 +- eBones/krb/create_ciph.c | 27 ++--- eBones/krb/create_death_packet.c | 6 +- eBones/krb/create_ticket.c | 29 ++--- eBones/krb/debug_decl.c | 6 +- eBones/krb/decomp_ticket.c | 31 ++--- eBones/krb/des_rw.c | 40 ++----- eBones/krb/dest_tkt.c | 11 +- eBones/krb/extract_ticket.c | 16 +-- eBones/krb/fgetst.c | 11 +- eBones/krb/get_ad_tkt.c | 26 ++-- eBones/krb/get_admhst.c | 11 +- eBones/krb/get_cred.c | 12 +- eBones/krb/get_in_tkt.c | 73 ++++------- eBones/krb/get_krbhst.c | 11 +- eBones/krb/get_krbrlm.c | 12 +- eBones/krb/get_phost.c | 13 +- eBones/krb/get_pw_tkt.c | 12 +- eBones/krb/get_request.c | 12 +- eBones/krb/get_svc_in_tkt.c | 8 +- eBones/krb/get_tf_fullname.c | 13 +- eBones/krb/get_tf_realm.c | 10 +- eBones/krb/getrealm.c | 10 +- eBones/krb/getst.c | 12 +- eBones/krb/in_tkt.c | 17 ++- eBones/krb/k_gethostname.c | 11 +- eBones/krb/klog.c | 18 ++- eBones/krb/kname_parse.c | 28 ++--- eBones/krb/kntoln.c | 10 +- eBones/krb/kparse.c | 72 ++++------- eBones/krb/krb_err.et | 6 +- eBones/krb/krb_err_txt.c | 6 +- eBones/krb/krb_get_in_tkt.c | 41 +++---- eBones/krb/krbglue.c | 6 +- eBones/krb/kuserok.c | 13 +- eBones/krb/log.c | 27 ++--- eBones/krb/mk_err.c | 6 +- eBones/krb/mk_priv.c | 28 ++--- eBones/krb/mk_req.c | 31 ++--- eBones/krb/mk_safe.c | 24 ++-- eBones/krb/month_sname.c | 9 +- eBones/krb/netread.c | 16 +-- eBones/krb/netwrite.c | 16 +-- eBones/krb/one.c | 6 +- eBones/krb/pkt_cipher.c | 6 +- eBones/krb/pkt_clen.c | 11 +- eBones/krb/rd_err.c | 14 +-- eBones/krb/rd_priv.c | 27 ++--- eBones/krb/rd_req.c | 36 +++--- eBones/krb/rd_safe.c | 25 ++-- eBones/krb/read_service_key.c | 16 ++- eBones/krb/recvauth.c | 32 ++--- eBones/krb/save_credentials.c | 18 +-- eBones/krb/send_to_kdc.c | 180 +++++++++++++--------------- eBones/krb/sendauth.c | 42 ++----- eBones/krb/stime.c | 6 +- eBones/krb/tf_shm.c | 19 +-- eBones/krb/tf_util.c | 106 +++++++--------- eBones/krb/tkt_string.c | 17 ++- eBones/krb/util.c | 13 +- eBones/ksrvtgt/Makefile | 2 +- eBones/ksrvtgt/ksrvtgt.c | 6 +- eBones/ksrvutil/Makefile | 2 +- eBones/ksrvutil/ksrvutil.c | 2 +- eBones/kstash/Makefile | 2 +- eBones/kstash/kstash.c | 4 +- eBones/lib/libacl/Makefile | 4 +- eBones/lib/libacl/acl_files.c | 69 ++++------- eBones/lib/libacl/acl_files.doc | 4 +- eBones/lib/libkadm/Makefile | 4 +- eBones/lib/libkadm/kadm.h | 30 +++-- eBones/lib/libkadm/kadm_cli_wrap.c | 86 ++++++------- eBones/lib/libkadm/kadm_err.et | 8 +- eBones/lib/libkadm/kadm_stream.c | 71 +++-------- eBones/lib/libkadm/kadm_supp.c | 26 ++-- eBones/lib/libkdb/Makefile | 4 +- eBones/lib/libkdb/krb_cache.c | 43 ++----- eBones/lib/libkdb/krb_dbm.c | 135 ++++++++------------- eBones/lib/libkdb/krb_kdb_utils.c | 62 +++++----- eBones/lib/libkdb/krb_lib.c | 38 ++---- eBones/lib/libkdb/print_princ.c | 20 ++-- eBones/lib/libkrb/Makefile | 4 +- eBones/lib/libkrb/add_ticket.c | 6 +- eBones/lib/libkrb/create_auth_reply.c | 7 +- eBones/lib/libkrb/create_ciph.c | 27 ++--- eBones/lib/libkrb/create_death_packet.c | 6 +- eBones/lib/libkrb/create_ticket.c | 29 ++--- eBones/lib/libkrb/debug_decl.c | 6 +- eBones/lib/libkrb/decomp_ticket.c | 31 ++--- eBones/lib/libkrb/des_rw.c | 40 ++----- eBones/lib/libkrb/dest_tkt.c | 11 +- eBones/lib/libkrb/extract_ticket.c | 16 +-- eBones/lib/libkrb/fgetst.c | 11 +- eBones/lib/libkrb/get_ad_tkt.c | 26 ++-- eBones/lib/libkrb/get_admhst.c | 11 +- eBones/lib/libkrb/get_cred.c | 12 +- eBones/lib/libkrb/get_in_tkt.c | 73 ++++------- eBones/lib/libkrb/get_krbhst.c | 11 +- eBones/lib/libkrb/get_krbrlm.c | 12 +- eBones/lib/libkrb/get_phost.c | 13 +- eBones/lib/libkrb/get_pw_tkt.c | 12 +- eBones/lib/libkrb/get_request.c | 12 +- eBones/lib/libkrb/get_svc_in_tkt.c | 8 +- eBones/lib/libkrb/get_tf_fullname.c | 13 +- eBones/lib/libkrb/get_tf_realm.c | 10 +- eBones/lib/libkrb/getrealm.c | 10 +- eBones/lib/libkrb/getst.c | 12 +- eBones/lib/libkrb/in_tkt.c | 17 ++- eBones/lib/libkrb/k_gethostname.c | 11 +- eBones/lib/libkrb/klog.c | 18 ++- eBones/lib/libkrb/kname_parse.c | 28 ++--- eBones/lib/libkrb/kntoln.c | 10 +- eBones/lib/libkrb/kparse.c | 72 ++++------- eBones/lib/libkrb/krb_err.et | 6 +- eBones/lib/libkrb/krb_err_txt.c | 6 +- eBones/lib/libkrb/krb_get_in_tkt.c | 41 +++---- eBones/lib/libkrb/krbglue.c | 6 +- eBones/lib/libkrb/kuserok.c | 13 +- eBones/lib/libkrb/log.c | 27 ++--- eBones/lib/libkrb/mk_err.c | 6 +- eBones/lib/libkrb/mk_priv.c | 28 ++--- eBones/lib/libkrb/mk_req.c | 31 ++--- eBones/lib/libkrb/mk_safe.c | 24 ++-- eBones/lib/libkrb/month_sname.c | 9 +- eBones/lib/libkrb/netread.c | 16 +-- eBones/lib/libkrb/netwrite.c | 16 +-- eBones/lib/libkrb/one.c | 6 +- eBones/lib/libkrb/pkt_cipher.c | 6 +- eBones/lib/libkrb/pkt_clen.c | 11 +- eBones/lib/libkrb/rd_err.c | 14 +-- eBones/lib/libkrb/rd_priv.c | 27 ++--- eBones/lib/libkrb/rd_req.c | 36 +++--- eBones/lib/libkrb/rd_safe.c | 25 ++-- eBones/lib/libkrb/read_service_key.c | 16 ++- eBones/lib/libkrb/recvauth.c | 32 ++--- eBones/lib/libkrb/save_credentials.c | 18 +-- eBones/lib/libkrb/send_to_kdc.c | 180 +++++++++++++--------------- eBones/lib/libkrb/sendauth.c | 42 ++----- eBones/lib/libkrb/stime.c | 6 +- eBones/lib/libkrb/tf_shm.c | 19 +-- eBones/lib/libkrb/tf_util.c | 106 +++++++--------- eBones/lib/libkrb/tkt_string.c | 17 ++- eBones/lib/libkrb/util.c | 13 +- eBones/libexec/kpropd/Makefile | 2 +- eBones/libexec/kpropd/kpropd.c | 6 +- eBones/libexec/registerd/Makefile | 2 +- eBones/libexec/registerd/registerd.c | 3 +- eBones/libkadm/Makefile | 4 +- eBones/libkadm/kadm.h | 30 +++-- eBones/libkadm/kadm_cli_wrap.c | 86 ++++++------- eBones/libkadm/kadm_err.et | 8 +- eBones/libkadm/kadm_stream.c | 71 +++-------- eBones/libkadm/kadm_supp.c | 26 ++-- eBones/make_keypair/make_keypair.c | 3 +- eBones/passwd/kpasswd.c | 2 +- eBones/patchlevel.h | 2 +- eBones/register/Makefile | 2 +- eBones/register/register.c | 8 +- eBones/registerd/Makefile | 2 +- eBones/registerd/registerd.c | 3 +- eBones/usr.bin/kadmin/Makefile | 2 +- eBones/usr.bin/kadmin/kadmin.c | 4 +- eBones/usr.bin/kadmin/kadmin_cmds.ct | 10 +- eBones/usr.bin/kdestroy/Makefile | 2 +- eBones/usr.bin/kdestroy/kdestroy.c | 4 +- eBones/usr.bin/kinit/Makefile | 2 +- eBones/usr.bin/kinit/kinit.c | 6 +- eBones/usr.bin/klist/Makefile | 2 +- eBones/usr.bin/klist/klist.c | 4 +- eBones/usr.bin/ksrvtgt/Makefile | 2 +- eBones/usr.bin/ksrvtgt/ksrvtgt.c | 6 +- eBones/usr.bin/passwd/kpasswd.c | 2 +- eBones/usr.bin/register/Makefile | 2 +- eBones/usr.bin/register/register.c | 8 +- eBones/usr.sbin/ext_srvtab/Makefile | 2 +- eBones/usr.sbin/ext_srvtab/ext_srvtab.c | 4 +- eBones/usr.sbin/kadmin/Makefile | 2 +- eBones/usr.sbin/kadmin/kadm_funcs.c | 2 +- eBones/usr.sbin/kadmin/kadm_server.h | 6 +- eBones/usr.sbin/kadmind/Makefile | 2 +- eBones/usr.sbin/kadmind/kadm_funcs.c | 2 +- eBones/usr.sbin/kadmind/kadm_server.h | 6 +- eBones/usr.sbin/kdb_destroy/Makefile | 2 +- eBones/usr.sbin/kdb_destroy/kdb_destroy.c | 7 +- eBones/usr.sbin/kdb_edit/Makefile | 2 +- eBones/usr.sbin/kdb_edit/kdb_edit.c | 4 +- eBones/usr.sbin/kdb_edit/maketime.c | 2 +- eBones/usr.sbin/kdb_edit/time.h | 2 +- eBones/usr.sbin/kdb_init/Makefile | 2 +- eBones/usr.sbin/kdb_init/kdb_init.c | 7 +- eBones/usr.sbin/kdb_util/Makefile | 2 +- eBones/usr.sbin/kdb_util/kdb_util.c | 4 +- eBones/usr.sbin/kerberos/Makefile | 2 +- eBones/usr.sbin/kerberos/cr_err_reply.c | 4 +- eBones/usr.sbin/kerberos/kerberos.c | 4 +- eBones/usr.sbin/kprop/Makefile | 2 +- eBones/usr.sbin/kprop/kprop.c | 34 +++++- eBones/usr.sbin/kprop/kprop.h | 32 ++++- eBones/usr.sbin/ksrvutil/Makefile | 2 +- eBones/usr.sbin/ksrvutil/ksrvutil.c | 2 +- eBones/usr.sbin/kstash/Makefile | 2 +- eBones/usr.sbin/kstash/kstash.c | 4 +- eBones/usr.sbin/make_keypair/make_keypair.c | 3 +- 280 files changed, 2037 insertions(+), 2551 deletions(-) (limited to 'eBones') diff --git a/eBones/Copyright.MIT b/eBones/Copyright.MIT index 28dd55f..cd1d89b 100644 --- a/eBones/Copyright.MIT +++ b/eBones/Copyright.MIT @@ -1,4 +1,4 @@ -# $Id: Copyright.MIT,v 1.2 1994/07/19 19:21:03 g89r4222 Exp $ +# $Id: Copyright.MIT,v 1.3 1995/07/18 16:34:16 mark Exp $ The following Copyright notice applies to the original Bones package. diff --git a/eBones/Copyright.SIPB b/eBones/Copyright.SIPB index c116ad2..5e6c38a 100644 --- a/eBones/Copyright.SIPB +++ b/eBones/Copyright.SIPB @@ -1,4 +1,4 @@ -# $Id: Copyright.SIPB,v 1.2 1994/07/19 19:21:05 g89r4222 Exp $ +# $Id: Copyright.SIPB,v 1.3 1995/07/18 16:34:18 mark Exp $ The following Copyright notice applies to parts of the Bones package. See source code for exact references. diff --git a/eBones/Makefile b/eBones/Makefile index 03746ca..f6c1c2d 100644 --- a/eBones/Makefile +++ b/eBones/Makefile @@ -1,14 +1,11 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.12 1995/06/11 19:28:20 rgrimes Exp $ +# $Id: Makefile,v 1.14 1995/07/18 16:34:20 mark Exp $ -SUBDIR= include des acl kdb krb libkadm +SUBDIR= include acl kdb krb libkadm SUBDIR+= ext_srvtab kdb_destroy kdb_edit \ kdb_init kdb_util kdestroy kerberos kinit klist ksrvtgt \ - kstash kadmin kadmind ksrvutil man -# -# MISSING AND PROBABLY BOGUS: register registerd make_keypair -# + kstash kadmin kadmind ksrvutil man register registerd make_keypair SDIR= ${.CURDIR}/.. diff --git a/eBones/Makefile.inc b/eBones/Makefile.inc index 4df35f6..ad42cbe 100644 --- a/eBones/Makefile.inc +++ b/eBones/Makefile.inc @@ -1,5 +1,5 @@ # From: @(#)Makefile.inc 5.1 (Berkeley) 6/25/90 -# $Id: Makefile.inc,v 1.3 1995/01/14 20:50:37 wollman Exp $ +# $Id: Makefile.inc,v 1.4 1995/07/18 16:34:21 mark Exp $ BINDIR?= /usr/sbin SHLIB_MAJOR?= 2 diff --git a/eBones/README.libdes b/eBones/README.libdes index 6acd62c..a2aa1eb 100644 --- a/eBones/README.libdes +++ b/eBones/README.libdes @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of either: - + a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or diff --git a/eBones/acl/Makefile b/eBones/acl/Makefile index 77c9a01..0ac5183 100644 --- a/eBones/acl/Makefile +++ b/eBones/acl/Makefile @@ -1,10 +1,10 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.3 1994/09/09 21:43:17 g89r4222 Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:34:47 mark Exp $ LIB= acl SHLIB_MAJOR= 2 SHLIB_MINOR= 0 -CFLAGS+=-DDEBUG -DKERBEROS -I${.CURDIR}/../include +CFLAGS+=-DDEBUG -DKERBEROS -I${.CURDIR}/../include -Wall SRCS= acl_files.c .include diff --git a/eBones/acl/acl_files.c b/eBones/acl/acl_files.c index 1b97bb2..1f488f3 100644 --- a/eBones/acl/acl_files.c +++ b/eBones/acl/acl_files.c @@ -6,25 +6,29 @@ * . * * from: acl_files.c,v 4.4 89/12/19 13:30:53 jtkohl Exp $ - * $Id: acl_files.c,v 1.1.1.1 1994/09/30 14:49:48 csgr Exp $ + * $Id: acl_files.c,v 1.3 1995/07/18 16:34:49 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: acl_files.c,v 1.1.1.1 1994/09/30 14:49:48 csgr Exp $"; +"$Id: acl_files.c,v 1.3 1995/07/18 16:34:49 mark Exp $"; #endif lint +#endif /*** Routines for manipulating access control list files ***/ #include +#include #include #include #include #include #include #include -#include "krb.h" +#include +#include __BEGIN_DECLS static int acl_abort __P((char *, FILE *)); @@ -55,17 +59,14 @@ __END_DECLS extern int errno; -extern char *malloc(), *calloc(); -extern time_t time(); +/* extern time_t time(); */ /* Canonicalize a principal name */ /* If instance is missing, it becomes "" */ /* If realm is missing, it becomes the local realm */ /* Canonicalized form is put in canon, which must be big enough to hold MAX_PRINCIPAL_SIZE characters */ -acl_canonicalize_principal(principal, canon) -char *principal; -char *canon; +void acl_canonicalize_principal(char *principal, char *canon) { char *dot, *atsign, *end; int len; @@ -126,8 +127,7 @@ char *canon; /* Return new FILE pointer */ /* or NULL if file cannot be modified */ /* REQUIRES WRITE PERMISSION TO CONTAINING DIRECTORY */ -static FILE *acl_lock_file(acl_file) -char *acl_file; +static FILE *acl_lock_file(char *acl_file) { struct stat s; char new[LINESIZE]; @@ -174,9 +174,7 @@ char *acl_file; /* Returns > 0 if lock was broken */ /* Returns < 0 if some other error occurs */ /* Closes f */ -static int acl_commit(acl_file, f) -char *acl_file; -FILE *f; +static int acl_commit(char *acl_file, FILE *f) { char new[LINESIZE]; int ret; @@ -200,10 +198,7 @@ FILE *f; * Returns 0 if successful, < 0 otherwise * Closes f */ -static int -acl_abort(acl_file, f) -char *acl_file; -FILE *f; +static int acl_abort(char *acl_file, FILE *f) { char new[LINESIZE]; int ret; @@ -225,9 +220,7 @@ FILE *f; /* Creates the file with permissions perm if it does not exist */ /* Erases it if it does */ /* Returns return value of acl_commit */ -int acl_initialize(acl_file, perm) -char *acl_file; -int perm; +int acl_initialize(char *acl_file, int perm) { FILE *new; int fd; @@ -248,8 +241,7 @@ int perm; /* Eliminate all whitespace character in buf */ /* Modifies its argument */ -static nuke_whitespace(buf) -char *buf; +static void nuke_whitespace(char *buf) { register char *pin, *pout; @@ -281,8 +273,7 @@ int size; } /* Destroy a hash table */ -static destroy_hash(h) -struct hashtbl *h; +static void destroy_hash(struct hashtbl *h) { int i; @@ -294,8 +285,7 @@ struct hashtbl *h; } /* Compute hash value for a string */ -static unsigned hashval(s) -register char *s; +static unsigned hashval(char *s) { register unsigned hv; @@ -306,9 +296,7 @@ register char *s; } /* Add an element to a hash table */ -static add_hash(h, el) -struct hashtbl *h; -char *el; +static void add_hash(struct hashtbl *h, char *el) { unsigned hv; char *s; @@ -339,9 +327,7 @@ char *el; } /* Returns nonzero if el is in h */ -static check_hash(h, el) -struct hashtbl *h; -char *el; +static int check_hash(struct hashtbl *h, char *el) { unsigned hv; @@ -368,8 +354,7 @@ static int acl_cache_next = 0; /* Returns < 0 if unsuccessful in loading acl */ /* Returns index into acl_cache otherwise */ /* Note that if acl is already loaded, this is just a lookup */ -static int acl_load(name) -char *name; +static int acl_load(char *name) { int i; FILE *f; @@ -436,9 +421,7 @@ char *name; /* Returns nonzero if it can be determined that acl contains principal */ /* Principal is not canonicalized, and no wildcarding is done */ -acl_exact_match(acl, principal) -char *acl; -char *principal; +int acl_exact_match(char *acl, char *principal) { int idx; @@ -449,9 +432,7 @@ char *principal; /* Returns nonzero if it can be determined that acl contains principal */ /* Recognizes wildcards in acl of the form name.*@realm, *.*@realm, and *.*@* */ -acl_check(acl, principal) -char *acl; -char *principal; +int acl_check(char *acl, char *principal) { char buf[MAX_PRINCIPAL_SIZE]; char canon[MAX_PRINCIPAL_SIZE]; @@ -477,9 +458,7 @@ char *principal; /* Adds principal to acl */ /* Wildcards are interpreted literally */ -acl_add(acl, principal) -char *acl; -char *principal; +int acl_add(char *acl, char *principal) { int idx; int i; @@ -511,9 +490,7 @@ char *principal; /* Removes principal from acl */ /* Wildcards are interpreted literally */ -acl_delete(acl, principal) -char *acl; -char *principal; +int acl_delete(char *acl, char *principal) { int idx; int i; diff --git a/eBones/acl/acl_files.doc b/eBones/acl/acl_files.doc index 78c448a..4096f9b 100644 --- a/eBones/acl/acl_files.doc +++ b/eBones/acl/acl_files.doc @@ -1,7 +1,7 @@ PROTOTYPE ACL LIBRARY Introduction - + An access control list (ACL) is a list of principals, where each principal is is represented by a text string which cannot contain whitespace. The library allows application programs to refer to named @@ -90,7 +90,7 @@ int mode; Initialize acl. If acl file does not exist, creates it with mode mode. If acl exists, removes all members. Returns 0 if successful, nonzero otherwise. WARNING: Mode argument is likely to change with -the eventual introduction of an ACL service. +the eventual introduction of an ACL service. Known problems diff --git a/eBones/ext_srvtab/Makefile b/eBones/ext_srvtab/Makefile index f30bbbb..b0a2a01 100644 --- a/eBones/ext_srvtab/Makefile +++ b/eBones/ext_srvtab/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:22:34 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:35:54 mark Exp $ PROG= ext_srvtab CFLAGS+=-DKERBEROS -I${.CURDIR}/../include diff --git a/eBones/ext_srvtab/ext_srvtab.c b/eBones/ext_srvtab/ext_srvtab.c index 093dfe2..6b655c7 100644 --- a/eBones/ext_srvtab/ext_srvtab.c +++ b/eBones/ext_srvtab/ext_srvtab.c @@ -2,12 +2,12 @@ * Copyright 1987, 1988 by the Massachusetts Institute of Technology. * * from: ext_srvtab.c,v 4.1 89/07/18 16:49:30 jtkohl Exp $ - * $Id: ext_srvtab.c,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $ + * $Id: ext_srvtab.c,v 1.3 1995/07/18 16:35:55 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: ext_srvtab.c,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $"; +"$Id: ext_srvtab.c,v 1.3 1995/07/18 16:35:55 mark Exp $"; #endif lint #include diff --git a/eBones/include/ChangeLog b/eBones/include/ChangeLog index 254b8dd..77bc755 100644 --- a/eBones/include/ChangeLog +++ b/eBones/include/ChangeLog @@ -1,4 +1,4 @@ -# $Id: ChangeLog,v 1.2 1994/07/19 19:22:41 g89r4222 Exp $ +# $Id: ChangeLog,v 1.3 1995/07/18 16:35:58 mark Exp $ Mon Mar 21 15:48:59 MET 1994 Piero Serini * 1st port to FreeBSD diff --git a/eBones/include/Makefile b/eBones/include/Makefile index ff43b54..7e29c67 100644 --- a/eBones/include/Makefile +++ b/eBones/include/Makefile @@ -1,7 +1,7 @@ # from: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:36:00 mark Exp $ -FILES= des.h kparse.h krb.h krb_db.h +FILES= kparse.h krb.h krb_db.h # mit-copyright.h kadm_err.h krb_err.h diff --git a/eBones/include/addr_comp.h b/eBones/include/addr_comp.h index 290d09a..2421bc6 100644 --- a/eBones/include/addr_comp.h +++ b/eBones/include/addr_comp.h @@ -6,7 +6,7 @@ * Include file for address comparison macros. * * from: addr_comp.h,v 4.0 89/01/23 09:57:44 jtkohl Exp $ - * $Id: addr_comp.h,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $ + * $Id: addr_comp.h,v 1.3 1995/07/18 16:36:01 mark Exp $ */ #ifndef ADDR_COMP_DEFS diff --git a/eBones/include/admin_server.h b/eBones/include/admin_server.h index 5209641..ca0977d 100644 --- a/eBones/include/admin_server.h +++ b/eBones/include/admin_server.h @@ -6,7 +6,7 @@ * Include file for the Kerberos administration server. * * from: admin_server.h,v 4.7 89/01/11 11:59:42 steiner Exp $ - * $Id: admin_server.h,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $ + * $Id: admin_server.h,v 1.3 1995/07/18 16:36:03 mark Exp $ */ #ifndef ADMIN_SERVER_DEFS diff --git a/eBones/include/conf-bsd386i.h b/eBones/include/conf-bsd386i.h index 0f63212..a009450 100644 --- a/eBones/include/conf-bsd386i.h +++ b/eBones/include/conf-bsd386i.h @@ -6,7 +6,7 @@ * Machine-type definitions: Sun 386i using SunOS (~BSD) * * from: conf-bsd386i.h,v 4.0 89/12/19 13:26:55 jtkohl Exp $ - * $Id: conf-bsd386i.h,v 1.2 1994/07/19 19:22:48 g89r4222 Exp $ + * $Id: conf-bsd386i.h,v 1.3 1995/07/18 16:36:05 mark Exp $ */ #define BITS32 diff --git a/eBones/include/conf-bsdapollo.h b/eBones/include/conf-bsdapollo.h index 119a96d..12dc580 100644 --- a/eBones/include/conf-bsdapollo.h +++ b/eBones/include/conf-bsdapollo.h @@ -4,7 +4,7 @@ * . * * from: conf-bsdapollo.h,v 4.1 89/01/24 14:26:22 jtkohl Exp $ - * $Id: conf-bsdapollo.h,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $ + * $Id: conf-bsdapollo.h,v 1.3 1995/07/18 16:36:06 mark Exp $ */ #define BSDUNIX diff --git a/eBones/include/conf-bsdibm032.h b/eBones/include/conf-bsdibm032.h index 285fbf6..8331498 100644 --- a/eBones/include/conf-bsdibm032.h +++ b/eBones/include/conf-bsdibm032.h @@ -6,7 +6,7 @@ * Machine-type definitions: IBM 032 (RT/PC) * * from: conf-bsdibm032.h,v 4.0 89/01/23 09:58:01 jtkohl Exp $ - * $Id: conf-bsdibm032.h,v 1.2 1994/07/19 19:22:51 g89r4222 Exp $ + * $Id: conf-bsdibm032.h,v 1.3 1995/07/18 16:36:08 mark Exp $ */ #define BSDUNIX diff --git a/eBones/include/conf-bsdm68k.h b/eBones/include/conf-bsdm68k.h index fcc2c57..9e60e06 100644 --- a/eBones/include/conf-bsdm68k.h +++ b/eBones/include/conf-bsdm68k.h @@ -6,7 +6,7 @@ * Machine-type definitions: 68000 with BSD Unix, e.g. SUN * * from: conf-bsdm68k.h,v 4.0 88/11/29 11:46:58 jtkohl Exp $ - * $Id: conf-bsdm68k.h,v 1.2 1994/07/19 19:22:53 g89r4222 Exp $ + * $Id: conf-bsdm68k.h,v 1.3 1995/07/18 16:36:10 mark Exp $ */ #define BITS32 diff --git a/eBones/include/conf-bsdsparc.h b/eBones/include/conf-bsdsparc.h index abfa2ae..7359aec 100644 --- a/eBones/include/conf-bsdsparc.h +++ b/eBones/include/conf-bsdsparc.h @@ -6,7 +6,7 @@ * Machine-type definitions: SPARC with BSD Unix, e.g. SUN-4 * * from: conf-bsdsparc.h,v 4.0 89/06/02 13:04:06 jtkohl Exp $ - * $Id: conf-bsdsparc.h,v 1.2 1994/07/19 19:22:54 g89r4222 Exp $ + * $Id: conf-bsdsparc.h,v 1.3 1995/07/18 16:36:12 mark Exp $ */ #define BITS32 diff --git a/eBones/include/conf-bsdtahoe.h b/eBones/include/conf-bsdtahoe.h index 8095dc5..fa8c462 100644 --- a/eBones/include/conf-bsdtahoe.h +++ b/eBones/include/conf-bsdtahoe.h @@ -4,7 +4,7 @@ * Machine Description : TAHOE. * * from: conf-bsdtahoe.h,v 4.0 89/08/30 11:06:53 jtkohl Exp $ - * $Id: conf-bsdtahoe.h,v 1.2 1994/07/19 19:22:56 g89r4222 Exp $ + * $Id: conf-bsdtahoe.h,v 1.3 1995/07/18 16:36:14 mark Exp $ */ #define TAHOE diff --git a/eBones/include/conf-bsdvax.h b/eBones/include/conf-bsdvax.h index 6b82102..ef0c052 100644 --- a/eBones/include/conf-bsdvax.h +++ b/eBones/include/conf-bsdvax.h @@ -6,7 +6,7 @@ * Machine-type definitions: VAX * * from: conf-bsdvax.h,v 4.0 89/01/23 09:58:12 jtkohl Exp $ - * $Id: conf-bsdvax.h,v 1.2 1994/07/19 19:22:57 g89r4222 Exp $ + * $Id: conf-bsdvax.h,v 1.3 1995/07/18 16:36:15 mark Exp $ */ #define VAX diff --git a/eBones/include/conf-ibm370.h b/eBones/include/conf-ibm370.h index e4bccfc..7b8b504 100644 --- a/eBones/include/conf-ibm370.h +++ b/eBones/include/conf-ibm370.h @@ -6,7 +6,7 @@ * Machine-type definitions: IBM 370 * * from: conf-ibm370.h,v 4.0 89/01/23 09:58:19 jtkohl Exp $ - * $Id: conf-ibm370.h,v 1.2 1994/07/19 19:22:59 g89r4222 Exp $ + * $Id: conf-ibm370.h,v 1.3 1995/07/18 16:36:17 mark Exp $ */ /* What else? */ diff --git a/eBones/include/conf-pc.h b/eBones/include/conf-pc.h index 25218e3..4b633ff 100644 --- a/eBones/include/conf-pc.h +++ b/eBones/include/conf-pc.h @@ -6,7 +6,7 @@ * Machine-type definitions: IBM PC 8086 * * from: conf-pc.h,v 4.0 89/01/23 09:58:26 jtkohl Exp $ - * $Id: conf-pc.h,v 1.2 1994/07/19 19:23:00 g89r4222 Exp $ + * $Id: conf-pc.h,v 1.3 1995/07/18 16:36:19 mark Exp $ * */ diff --git a/eBones/include/conf-pyr.h b/eBones/include/conf-pyr.h index e88e528..f47c2155 100644 --- a/eBones/include/conf-pyr.h +++ b/eBones/include/conf-pyr.h @@ -6,7 +6,7 @@ * Machine-type definitions: Pyramid * * from: conf-pyr.h,v 4.0 89/12/19 13:27:16 jtkohl Exp $ - * $Id: conf-pyr.h,v 1.2 1994/07/19 19:23:02 g89r4222 Exp $ + * $Id: conf-pyr.h,v 1.3 1995/07/18 16:36:20 mark Exp $ */ #define BITS32 diff --git a/eBones/include/conf-ultmips2.h b/eBones/include/conf-ultmips2.h index 9e04aad..9733090 100644 --- a/eBones/include/conf-ultmips2.h +++ b/eBones/include/conf-ultmips2.h @@ -6,7 +6,7 @@ * Machine-type definitions: DECstation 3100 (MIPS R2000) * * from: conf-ultmips2.h,v 4.0 89/01/23 09:58:32 jtkohl Exp $ - * $Id: conf-ultmips2.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: conf-ultmips2.h,v 1.3 1995/07/18 16:36:22 mark Exp $ */ #define MIPS2 diff --git a/eBones/include/conf.h b/eBones/include/conf.h index 30186c5..64797e6 100644 --- a/eBones/include/conf.h +++ b/eBones/include/conf.h @@ -12,7 +12,7 @@ * /usr/include/krb.h?) * * from: conf.h,v 4.0 89/01/23 09:58:40 jtkohl Exp $ - * $Id: conf.h,v 1.2 1994/07/19 19:23:05 g89r4222 Exp $ + * $Id: conf.h,v 1.3 1995/07/18 16:36:24 mark Exp $ */ #ifndef _CONF_H_ diff --git a/eBones/include/des.h b/eBones/include/des.h index 4288c2f..af20141 100644 --- a/eBones/include/des.h +++ b/eBones/include/des.h @@ -6,7 +6,7 @@ * Include file for the Data Encryption Standard library. * * from: des.h,v 4.11 89/01/17 16:24:57 rfrench Exp $ - * $Id: des.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: des.h,v 1.3 1995/07/18 16:36:25 mark Exp $ */ /* only do the whole thing once */ diff --git a/eBones/include/highc.h b/eBones/include/highc.h index be50e3f..7ff2f7c 100644 --- a/eBones/include/highc.h +++ b/eBones/include/highc.h @@ -7,7 +7,7 @@ * we've got available.... * * from: highc.h,v 4.0 89/01/23 09:59:15 jtkohl Exp $ - * $Id: highc.h,v 1.2 1994/07/19 19:23:08 g89r4222 Exp $ + * $Id: highc.h,v 1.3 1995/07/18 16:36:27 mark Exp $ */ #define const diff --git a/eBones/include/kdc.h b/eBones/include/kdc.h index 2323eea..70756a4 100644 --- a/eBones/include/kdc.h +++ b/eBones/include/kdc.h @@ -6,7 +6,7 @@ * Include file for the Kerberos Key Distribution Center. * * from: kdc.h,v 4.1 89/01/24 17:54:04 jon Exp $ - * $Id: kdc.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: kdc.h,v 1.3 1995/07/18 16:36:29 mark Exp $ */ #ifndef KDC_DEFS diff --git a/eBones/include/klog.h b/eBones/include/klog.h index c2bd27f..c8ca557 100644 --- a/eBones/include/klog.h +++ b/eBones/include/klog.h @@ -7,7 +7,7 @@ * type of message may be selectively turned on or off. * * from: klog.h,v 4.7 89/01/24 17:55:07 jon Exp $ - * $Id: klog.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: klog.h,v 1.3 1995/07/18 16:36:30 mark Exp $ */ #ifndef KLOG_DEFS diff --git a/eBones/include/kparse.h b/eBones/include/kparse.h index cf4741c..26bc523 100644 --- a/eBones/include/kparse.h +++ b/eBones/include/kparse.h @@ -6,7 +6,7 @@ * Include file for kparse routines. * * from: kparse.h,v 4.5 89/01/11 12:05:53 steiner Exp $ - * $Id: kparse.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: kparse.h,v 1.3 1995/07/18 16:36:32 mark Exp $ */ #ifndef KPARSE_DEFS diff --git a/eBones/include/krb.h b/eBones/include/krb.h index f0531d4..afc8505 100644 --- a/eBones/include/krb.h +++ b/eBones/include/krb.h @@ -6,7 +6,7 @@ * Include file for the Kerberos library. * * from: krb.h,v 4.26 89/08/08 17:55:25 jtkohl Exp $ - * $Id: krb.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: krb.h,v 1.5 1995/07/18 16:36:34 mark Exp $ */ /* Only one time, please */ @@ -14,7 +14,9 @@ #define KRB_DEFS /* Need some defs from des.h */ -#include +#include +#include +#include /* Text describing error codes */ #define MAX_KRB_ERRORS 256 @@ -373,4 +375,73 @@ char *tkt_string(); #define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */ #endif ATHENA_COMPAT +void acl_canonicalize_principal(char *principal, char *buf); +int acl_check(char *acl, char *principal); +int acl_exact_match(char *acl, char *principal); +int acl_add(char *acl, char *principal); +int acl_delete(char *acl, char *principal); +int acl_initialize(char *acl_file, int mode); + +int krb_mk_req(KTEXT authent, char *service, char *instance, char *realm, + long checksum); +int krb_rd_req (KTEXT authent, char *service, char *instance, long from_addr, + AUTH_DAT *ad, char *fn); +int krb_kntoln(AUTH_DAT *ad, char *lname); +int krb_set_key(char *key, int cvt); +int krb_get_cred(char *service, char *instance, char *realm, CREDENTIALS *c); +long krb_mk_priv(u_char *in, u_char *out, u_long in_length, + des_key_schedule schedule, des_cblock key, struct sockaddr_in *sender, + struct sockaddr_in *receiver); +long krb_rd_priv(u_char *in, u_long in_length, Key_schedule schedule, + des_cblock key, struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *msg_data); +long krb_mk_safe(u_char *in, u_char *out, u_long in_length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver); +long krb_rd_safe(u_char *in, u_long length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *msg_data); +long krb_mk_err(u_char *out, long code, char *string); +int krb_rd_err(u_char *in, u_long in_length, long *code, MSG_DAT *m_data); + +int krb_get_lrealm(char *r, int n); +char *krb_get_phost(char *alias); +int krb_get_krbhst(char *h, char *r, int n); +int krb_get_admhst(char *h, char *r, int n); +int krb_net_write(int fd, char *buf, int len); +int krb_net_read(int fd, char *buf, int len); +int krb_get_tf_realm(char *ticket_file, char *realm); +int krb_get_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, int (*key_proc)(), int (*decrypt_proc)(), + char *arg); +int krb_get_pw_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, char *password); +int krb_get_tf_fullname(char *ticket_file, char *name, char *instance, + char *realm); +int save_credentials(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date); +int read_service_key(char *service, char *instance, char *realm, int kvno, + char *file, char *key); +int get_ad_tkt(char *service, char *sinstance, char *realm, int lifetime); +int send_to_kdc(KTEXT pkt, KTEXT rpkt, char *realm); +int decomp_ticket(KTEXT tkt, unsigned char *flags, char *pname, + char *pinstance, char *prealm, unsigned long *paddress, des_cblock session, + int *life, unsigned long *time_sec, char *sname, char *sinstance, + des_cblock key, des_key_schedule key_s); +int kname_parse(char *np, char *ip, char *rp, char *fullname); +int tf_init(char *tf_name, int rw); +int tf_save_cred(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date); +int tf_get_pname(char *p); +int tf_get_pinst(char *inst); +int tf_get_cred(CREDENTIALS *c); +void tf_close(void); +int getst(int fd, char *s, int n); +int pkt_clen(KTEXT pkt); +int in_tkt(char *pname, char *pinst); +char *month_sname(int n); +void log(); /* Actually VARARGS - markm */ + +extern int krb_ap_req_debug; +extern int krb_debug; + #endif KRB_DEFS diff --git a/eBones/include/krb_conf.h b/eBones/include/krb_conf.h index 5cd0ab9..ac7c2a8 100644 --- a/eBones/include/krb_conf.h +++ b/eBones/include/krb_conf.h @@ -14,7 +14,7 @@ * sources. * * from: krb_conf.h,v 4.0 89/01/23 09:59:27 jtkohl Exp $ - * $Id: krb_conf.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: krb_conf.h,v 1.3 1995/07/18 16:36:36 mark Exp $ */ #ifndef KRB_CONF_DEFS diff --git a/eBones/include/krb_db.h b/eBones/include/krb_db.h index e514339e..f7e6d57 100644 --- a/eBones/include/krb_db.h +++ b/eBones/include/krb_db.h @@ -11,7 +11,7 @@ * They MUST correspond to those defined in *.rel * * from: krb_db.h,v 4.9 89/01/24 17:55:39 jon Exp $ - * $Id: krb_db.h,v 1.1.1.1 1994/09/30 14:49:54 csgr Exp $ + * $Id: krb_db.h,v 1.3 1995/07/18 16:36:38 mark Exp $ */ #ifndef KRB_DB_DEFS @@ -90,11 +90,21 @@ typedef struct { } Dba; -extern int kerb_get_principal(); -extern int kerb_put_principal(); -extern int kerb_db_get_stat(); -extern int kerb_db_put_stat(); -extern int kerb_get_dba(); -extern int kerb_db_get_dba(); +extern int kerb_get_principal(char *name, char *inst, Principal *principal, + unsigned int max, int *more); +extern int kerb_put_principal(Principal *principal, unsigned int n); +extern void kerb_db_get_stat(DB_stat *s); +extern void kerb_db_put_stat(DB_stat *s); +extern int kerb_get_dba(char *name, char *inst, Dba *dba, unsigned int max, + int *more); +extern int kerb_db_get_dba(char *dba_name, char *dba_inst, Dba *dba, + unsigned int max, int *more); + +extern void krb_print_principal(Principal *p); +extern int kerb_db_get_principal(char *name, char *inst, Principal *principal, + unsigned int max, int *more); +extern int kerb_db_put_principal(Principal *principal, unsigned int max); +extern int kerb_db_init(void); +extern void kerb_db_fini(void); #endif /* KRB_DB_DEFS */ diff --git a/eBones/include/lsb_addr_comp.h b/eBones/include/lsb_addr_comp.h index fe7dc94..2686ade 100644 --- a/eBones/include/lsb_addr_comp.h +++ b/eBones/include/lsb_addr_comp.h @@ -7,7 +7,7 @@ * byte-order quantities * * from: lsb_addr_comp.h,v 4.0 89/01/23 15:44:46 jtkohl Exp $ - * $Id: lsb_addr_comp.h,v 1.2 1994/07/19 19:23:21 g89r4222 Exp $ + * $Id: lsb_addr_comp.h,v 1.3 1995/07/18 16:36:39 mark Exp $ */ #ifndef LSB_ADDR_COMP_DEFS diff --git a/eBones/include/osconf.h b/eBones/include/osconf.h index d3d4861..e0af41a 100644 --- a/eBones/include/osconf.h +++ b/eBones/include/osconf.h @@ -6,7 +6,7 @@ * Athena configuration. * * from: osconf.h,v 4.4 89/12/19 13:26:27 jtkohl Exp $ - * $Id: osconf.h,v 1.2 1994/07/19 19:23:22 g89r4222 Exp $ + * $Id: osconf.h,v 1.3 1995/07/18 16:36:41 mark Exp $ */ #ifdef tahoe diff --git a/eBones/include/passwd_server.h b/eBones/include/passwd_server.h index a8d9e18..662e654 100644 --- a/eBones/include/passwd_server.h +++ b/eBones/include/passwd_server.h @@ -6,7 +6,7 @@ * Include file for password server * * from: passwd_server.h,v 4.6 89/01/11 15:12:22 steiner Exp $ - * $Id: passwd_server.h,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * $Id: passwd_server.h,v 1.3 1995/07/18 16:36:43 mark Exp $ */ #ifndef PASSWD_SERVER_DEFS diff --git a/eBones/include/principal.h b/eBones/include/principal.h index 4590116..7fa67bc 100644 --- a/eBones/include/principal.h +++ b/eBones/include/principal.h @@ -6,7 +6,7 @@ * Definitions for principal names. * * from: principal.h,v 4.5 89/01/11 15:15:01 steiner Exp $ - * $Id: principal.h,v 1.2 1994/07/19 19:23:25 g89r4222 Exp $ + * $Id: principal.h,v 1.3 1995/07/18 16:36:45 mark Exp $ */ #ifndef PRINCIPAL_DEFS diff --git a/eBones/include/prot.h b/eBones/include/prot.h index 7865607..ec0ee07 100644 --- a/eBones/include/prot.h +++ b/eBones/include/prot.h @@ -7,7 +7,7 @@ * Include file with authentication protocol information. * * from: prot.h,v 4.13 89/01/24 14:27:22 jtkohl Exp $ - * $Id: prot.h,v 1.2 1994/07/19 19:23:27 g89r4222 Exp $ + * $Id: prot.h,v 1.3 1995/07/18 16:36:46 mark Exp $ */ #include diff --git a/eBones/kadmin/Makefile b/eBones/kadmin/Makefile index a22c9e2..d7cf0a3 100644 --- a/eBones/kadmin/Makefile +++ b/eBones/kadmin/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 1995/01/20 02:47:48 wollman Exp $ +# $Id: Makefile,v 1.1 1995/07/18 16:36:53 mark Exp $ BINDIR= /usr/bin PROG= kadmin diff --git a/eBones/kadmin/kadmin.c b/eBones/kadmin/kadmin.c index cbf4d6f..56f03d0 100644 --- a/eBones/kadmin/kadmin.c +++ b/eBones/kadmin/kadmin.c @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kadmin/kadmin.c,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/kadmin/kadmin.c,v $ + * $Author: mark $ * * Copyright 1988 by the Massachusetts Institute of Technology. * diff --git a/eBones/kadmin/kadmin_cmds.ct b/eBones/kadmin/kadmin_cmds.ct index 92d31fd..141ac15 100644 --- a/eBones/kadmin/kadmin_cmds.ct +++ b/eBones/kadmin/kadmin_cmds.ct @@ -1,12 +1,12 @@ -# $Source: /mit/kerberos/src/kadmin/RCS/kadmin_cmds.ct,v $ -# $Author: jtkohl $ -# $Header: /mit/kerberos/src/kadmin/RCS/kadmin_cmds.ct,v 4.1 89/07/25 17:02:28 jtkohl Exp $ +# $Source: /usr/cvs/src/eBones/kadmin/kadmin_cmds.ct,v $ +# $Author: mark $ +# $Header: /usr/cvs/src/eBones/kadmin/kadmin_cmds.ct,v 1.1 1995/07/18 16:36:56 mark Exp $ # # Copyright 1988 by the Massachusetts Institute of Technology. -# +# # For copying and distribution information, please see the file # . -# +# # Command table for Kerberos administration tool # command_table admin_cmds; diff --git a/eBones/kadmind/Makefile b/eBones/kadmind/Makefile index 77069be..620ab81 100644 --- a/eBones/kadmind/Makefile +++ b/eBones/kadmind/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:36:59 mark Exp $ PROG= kadmind SRCS= admin_server.c kadm_funcs.c kadm_ser_wrap.c kadm_server.c diff --git a/eBones/kadmind/kadm_funcs.c b/eBones/kadmind/kadm_funcs.c index 9f06e30..4ed2365 100644 --- a/eBones/kadmind/kadm_funcs.c +++ b/eBones/kadmind/kadm_funcs.c @@ -13,7 +13,7 @@ static char rcsid_kadm_funcs_c[] = "Id: kadm_funcs.c,v 4.3 90/03/20 01:39:51 jon Exp "; #endif static const char rcsid[] = - "$Id: kadm_funcs.c,v 1.1 1995/01/20 03:12:55 wollman Exp $"; + "$Id: kadm_funcs.c,v 1.1 1995/07/18 16:37:02 mark Exp $"; #endif lint /* diff --git a/eBones/kadmind/kadm_server.h b/eBones/kadmind/kadm_server.h index 33b1904..2d6f8bf 100644 --- a/eBones/kadmind/kadm_server.h +++ b/eBones/kadmind/kadm_server.h @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kadmind/kadm_server.h,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/kadmind/kadm_server.h,v $ + * $Author: mark $ * Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_server.h,v 4.1 89/12/21 17:46:51 jtkohl Exp * * Copyright 1988 by the Massachusetts Institute of Technology. @@ -24,7 +24,7 @@ #include #include -#include +#include typedef struct { struct sockaddr_in admin_addr; diff --git a/eBones/kdb/Makefile b/eBones/kdb/Makefile index b69c0d9..42f4235 100644 --- a/eBones/kdb/Makefile +++ b/eBones/kdb/Makefile @@ -1,11 +1,11 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.3 1994/09/09 21:43:41 g89r4222 Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:37:10 mark Exp $ SHLIB_MAJOR= 2 SHLIB_MINOR= 0 LIB= kdb -CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include +CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -Wall SRCS= krb_cache.c krb_dbm.c krb_kdb_utils.c krb_lib.c print_princ.c .include diff --git a/eBones/kdb/krb_cache.c b/eBones/kdb/krb_cache.c index 8da1d7d..0dafb140 100644 --- a/eBones/kdb/krb_cache.c +++ b/eBones/kdb/krb_cache.c @@ -6,13 +6,15 @@ * This is where a cache would be implemented, if it were necessary. * * from: krb_cache.c,v 4.5 89/01/24 18:12:34 jon Exp $ - * $Id: krb_cache.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * $Id: krb_cache.c,v 1.3 1995/07/18 16:37:12 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_cache.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: krb_cache.c,v 1.3 1995/07/18 16:37:12 mark Exp $"; #endif lint +#endif #include #include @@ -25,8 +27,6 @@ static char rcsid[] = #include #include -extern char *strncpy(); - #ifdef DEBUG extern int debug; extern long kerb_debug; @@ -49,15 +49,10 @@ kerb_cache_init() */ int -kerb_cache_get_principal(serv, inst, principal, max) - char *serv; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - unsigned int max; /* max number of name structs to return */ - +kerb_cache_get_principal(char *serv, char *inst, Principal *principal, + unsigned int max) { int found = 0; - u_long i; if (!init) kerb_cache_init(); @@ -70,7 +65,7 @@ kerb_cache_get_principal(serv, inst, principal, max) #ifdef DEBUG if (kerb_debug & 2) { if (found) { - fprintf(stderr, "cache get %s %s found %s %s sid = %d\n", + fprintf(stderr, "cache get %s %s found %s %s\n", serv, inst, principal->name, principal->instance); } else { fprintf(stderr, "cache %s %s not found\n", serv, @@ -87,13 +82,8 @@ kerb_cache_get_principal(serv, inst, principal, max) */ int -kerb_cache_put_principal(principal, max) - Principal *principal; - unsigned int max; /* max number of principal structs to - * insert */ - +kerb_cache_put_principal(Principal *principal, unsigned int max) { - int found = 0; u_long i; int count = 0; @@ -125,15 +115,9 @@ kerb_cache_put_principal(principal, max) */ int -kerb_cache_get_dba(serv, inst, dba, max) - char *serv; /* could have wild card */ - char *inst; /* could have wild card */ - Dba *dba; - unsigned int max; /* max number of name structs to return */ - +kerb_cache_get_dba(char *serv, char *inst, Dba *dba, unsigned int max) { int found = 0; - u_long i; if (!init) kerb_cache_init(); @@ -147,7 +131,7 @@ kerb_cache_get_dba(serv, inst, dba, max) #ifdef DEBUG if (kerb_debug & 2) { if (found) { - fprintf(stderr, "cache get %s %s found %s %s sid = %d\n", + fprintf(stderr, "cache get %s %s found %s %s\n", serv, inst, dba->name, dba->instance); } else { fprintf(stderr, "cache %s %s not found\n", serv, inst); @@ -162,12 +146,8 @@ kerb_cache_get_dba(serv, inst, dba, max) */ int -kerb_cache_put_dba(dba, max) - Dba *dba; - unsigned int max; /* max number of dba structs to insert */ - +kerb_cache_put_dba(Dba *dba, unsigned int max) { - int found = 0; u_long i; int count = 0; @@ -190,4 +170,3 @@ kerb_cache_put_dba(dba, max) } return count; } - diff --git a/eBones/kdb/krb_dbm.c b/eBones/kdb/krb_dbm.c index c42df20..68f428b 100644 --- a/eBones/kdb/krb_dbm.c +++ b/eBones/kdb/krb_dbm.c @@ -4,19 +4,27 @@ * . * * from: krb_dbm.c,v 4.9 89/04/18 16:15:13 wesommer Exp $ - * $Id: krb_dbm.c,v 1.3 1995/05/30 06:40:38 rgrimes Exp $ - */ + * $Id: krb_dbm.c,v 1.4 1995/08/03 17:15:42 mark Exp $ +*/ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_dbm.c,v 1.3 1995/05/30 06:40:38 rgrimes Exp $"; +"$Id: krb_dbm.c,v 1.4 1995/08/03 17:15:42 mark Exp $"; #endif lint +#endif #if defined(__FreeBSD__) || defined(__NetBSD__) -#define NDBM +#define NDBM_ +#endif + +#if defined(__FreeBSD__) || defined(__NetBSD__) +#define DBM_ #endif #include +#include +#include #include #include #include @@ -27,17 +35,17 @@ static char rcsid[] = #include #include #include -#ifdef NDBM +#ifdef NDBM_ #include -#else /*NDBM*/ +#else /*NDBM_*/ #include -#endif /*NDBM*/ +#endif /*NDBM_*/ /* before krb_db.h */ #include #include #ifdef dbm_pagfno -#define DB +#define DBM_ #endif #define KERB_DB_MAX_RETRY 5 @@ -47,10 +55,8 @@ extern int debug; extern long kerb_debug; extern char *progname; #endif -extern char *malloc(); -extern int errno; -static init = 0; +static init = 0; static char default_db_name[] = DBM_FILE; static char *current_db_name = default_db_name; static void encode_princ_key(), decode_princ_key(); @@ -122,7 +128,7 @@ static int non_blocking = 0; * Instead, all routines call "dbm_next" instead. */ -#ifndef NDBM +#ifndef NDBM_ typedef char DBM; #define dbm_open(file, flags, mode) ((dbminit(file) == 0)?"":((char *)0)) @@ -139,9 +145,7 @@ typedef char DBM; * Utility routine: generate name of database file. */ -static char *gen_dbsuffix(db_name, sfx) - char *db_name; - char *sfx; +static char *gen_dbsuffix(char *db_name, char *sfx) { char *dbsuffix; @@ -158,7 +162,7 @@ static char *gen_dbsuffix(db_name, sfx) * initialization for data base routines. */ -kerb_db_init() +int kerb_db_init() { init = 1; return (0); @@ -169,7 +173,7 @@ kerb_db_init() * a kerb_db_init */ -kerb_db_fini() +void kerb_db_fini() { } @@ -180,8 +184,7 @@ kerb_db_fini() * If the alternate database doesn't exist, nothing is changed. */ -kerb_db_set_name(name) - char *name; +int kerb_db_set_name(char *name) { DBM *db; @@ -225,8 +228,7 @@ long kerb_get_db_age() * the server (for example, during slave updates). */ -static long kerb_start_update(db_name) - char *db_name; +static long kerb_start_update(char *db_name) { char *okname = gen_dbsuffix(db_name, ".ok"); long age = kerb_get_db_age(); @@ -239,9 +241,7 @@ static long kerb_start_update(db_name) return age; } -static long kerb_end_update(db_name, age) - char *db_name; - long age; +static long kerb_end_update(char *db_name, long age) { int fd; int retval = 0; @@ -281,8 +281,7 @@ static long kerb_start_read() return kerb_get_db_age(); } -static long kerb_end_read(age) - u_long age; +static long kerb_end_read(u_long age) { if (kerb_get_db_age() != age || age == -1) { return -1; @@ -294,13 +293,12 @@ static long kerb_end_read(age) * Create the database, assuming it's not there. */ -kerb_db_create(db_name) - char *db_name; +int kerb_db_create(char *db_name) { char *okname = gen_dbsuffix(db_name, ".ok"); int fd; register int ret = 0; -#ifdef NDBM +#ifdef NDBM_ DBM *db; db = dbm_open(db_name, O_RDWR|O_CREAT|O_EXCL, 0600); @@ -343,11 +341,10 @@ kerb_db_create(db_name) * necessarily know to complete the transaction the rename, but... */ -kerb_db_rename(from, to) - char *from; - char *to; +int kerb_db_rename(char *from, char *to) { -#ifdef DB + int ok = 0; +#ifdef DBM_ char *fromdb = gen_dbsuffix (from, ".db"); char *todb = gen_dbsuffix (to, ".db"); #else @@ -358,9 +355,8 @@ kerb_db_rename(from, to) #endif char *fromok = gen_dbsuffix(from, ".ok"); long trans = kerb_start_update(to); - int ok; -#ifdef DB +#ifdef DBM_ if (rename (fromdb, todb) == 0) { #else if ((rename (fromdir, todir) == 0) @@ -371,7 +367,7 @@ kerb_db_rename(from, to) } free (fromok); -#ifdef DB +#ifdef DBM_ free (fromdb); free (todb); #else @@ -389,15 +385,15 @@ kerb_db_rename(from, to) /* * look up a principal in the data base returns number of principals * found , and whether there were more than requested. + char *name could have wild card + char *inst could have wild card + Principal *principal + unsigned int max max number of name structs to return + int *more where there more than 'max' tuples? */ -kerb_db_get_principal(name, inst, principal, max, more) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - unsigned int max; /* max number of name structs to return */ - int *more; /* where there more than 'max' tuples? */ - +int kerb_db_get_principal(char *name, char *inst, Principal *principal, + unsigned int max, int *more) { int found = 0, code; extern int errorproc(); @@ -495,11 +491,7 @@ kerb_db_get_principal(name, inst, principal, max, more) * successfully updated. */ -kerb_db_put_principal(principal, max) - Principal *principal; - unsigned int max; /* number of principal structs to - * update */ - +int kerb_db_put_principal(Principal *principal, unsigned int max) { int found = 0, code; u_long i; @@ -544,9 +536,7 @@ kerb_db_put_principal(principal, max) } static void -encode_princ_key(key, name, instance) - datum *key; - char *name, *instance; +encode_princ_key(datum *key, char *name, char *instance) { static char keystring[ANAME_SZ + INST_SZ]; @@ -558,9 +548,7 @@ encode_princ_key(key, name, instance) } static void -decode_princ_key(key, name, instance) - datum *key; - char *name, *instance; +decode_princ_key(datum *key, char *name, char *instance) { strncpy(name, key->dptr, ANAME_SZ); strncpy(instance, key->dptr + ANAME_SZ, INST_SZ); @@ -569,24 +557,19 @@ decode_princ_key(key, name, instance) } static void -encode_princ_contents(contents, principal) - datum *contents; - Principal *principal; +encode_princ_contents(datum *contents, Principal *principal) { contents->dsize = sizeof(*principal); contents->dptr = (char *) principal; } static void -decode_princ_contents(contents, principal) - datum *contents; - Principal *principal; +decode_princ_contents(datum *contents, Principal *principal) { bcopy(contents->dptr, (char *) principal, sizeof(*principal)); } -kerb_db_get_stat(s) - DB_stat *s; +void kerb_db_get_stat(DB_stat *s) { gettimeofday(×tamp, NULL); @@ -604,13 +587,11 @@ kerb_db_get_stat(s) /* update local copy too */ } -kerb_db_put_stat(s) - DB_stat *s; +void kerb_db_put_stat(DB_stat *s) { } -delta_stat(a, b, c) - DB_stat *a, *b, *c; +void delta_stat(DB_stat *a, DB_stat *b, DB_stat *c) { /* c = a - b then b = a for the next time */ @@ -626,7 +607,6 @@ delta_stat(a, b, c) c->n_put_stat = a->n_put_stat - b->n_put_stat; bcopy(a, b, sizeof(DB_stat)); - return; } /* @@ -634,21 +614,14 @@ delta_stat(a, b, c) * whether there were more than requested. */ -kerb_db_get_dba(dba_name, dba_inst, dba, max, more) - char *dba_name; /* could have wild card */ - char *dba_inst; /* could have wild card */ - Dba *dba; - unsigned int max; /* max number of name structs to return */ - int *more; /* where there more than 'max' tuples? */ - +int kerb_db_get_dba(char *dba_name, char *dba_inst, Dba *dba, unsigned int max, + int *more) { *more = 0; return (0); } -kerb_db_iterate (func, arg) - int (*func)(); - char *arg; /* void *, really */ +int kerb_db_iterate (int (*func)(), char *arg) { datum key, contents; Principal *principal; @@ -677,7 +650,7 @@ static int dblfd = -1; static int mylock = 0; static int inited = 0; -static kerb_dbl_init() +static int kerb_dbl_init() { if (!inited) { char *filename = gen_dbsuffix (current_db_name, ".ok"); @@ -701,8 +674,7 @@ static void kerb_dbl_fini() mylock = 0; } -static int kerb_dbl_lock(mode) - int mode; +static int kerb_dbl_lock(int mode) { int flock_mode; @@ -750,8 +722,7 @@ static void kerb_dbl_unlock() mylock = 0; } -int kerb_db_set_lockmode(mode) - int mode; +int kerb_db_set_lockmode(int mode) { int old = non_blocking; non_blocking = mode; diff --git a/eBones/kdb/krb_kdb_utils.c b/eBones/kdb/krb_kdb_utils.c index c283e0f..275cc39 100644 --- a/eBones/kdb/krb_kdb_utils.c +++ b/eBones/kdb/krb_kdb_utils.c @@ -10,25 +10,27 @@ * Jon Rochlis, MIT Telecom, March 1988 * * from: krb_kdb_utils.c,v 4.1 89/07/26 11:01:12 jtkohl Exp $ - * $Id: krb_kdb_utils.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * $Id: krb_kdb_utils.c,v 1.3 1995/07/18 16:37:15 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_kdb_utils.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: krb_kdb_utils.c,v 1.3 1995/07/18 16:37:15 mark Exp $"; #endif lint +#endif -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -long kdb_get_master_key(prompt, master_key, master_key_sched) - int prompt; - C_Block master_key; - Key_schedule master_key_sched; +long kdb_get_master_key(int prompt, C_Block master_key, + Key_schedule master_key_sched) { int kfile; @@ -37,7 +39,7 @@ long kdb_get_master_key(prompt, master_key, master_key_sched) placebo_read_password(master_key, "\nEnter Kerberos master key: ", 0); #else - des_read_password(master_key, + des_read_password((C_Block *)master_key, "\nEnter Kerberos master key: ", 0); #endif printf ("\n"); @@ -55,20 +57,33 @@ long kdb_get_master_key(prompt, master_key, master_key_sched) } #ifndef NOENCRYPTION - key_sched(master_key,master_key_sched); + key_sched((C_Block *)master_key,master_key_sched); #endif return (0); } +/* The old algorithm used the key schedule as the initial vector which + was byte order depedent ... */ + +void kdb_encrypt_key (C_Block in, C_Block out, C_Block master_key, + Key_schedule master_key_sched, int e_d_flag) +{ + +#ifdef NOENCRYPTION + bcopy(in, out, sizeof(C_Block)); +#else + pcbc_encrypt((C_Block *)in,(C_Block *)out,(long)sizeof(C_Block), + master_key_sched,(C_Block *)master_key, e_d_flag); +#endif +} + /* The caller is reasponsible for cleaning up the master key and sched, even if we can't verify the master key */ /* Returns master key version if successful, otherwise -1 */ -long kdb_verify_master_key (master_key, master_key_sched, out) - C_Block master_key; - Key_schedule master_key_sched; - FILE *out; /* setting this to non-null be do output */ +long kdb_verify_master_key (C_Block master_key, Key_schedule master_key_sched, + FILE *out) { C_Block key_from_db; Principal principal_data[1]; @@ -122,20 +137,3 @@ long kdb_verify_master_key (master_key, master_key_sched, out) return (master_key_version); } - -/* The old algorithm used the key schedule as the initial vector which - was byte order depedent ... */ - -kdb_encrypt_key (in, out, master_key, master_key_sched, e_d_flag) - C_Block in, out, master_key; - Key_schedule master_key_sched; - int e_d_flag; -{ - -#ifdef NOENCRYPTION - bcopy(in, out, sizeof(C_Block)); -#else - pcbc_encrypt(in,out,(long)sizeof(C_Block),master_key_sched,master_key, - e_d_flag); -#endif -} diff --git a/eBones/kdb/krb_lib.c b/eBones/kdb/krb_lib.c index b90d1a5..5610dbb 100644 --- a/eBones/kdb/krb_lib.c +++ b/eBones/kdb/krb_lib.c @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kdb/krb_lib.c,v $ - * $Author: csgr $ + * $Source: /usr/cvs/src/eBones/kdb/krb_lib.c,v $ + * $Author: mark $ * * Copyright 1988 by the Massachusetts Institute of Technology. * @@ -8,12 +8,15 @@ * . */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_lib.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: krb_lib.c,v 1.3 1995/07/18 16:37:17 mark Exp $"; #endif lint +#endif #include +#include #include #include #include @@ -30,10 +33,6 @@ extern char *progname; long kerb_debug; #endif -extern char *strncpy(); -extern char *ctime(); -extern char *getenv(); - static init = 0; /* @@ -47,7 +46,7 @@ kerb_init() if (!init) { char *dbg = getenv("KERB_DBG"); if (dbg) - sscanf(dbg, "%d", &kerb_debug); + sscanf(dbg, "%ld", &kerb_debug); init = 1; } #endif @@ -67,7 +66,7 @@ kerb_init() * caches, if they're ever really implemented. */ -int +void kerb_fini() { kerb_db_fini(); @@ -79,13 +78,8 @@ kerb_fini() */ int -kerb_get_principal(name, inst, principal, max, more) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - unsigned int max; /* max number of name structs to return */ - int *more; /* more tuples than room for */ - +kerb_get_principal(char *name, char *inst, Principal *principal, + unsigned int max, int *more) { int found = 0; #ifdef CACHE @@ -137,9 +131,7 @@ kerb_get_principal(name, inst, principal, max, more) } /* principals */ -kerb_put_principal(principal, n) - Principal *principal; - unsigned int n; /* number of principal structs to write */ +int kerb_put_principal(Principal *principal, unsigned int n) { long time(); struct tm *tp, *localtime(); @@ -184,13 +176,7 @@ kerb_put_principal(principal, n) } int -kerb_get_dba(name, inst, dba, max, more) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Dba *dba; - unsigned int max; /* max number of name structs to return */ - int *more; /* more tuples than room for */ - +kerb_get_dba(char *name, char *inst, Dba *dba, unsigned int max, int *more) { int found = 0; #ifdef CACHE diff --git a/eBones/kdb/print_princ.c b/eBones/kdb/print_princ.c index d04ca39..b1d1ca9 100644 --- a/eBones/kdb/print_princ.c +++ b/eBones/kdb/print_princ.c @@ -3,14 +3,16 @@ * For copying and distribution information, please see the file * . * - * from: $Header: /home/ncvs/src/eBones/kdb/print_princ.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ - * $Id: print_princ.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * from: $Header: /usr/cvs/src/eBones/kdb/print_princ.c,v 1.3 1995/07/18 16:37:19 mark Exp $ + * $Id: print_princ.c,v 1.3 1995/07/18 16:37:19 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: print_princ.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: print_princ.c,v 1.3 1995/07/18 16:37:19 mark Exp $"; #endif lint +#endif #include #include @@ -20,15 +22,11 @@ static char rcsid[] = #include extern int debug; -extern char *strncpy(); -extern char *ctime(); -extern struct tm *localtime(); -struct tm *time_p; long kerb_debug; +static struct tm *time_p; -krb_print_principal(a_n) - Principal *a_n; +void krb_print_principal(Principal *a_n) { /* run-time database does not contain string versions */ time_p = localtime(&(a_n->exp_date)); @@ -42,9 +40,9 @@ krb_print_principal(a_n) a_n->max_life, 5 * a_n->max_life, a_n->attributes); fprintf(stderr, - "\n\tkey_ver %d k_low 0x%08x k_high 0x%08x akv %d exists %d\n", + "\n\tkey_ver %d k_low 0x%08lx k_high 0x%08lx akv %d exists %d\n", a_n->key_version, a_n->key_low, a_n->key_high, - a_n->kdc_key_ver, a_n->old); + a_n->kdc_key_ver, (int)a_n->old); fflush(stderr); } diff --git a/eBones/kdb_destroy/Makefile b/eBones/kdb_destroy/Makefile index a48805b..2e8fcb9 100644 --- a/eBones/kdb_destroy/Makefile +++ b/eBones/kdb_destroy/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:23:46 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:22 mark Exp $ PROG= kdb_destroy CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/kdb_destroy/kdb_destroy.c b/eBones/kdb_destroy/kdb_destroy.c index ce59cc9..b669de2 100644 --- a/eBones/kdb_destroy/kdb_destroy.c +++ b/eBones/kdb_destroy/kdb_destroy.c @@ -4,12 +4,12 @@ * . * * from: kdb_destroy.c,v 4.0 89/01/24 21:49:02 jtkohl Exp $ - * $Id: kdb_destroy.c,v 1.3 1995/08/02 23:08:14 pst Exp $ + * $Id: kdb_destroy.c,v 1.5 1995/08/04 06:35:45 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_destroy.c,v 1.3 1995/08/02 23:08:14 pst Exp $"; +"$Id: kdb_destroy.c,v 1.5 1995/08/04 06:35:45 mark Exp $"; #endif lint #include @@ -17,10 +17,11 @@ static char rcsid[] = #include "krb.h" #include "krb_db.h" -#ifdef dbm_pagfno +#if defined(__FreeBSD__) || defined(__NetBSD__) #define DB #endif + main() { char answer[10]; /* user input */ diff --git a/eBones/kdb_edit/Makefile b/eBones/kdb_edit/Makefile index 65a5e5a..792e7c5 100644 --- a/eBones/kdb_edit/Makefile +++ b/eBones/kdb_edit/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.2 (Berkeley) 2/14/91 -# $Id: Makefile,v 1.2 1994/07/19 19:23:53 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:25 mark Exp $ PROG= kdb_edit CFLAGS+=-DKERBEROS -DDEBUG -I. -I${.CURDIR}/../include diff --git a/eBones/kdb_edit/kdb_edit.c b/eBones/kdb_edit/kdb_edit.c index 00c2308..61cf71a 100644 --- a/eBones/kdb_edit/kdb_edit.c +++ b/eBones/kdb_edit/kdb_edit.c @@ -8,7 +8,7 @@ * i.e., users or services. * * from: kdb_edit.c,v 4.2 90/01/09 16:05:09 raeburn Exp $ - * $Id: kdb_edit.c,v 1.2 1995/05/30 06:40:41 rgrimes Exp $ + * $Id: kdb_edit.c,v 1.5 1995/08/03 17:15:54 mark Exp $ */ /* @@ -17,7 +17,7 @@ #ifndef lint static char rcsid[] = -"$Id: kdb_edit.c,v 1.2 1995/05/30 06:40:41 rgrimes Exp $"; +"$Id: kdb_edit.c,v 1.5 1995/08/03 17:15:54 mark Exp $"; #endif lint #include diff --git a/eBones/kdb_edit/maketime.c b/eBones/kdb_edit/maketime.c index 057ecc3..ed485af 100644 --- a/eBones/kdb_edit/maketime.c +++ b/eBones/kdb_edit/maketime.c @@ -6,7 +6,7 @@ * Convert a struct tm * to a UNIX time. * * from: maketime.c,v 4.2 90/01/09 15:54:51 raeburn Exp $ - * $Id: maketime.c,v 1.2 1994/07/19 19:23:56 g89r4222 Exp $ + * $Id: maketime.c,v 1.3 1995/07/18 16:37:29 mark Exp $ */ #ifndef lint diff --git a/eBones/kdb_edit/time.h b/eBones/kdb_edit/time.h index ed128d8..ae84e2e 100644 --- a/eBones/kdb_edit/time.h +++ b/eBones/kdb_edit/time.h @@ -6,7 +6,7 @@ /* * from: time.h,v 1.1 82/05/06 11:34:29 wft Exp $ - * $Id: time.h,v 1.2 1994/07/19 19:23:58 g89r4222 Exp $ + * $Id: time.h,v 1.3 1995/07/18 16:37:31 mark Exp $ */ struct tm { /* See defines below for allowable ranges */ diff --git a/eBones/kdb_init/Makefile b/eBones/kdb_init/Makefile index ce51a9f..7738312 100644 --- a/eBones/kdb_init/Makefile +++ b/eBones/kdb_init/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:03 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:34 mark Exp $ PROG= kdb_init CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/kdb_init/kdb_init.c b/eBones/kdb_init/kdb_init.c index 7a8e32f..d48ee096 100644 --- a/eBones/kdb_init/kdb_init.c +++ b/eBones/kdb_init/kdb_init.c @@ -7,12 +7,12 @@ * already exists. * * from: kdb_init.c,v 4.0 89/01/24 21:50:45 jtkohl Exp $ - * $Id: kdb_init.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $ + * $Id: kdb_init.c,v 1.4 1995/07/18 16:37:35 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_init.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $"; +"$Id: kdb_init.c,v 1.4 1995/07/18 16:37:35 mark Exp $"; #endif lint #include @@ -119,9 +119,6 @@ add_principal(name, instance, aap_op) Principal principal; char datestring[50]; char pw_str[255]; - void read_pw_string(); - void string_to_key(); - void random_key(); struct tm *tm, *localtime(); C_Block new_key; diff --git a/eBones/kdb_util/Makefile b/eBones/kdb_util/Makefile index b3513d6..bffeb51 100644 --- a/eBones/kdb_util/Makefile +++ b/eBones/kdb_util/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.2 (Berkeley) 2/14/91 -# $Id: Makefile,v 1.2 1994/07/19 19:24:09 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:38 mark Exp $ PROG= kdb_util CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../kdb_edit \ diff --git a/eBones/kdb_util/kdb_util.c b/eBones/kdb_util/kdb_util.c index 97f7a65e..140e211 100644 --- a/eBones/kdb_util/kdb_util.c +++ b/eBones/kdb_util/kdb_util.c @@ -12,12 +12,12 @@ * Written July 9, 1987 by Jeffrey I. Schiller * * from: kdb_util.c,v 4.4 90/01/09 15:57:20 raeburn Exp $ - * $Id: kdb_util.c,v 1.2 1995/05/30 06:40:44 rgrimes Exp $ + * $Id: kdb_util.c,v 1.5 1995/08/03 17:15:57 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_util.c,v 1.2 1995/05/30 06:40:44 rgrimes Exp $"; +"$Id: kdb_util.c,v 1.5 1995/08/03 17:15:57 mark Exp $"; #endif lint #include diff --git a/eBones/kdestroy/Makefile b/eBones/kdestroy/Makefile index 5947028..2a79774 100644 --- a/eBones/kdestroy/Makefile +++ b/eBones/kdestroy/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:15 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:42 mark Exp $ PROG= kdestroy CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -DBSD42 diff --git a/eBones/kdestroy/kdestroy.c b/eBones/kdestroy/kdestroy.c index 8a7cbb7..c64a731 100644 --- a/eBones/kdestroy/kdestroy.c +++ b/eBones/kdestroy/kdestroy.c @@ -10,12 +10,12 @@ * -f[orce] - no message printed at all * * from: kdestroy.c,v 4.5 88/03/18 15:16:02 steiner Exp $ - * $Id: kdestroy.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ + * $Id: kdestroy.c,v 1.3 1995/07/18 16:37:44 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdestroy.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $"; +"$Id: kdestroy.c,v 1.3 1995/07/18 16:37:44 mark Exp $"; #endif lint #include diff --git a/eBones/kerberos/Makefile b/eBones/kerberos/Makefile index 44853ef..bd3d89f 100644 --- a/eBones/kerberos/Makefile +++ b/eBones/kerberos/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:47 mark Exp $ PROG= kerberos SRCS= kerberos.c cr_err_reply.c diff --git a/eBones/kerberos/cr_err_reply.c b/eBones/kerberos/cr_err_reply.c index c5178fe..924a98f 100644 --- a/eBones/kerberos/cr_err_reply.c +++ b/eBones/kerberos/cr_err_reply.c @@ -5,12 +5,12 @@ * . * * from: cr_err_reply.c,v 4.10 89/01/10 11:34:42 steiner Exp $ - * $Id: cr_err_reply.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ + * $Id: cr_err_reply.c,v 1.2 1995/07/18 16:37:49 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: cr_err_reply.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $"; +"$Id: cr_err_reply.c,v 1.2 1995/07/18 16:37:49 mark Exp $"; #endif /* lint */ #include diff --git a/eBones/kerberos/kerberos.c b/eBones/kerberos/kerberos.c index a7f391c..d0ce795 100644 --- a/eBones/kerberos/kerberos.c +++ b/eBones/kerberos/kerberos.c @@ -5,12 +5,12 @@ * . * * from: kerberos.c,v 4.19 89/11/01 17:18:07 qjb Exp $ - * $Id: kerberos.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ + * $Id: kerberos.c,v 1.4 1995/07/18 16:37:51 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kerberos.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $"; +"$Id: kerberos.c,v 1.4 1995/07/18 16:37:51 mark Exp $"; #endif lint #include diff --git a/eBones/kinit/Makefile b/eBones/kinit/Makefile index e616f42..24f1a95 100644 --- a/eBones/kinit/Makefile +++ b/eBones/kinit/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:31 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:53 mark Exp $ PROG= kinit CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -DBSD42 diff --git a/eBones/kinit/kinit.c b/eBones/kinit/kinit.c index 9f531d1..6cde305 100644 --- a/eBones/kinit/kinit.c +++ b/eBones/kinit/kinit.c @@ -15,12 +15,12 @@ * -l[ifetime] * * from: kinit.c,v 4.12 90/03/20 16:11:15 jon Exp $ - * $Id: kinit.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $ + * $Id: kinit.c,v 1.4 1995/08/03 17:16:00 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kinit.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $"; +"$Id: kinit.c,v 1.4 1995/08/03 17:16:00 mark Exp $"; #endif lint #include @@ -35,7 +35,7 @@ static char rcsid[] = #define LEN 64 /* just guessing */ #endif PC -#if defined(BSD42) || defined(__FreeBSD__) +#if defined(BSD42) || defined(__FreeBSD__) || defined(__NetBSD__) #include #include #if defined(ultrix) || defined(sun) diff --git a/eBones/klist/Makefile b/eBones/klist/Makefile index aa0d720..b5ec669 100644 --- a/eBones/klist/Makefile +++ b/eBones/klist/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:37 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:57 mark Exp $ PROG= klist CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/klist/klist.c b/eBones/klist/klist.c index bfc3aa0..29e6453 100644 --- a/eBones/klist/klist.c +++ b/eBones/klist/klist.c @@ -7,12 +7,12 @@ * Written by Bill Sommerfeld, MIT Project Athena. * * from: klist.c,v 4.15 89/08/30 11:19:16 jtkohl Exp $ - * $Id: klist.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $ + * $Id: klist.c,v 1.3 1995/07/18 16:37:59 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: klist.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $"; +"$Id: klist.c,v 1.3 1995/07/18 16:37:59 mark Exp $"; #endif lint #include diff --git a/eBones/kprop/Makefile b/eBones/kprop/Makefile index 962813e..fa70067 100644 --- a/eBones/kprop/Makefile +++ b/eBones/kprop/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id$ +# $Id: Makefile,v 1.1.1.1 1995/08/03 07:36:18 mark Exp $ PROG= kprop CFLAGS+=-I${.CURDIR}/../include diff --git a/eBones/kprop/kprop.c b/eBones/kprop/kprop.c index 91fb08f..cde1cce 100644 --- a/eBones/kprop/kprop.c +++ b/eBones/kprop/kprop.c @@ -5,14 +5,36 @@ * For copying and distribution information, * please see the file . * - * $Revision: 4.7 $ - * $Date: 92/11/10 23:01:06 $ + * $Revision: 1.1.1.1 $ + * $Date: 1995/08/03 07:36:18 $ * $State: Exp $ - * $Source: /afs/net.mit.edu/project/krb4/src/slave/RCS/kprop.c,v $ - * $Author: tytso $ + * $Source: /usr/cvs/src/eBones/kprop/kprop.c,v $ + * $Author: mark $ * $Locker: $ * - * $Log: kprop.c,v $ + * $Log: kprop.c,v $ + * Revision 1.1.1.1 1995/08/03 07:36:18 mark + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * + * Revision 1.1.1.1 1995/08/02 22:11:44 pst + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * * Revision 4.7 92/11/10 23:01:06 tytso * Removed incompatible #include * @@ -50,7 +72,7 @@ #ifndef lint static char rcsid_kprop_c[] = -"$Id: kprop.c,v 4.7 92/11/10 23:01:06 tytso Exp $"; +"$Id: kprop.c,v 1.1.1.1 1995/08/03 07:36:18 mark Exp $"; #endif lint #include diff --git a/eBones/kprop/kprop.h b/eBones/kprop/kprop.h index 2f34e36..5197276 100644 --- a/eBones/kprop/kprop.h +++ b/eBones/kprop/kprop.h @@ -4,14 +4,36 @@ * For copying and distribution information, * please see the file . * - * $Revision: 4.1 $ - * $Date: 92/10/23 15:45:13 $ + * $Revision: 1.1.1.1 $ + * $Date: 1995/08/03 07:36:18 $ * $State: Exp $ - * $Source: /afs/net.mit.edu/project/krb4/src/slave/RCS/kprop.h,v $ - * $Author: tytso $ + * $Source: /usr/cvs/src/eBones/kprop/kprop.h,v $ + * $Author: mark $ * $Locker: $ * - * $Log: kprop.h,v $ + * $Log: kprop.h,v $ + * Revision 1.1.1.1 1995/08/03 07:36:18 mark + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * + * Revision 1.1.1.1 1995/08/02 22:11:44 pst + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * * Revision 4.1 92/10/23 15:45:13 tytso * Change the location of KPROP_KDBUTIL to be /kerberos/bin/kdb_util. * diff --git a/eBones/kpropd/Makefile b/eBones/kpropd/Makefile index 74d774f..8cc6673 100644 --- a/eBones/kpropd/Makefile +++ b/eBones/kpropd/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id$ +# $Id: Makefile,v 1.1.1.1 1995/08/03 07:37:19 mark Exp $ PROG= kpropd CFLAGS+=-I${.CURDIR}/../include -I${.CURDIR}/../kprop diff --git a/eBones/kpropd/kpropd.c b/eBones/kpropd/kpropd.c index db99ae0..037d913 100644 --- a/eBones/kpropd/kpropd.c +++ b/eBones/kpropd/kpropd.c @@ -10,8 +10,8 @@ * adapted from the MIT distribution to work properly in a 4.4BSD * environment. * - * $Revision: 4.5 $ $Date: 92/10/23 15:45:46 $ $State: Exp $ - * $Source$ + * $Revision: 1.1.1.1 $ $Date: 1995/08/03 07:37:19 $ $State: Exp $ + * $Source: /usr/cvs/src/eBones/kpropd/kpropd.c,v $ * * Log: kpropd.c,v * Revision 4.5 92/10/23 15:45:46 tytso Make it possible @@ -38,7 +38,7 @@ #ifndef lint static char rcsid_kpropd_c[] = -"$Header: /afs/net.mit.edu/project/krb4/src/slave/RCS/kpropd.c,v 4.5 92/10/23 15:45:46 tytso Exp $"; +"$Header: /usr/cvs/src/eBones/kpropd/kpropd.c,v 1.1.1.1 1995/08/03 07:37:19 mark Exp $"; #endif /* lint */ #include diff --git a/eBones/krb/Makefile b/eBones/krb/Makefile index 205b024..10ef4ba 100644 --- a/eBones/krb/Makefile +++ b/eBones/krb/Makefile @@ -1,10 +1,10 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.4 1995/01/20 01:12:19 wollman Exp $ +# $Id: Makefile,v 1.5 1995/07/18 16:38:02 mark Exp $ LIB= krb SHLIB_MAJOR= 2 SHLIB_MINOR= 0 -CFLAGS+=-DKERBEROS -DCRYPT -DDEBUG -I${.CURDIR}/../include -DBSD42 +CFLAGS+=-DKERBEROS -DCRYPT -DDEBUG -I${.CURDIR}/../include -DBSD42 -Wall SRCS= krb_err.c create_auth_reply.c create_ciph.c \ create_death_packet.c create_ticket.c debug_decl.c decomp_ticket.c \ des_rw.c dest_tkt.c extract_ticket.c fgetst.c get_ad_tkt.c \ diff --git a/eBones/krb/add_ticket.c b/eBones/krb/add_ticket.c index cb79a18..bec7cd8 100644 --- a/eBones/krb/add_ticket.c +++ b/eBones/krb/add_ticket.c @@ -5,13 +5,15 @@ * . * * from: add_ticket.c,v 4.7 88/10/07 06:06:26 shanzer Exp $ - * $Id: add_ticket.c,v 1.2 1994/07/19 19:24:54 g89r4222 Exp $ + * $Id: add_ticket.c,v 1.3 1995/07/18 16:38:04 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: add_ticket.c,v 1.2 1994/07/19 19:24:54 g89r4222 Exp $"; +"$Id: add_ticket.c,v 1.3 1995/07/18 16:38:04 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/krb/create_auth_reply.c b/eBones/krb/create_auth_reply.c index bfc3cfe..ea3afd6 100644 --- a/eBones/krb/create_auth_reply.c +++ b/eBones/krb/create_auth_reply.c @@ -5,14 +5,17 @@ * . * * from: create_auth_reply.c,v 4.10 89/01/13 17:47:38 steiner Exp $ - * $Id: create_auth_reply.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_auth_reply.c,v 1.3 1995/07/18 16:38:06 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_auth_reply.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_auth_reply.c,v 1.3 1995/07/18 16:38:06 mark Exp $"; #endif /* lint */ +#endif +#include #include #include #include diff --git a/eBones/krb/create_ciph.c b/eBones/krb/create_ciph.c index 634d371..a383604 100644 --- a/eBones/krb/create_ciph.c +++ b/eBones/krb/create_ciph.c @@ -5,13 +5,15 @@ * . * * from: create_ciph.c,v 4.8 89/05/18 21:24:26 jis Exp $ - * $Id: create_ciph.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_ciph.c,v 1.3 1995/07/18 16:38:07 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_ciph.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_ciph.c,v 1.3 1995/07/18 16:38:07 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -54,18 +56,9 @@ static char *rcsid = * */ -create_ciph(c, session, service, instance, realm, life, kvno, tkt, - kdc_time, key) - KTEXT c; /* Text block to hold ciphertext */ - C_Block session; /* Session key to send to user */ - char *service; /* Service name on ticket */ - char *instance; /* Instance name on ticket */ - char *realm; /* Realm of this KDC */ - unsigned long life; /* Lifetime of the ticket */ - int kvno; /* Key version number for service */ - KTEXT tkt; /* The ticket for the service */ - unsigned long kdc_time; /* KDC time */ - C_Block key; /* Key to encrypt ciphertext with */ +int create_ciph(KTEXT c, des_cblock session, char *service, char *instance, + char *realm, unsigned long life, int kvno, KTEXT tkt, + unsigned long kdc_time, des_cblock key) { char *ptr; Key_schedule key_s; @@ -100,9 +93,9 @@ create_ciph(c, session, service, instance, realm, life, kvno, tkt, c->length = (((ptr - (char *) c->dat) + 7) / 8) * 8; #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)c->dat,(C_Block *)c->dat,(long) c->length,key_s, - key,ENCRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)c->dat,(des_cblock *)c->dat,(long) c->length, + key_s,(des_cblock *)key,ENCRYPT); #endif /* NOENCRYPTION */ return(KSUCCESS); diff --git a/eBones/krb/create_death_packet.c b/eBones/krb/create_death_packet.c index 080e8a8..bdc0e34 100644 --- a/eBones/krb/create_death_packet.c +++ b/eBones/krb/create_death_packet.c @@ -5,13 +5,15 @@ * . * * from: create_death_packet.c,v 4.9 89/01/17 16:05:59 rfrench Exp $ - * $Id: create_death_packet.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_death_packet.c,v 1.3 1995/07/18 16:38:09 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_death_packet.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_death_packet.c,v 1.3 1995/07/18 16:38:09 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/krb/create_ticket.c b/eBones/krb/create_ticket.c index 95d5ced..264d1ac 100644 --- a/eBones/krb/create_ticket.c +++ b/eBones/krb/create_ticket.c @@ -5,13 +5,15 @@ * . * * from: create_ticket.c,v 4.11 89/03/22 14:43:23 jtkohl Exp $ - * $Id: create_ticket.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_ticket.c,v 1.3 1995/07/18 16:38:12 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: create_ticket.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_ticket.c,v 1.3 1995/07/18 16:38:12 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -68,20 +70,9 @@ static char rcsid[] = * */ -int krb_create_ticket(tkt, flags, pname, pinstance, prealm, paddress, - session, life, time_sec, sname, sinstance, key) - KTEXT tkt; /* Gets filled in by the ticket */ - unsigned char flags; /* Various Kerberos flags */ - char *pname; /* Principal's name */ - char *pinstance; /* Principal's instance */ - char *prealm; /* Principal's authentication domain */ - long paddress; /* Net address of requesting entity */ - char *session; /* Session key inserted in ticket */ - short life; /* Lifetime of the ticket */ - long time_sec; /* Issue time and date */ - char *sname; /* Service Name */ - char *sinstance; /* Instance Name */ - C_Block key; /* Service's secret key */ +int krb_create_ticket(KTEXT tkt, unsigned char flags, char *pname, + char *pinstance, char *prealm, long paddress, char *session, short life, + long time_sec, char *sname, char *sinstance, des_cblock key) { Key_schedule key_s; register char *data; /* running index into ticket */ @@ -122,9 +113,9 @@ int krb_create_ticket(tkt, flags, pname, pinstance, prealm, paddress, } #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,(long)tkt->length, - key_s,key,ENCRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)tkt->dat,(des_cblock *)tkt->dat, + (long)tkt->length,key_s,(des_cblock *)key,ENCRYPT); #endif return 0; } diff --git a/eBones/krb/debug_decl.c b/eBones/krb/debug_decl.c index 1a0f6df..f548e2a 100644 --- a/eBones/krb/debug_decl.c +++ b/eBones/krb/debug_decl.c @@ -4,13 +4,15 @@ * . * * from: debug_decl.c,v 4.5 88/10/07 06:07:49 shanzer Exp $ - * $Id: debug_decl.c,v 1.2 1994/07/19 19:25:03 g89r4222 Exp $ + * $Id: debug_decl.c,v 1.3 1995/07/18 16:38:14 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: debug_decl.c,v 1.2 1994/07/19 19:25:03 g89r4222 Exp $"; +"$Id: debug_decl.c,v 1.3 1995/07/18 16:38:14 mark Exp $"; #endif lint +#endif /* Declare global debugging variables. */ diff --git a/eBones/krb/decomp_ticket.c b/eBones/krb/decomp_ticket.c index 181864c..ab46450 100644 --- a/eBones/krb/decomp_ticket.c +++ b/eBones/krb/decomp_ticket.c @@ -5,13 +5,15 @@ * . * * from: decomp_ticket.c,v 4.12 89/05/16 18:44:46 jtkohl Exp $ - * $Id: decomp_ticket.c,v 1.2 1994/07/19 19:25:05 g89r4222 Exp $ + * $Id: decomp_ticket.c,v 1.3 1995/07/18 16:38:15 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: decomp_ticket.c,v 1.2 1994/07/19 19:25:05 g89r4222 Exp $"; +"$Id: decomp_ticket.c,v 1.3 1995/07/18 16:38:15 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -44,31 +46,18 @@ static char *rcsid = * See create_ticket.c for the format of the ticket packet. */ -decomp_ticket(tkt, flags, pname, pinstance, prealm, paddress, session, - life, time_sec, sname, sinstance, key, key_s) - KTEXT tkt; /* The ticket to be decoded */ - unsigned char *flags; /* Kerberos ticket flags */ - char *pname; /* Authentication name */ - char *pinstance; /* Principal's instance */ - char *prealm; /* Principal's authentication domain */ - unsigned long *paddress; /* Net address of entity - * requesting ticket */ - C_Block session; /* Session key inserted in ticket */ - int *life; /* Lifetime of the ticket */ - unsigned long *time_sec; /* Issue time and date */ - char *sname; /* Service name */ - char *sinstance; /* Service instance */ - C_Block key; /* Service's secret key - * (to decrypt the ticket) */ - Key_schedule key_s; /* The precomputed key schedule */ +int decomp_ticket(KTEXT tkt, unsigned char *flags, char *pname, + char *pinstance, char *prealm, unsigned long *paddress, des_cblock session, + int *life, unsigned long *time_sec, char *sname, char *sinstance, + des_cblock key, des_key_schedule key_s) { static int tkt_swap_bytes; unsigned char *uptr; char *ptr = (char *)tkt->dat; #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,(long)tkt->length, - key_s,key,DECRYPT); + pcbc_encrypt((des_cblock *)tkt->dat,(des_cblock *)tkt->dat, + (long)tkt->length,key_s,(des_cblock *)key,DECRYPT); #endif /* ! NOENCRYPTION */ *flags = *ptr; /* get flags byte */ diff --git a/eBones/krb/des_rw.c b/eBones/krb/des_rw.c index e5acb39..774e62b 100644 --- a/eBones/krb/des_rw.c +++ b/eBones/krb/des_rw.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: des_rw.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: des_rw.c,v 1.6 1995/07/18 16:38:17 mark Exp $ */ /* @@ -100,18 +100,11 @@ #include #include -#include -#include - -extern int krb_net_read(int fd, void * data, size_t length); -extern int des_pcbc_encrypt(des_cblock *input, des_cblock *output, - register long length, - des_key_schedule schedule, - des_cblock *ivec, - int encrypt); +#include +#include static bit_64 des_key; -static des_key_schedule key_sched; +static des_key_schedule key_schedule; /* * Buffer for storing extra data when more data is received, then was @@ -127,12 +120,10 @@ static u_char *buff_ptr = buffer; * inkey is the initial vector for the DES encryption, while insched is * the DES key, in unwrapped form. */ -void des_set_key(inkey, insched) - bit_64 *inkey; - u_char *insched; +void des_set_key(bit_64 *inkey, u_char *insched) { bcopy(inkey, &des_key, sizeof(bit_64)); - bcopy(insched, &key_sched, sizeof(des_key_schedule)); + bcopy(insched, &key_schedule, sizeof(des_key_schedule)); } /* @@ -142,13 +133,10 @@ void des_set_key(inkey, insched) void des_clear_key() { bzero(&des_key, sizeof(des_cblock)); - bzero(&key_sched, sizeof(des_key_schedule)); + bzero(&key_schedule, sizeof(des_key_schedule)); } -int des_read(fd, buf, len) - int fd; - register char * buf; - int len; +int des_read(int fd, char *buf, int len) { int msg_length; /* length of actual message data */ int pad_length; /* length of padded message */ @@ -173,7 +161,7 @@ int des_read(fd, buf, len) } } - nread = krb_net_read(fd, &msg_length, sizeof(msg_length)); + nread = krb_net_read(fd,(char *)&msg_length, sizeof(msg_length)); if(nread != (int)(sizeof(msg_length))) return(0); @@ -186,7 +174,7 @@ int des_read(fd, buf, len) des_pcbc_encrypt((des_cblock*) des_buff, (des_cblock*) buff_ptr, (msg_length < 8 ? 8 : msg_length), - key_sched, (des_cblock*) &des_key, DES_DECRYPT); + key_schedule, (des_cblock*) &des_key, DES_DECRYPT); if(msg_length < 8) @@ -212,17 +200,13 @@ int des_read(fd, buf, len) * Write a message onto a file descriptor (generally a socket), using * DES to encrypt the message. */ -int des_write(fd, buf, len) - int fd; - char * buf; - int len; +int des_write(int fd, char *buf, int len) { static int seeded = 0; char garbage[8]; long rnd; int pad_len; int write_len; - int nwritten = 0; int i; char *data; @@ -249,7 +233,7 @@ int des_write(fd, buf, len) } des_pcbc_encrypt((des_cblock*) data, (des_cblock*) des_buff, - (len < 8)?8:len, key_sched, (des_cblock*) &des_key, DES_ENCRYPT); + (len < 8)?8:len, key_schedule, (des_cblock*) &des_key, DES_ENCRYPT); write_len = htonl(len); diff --git a/eBones/krb/dest_tkt.c b/eBones/krb/dest_tkt.c index 6a06454..6e6082e 100644 --- a/eBones/krb/dest_tkt.c +++ b/eBones/krb/dest_tkt.c @@ -5,15 +5,20 @@ * . * * from: dest_tkt.c,v 4.9 89/10/02 16:23:07 jtkohl Exp $ - * $Id: dest_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: dest_tkt.c,v 1.3 1995/07/18 16:38:19 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: dest_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: dest_tkt.c,v 1.3 1995/07/18 16:38:19 mark Exp $"; #endif /* lint */ +#endif #include +#include +#include +#include #include #include #include @@ -32,7 +37,7 @@ static char *rcsid = * The ticket file (TKT_FILE) is defined in "krb.h". */ -dest_tkt() +int dest_tkt() { char *file = TKT_FILE; int i,fd; diff --git a/eBones/krb/extract_ticket.c b/eBones/krb/extract_ticket.c index 571d5da..97e8432 100644 --- a/eBones/krb/extract_ticket.c +++ b/eBones/krb/extract_ticket.c @@ -5,13 +5,15 @@ * . * * from: extract_ticket.c,v 4.6 88/10/07 06:08:15 shanzer Exp $ - * $Id: extract_ticket.c,v 1.2 1994/07/19 19:25:08 g89r4222 Exp $ + * $Id: extract_ticket.c,v 1.3 1995/07/18 16:38:21 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: extract_ticket.c,v 1.2 1994/07/19 19:25:08 g89r4222 Exp $"; +"$Id: extract_ticket.c,v 1.3 1995/07/18 16:38:21 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -25,14 +27,8 @@ static char *rcsid = * session, liftime and kvno. */ -extract_ticket(cipher,n,session,lifetime,kvno,realm,ticket) - KTEXT cipher; /* The ciphertext */ - int n; /* Which ticket */ - char *session; /* The session key for this tkt */ - int *lifetime; /* The life of this ticket */ - int *kvno; /* The kvno for the service */ - char *realm; /* Realm in which tkt issued */ - KTEXT ticket; /* The ticket itself */ +void extract_ticket(KTEXT cipher, int n, char *session, int *lifetime, + int *kvno, char *realm, KTEXT ticket) { char *ptr; int i; diff --git a/eBones/krb/fgetst.c b/eBones/krb/fgetst.c index b855541..4c6a364 100644 --- a/eBones/krb/fgetst.c +++ b/eBones/krb/fgetst.c @@ -4,13 +4,15 @@ * . * * from: fgetst.c,v 4.0 89/01/23 10:08:31 jtkohl Exp $ - * $Id: fgetst.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: fgetst.c,v 1.3 1995/07/18 16:38:23 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: fgetst.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: fgetst.c,v 1.3 1995/07/18 16:38:23 mark Exp $"; #endif /* lint */ +#endif #include @@ -23,10 +25,7 @@ static char rcsid[] = * returns the number of characters read, including the null terminator. */ -fgetst(f, s, n) - FILE *f; - register char *s; - int n; +int fgetst(FILE *f, char *s, int n) { register count = n; int ch; /* NOT char; otherwise you don't see EOF */ diff --git a/eBones/krb/get_ad_tkt.c b/eBones/krb/get_ad_tkt.c index 1c14d3c..ad76a4f 100644 --- a/eBones/krb/get_ad_tkt.c +++ b/eBones/krb/get_ad_tkt.c @@ -5,13 +5,15 @@ * . * * from: get_ad_tkt.c,v 4.15 89/07/07 15:18:51 jtkohl Exp $ - * $Id: get_ad_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: get_ad_tkt.c,v 1.3 1995/07/18 16:38:25 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_ad_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: get_ad_tkt.c,v 1.3 1995/07/18 16:38:25 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -25,8 +27,6 @@ static char rcsid[] = #include #include -extern int krb_debug; - struct timeval tt_local = { 0, 0 }; int swap_bytes; @@ -65,11 +65,7 @@ unsigned long rep_err_code; * extraction macros like pkt_version(), pkt_msg_type(), etc. */ -get_ad_tkt(service,sinstance,realm,lifetime) - char *service; - char *sinstance; - char *realm; - int lifetime; +int get_ad_tkt(char *service, char *sinstance, char *realm, int lifetime) { static KTEXT_ST pkt_st; KTEXT pkt = & pkt_st; /* Packet to KDC */ @@ -150,7 +146,7 @@ get_ad_tkt(service,sinstance,realm,lifetime) rpkt->length = 0; /* Send the request to the local ticket-granting server */ - if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); + if ((kerror = send_to_kdc(pkt, rpkt, realm))) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION ) @@ -181,9 +177,9 @@ get_ad_tkt(service,sinstance,realm,lifetime) bcopy((char *) pkt_cipher(rpkt),(char *) (cip->dat),cip->length); #ifndef NOENCRYPTION - key_sched(cr.session,key_s); - pcbc_encrypt((C_Block *)cip->dat,(C_Block *)cip->dat,(long)cip->length, - key_s,cr.session,DECRYPT); + key_sched((des_cblock *)cr.session,key_s); + pcbc_encrypt((des_cblock *)cip->dat,(des_cblock *)cip->dat, + (long)cip->length,key_s,(des_cblock *)cr.session,DECRYPT); #endif /* Get rid of all traces of key */ bzero((char *) cr.session, sizeof(key)); @@ -226,8 +222,8 @@ get_ad_tkt(service,sinstance,realm,lifetime) code */ } - if (kerror = save_credentials(s_name,s_instance,rlm,ses,lifetime, - kvno,tkt,tt_local.tv_sec)) + if ((kerror = save_credentials(s_name,s_instance,rlm,ses,lifetime, + kvno,tkt,tt_local.tv_sec))) return(kerror); return(AD_OK); diff --git a/eBones/krb/get_admhst.c b/eBones/krb/get_admhst.c index c36e997..b33b828 100644 --- a/eBones/krb/get_admhst.c +++ b/eBones/krb/get_admhst.c @@ -5,13 +5,15 @@ * . * * from: get_admhst.c,v 4.0 89/01/23 10:08:55 jtkohl Exp $ - * $Id: get_admhst.c,v 1.2 1994/07/19 19:25:13 g89r4222 Exp $ + * $Id: get_admhst.c,v 1.3 1995/07/18 16:38:27 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_admhst.c,v 1.2 1994/07/19 19:25:13 g89r4222 Exp $"; +"$Id: get_admhst.c,v 1.3 1995/07/18 16:38:27 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -37,10 +39,7 @@ static char *rcsid = * provided by a nameserver. */ -krb_get_admhst(h, r, n) - char *h; - char *r; - int n; +int krb_get_admhst(char *h, char *r, int n) { FILE *cnffile; char tr[REALM_SZ]; diff --git a/eBones/krb/get_cred.c b/eBones/krb/get_cred.c index 6eb63f6..14e1cc1 100644 --- a/eBones/krb/get_cred.c +++ b/eBones/krb/get_cred.c @@ -5,13 +5,15 @@ * . * * from: get_cred.c,v 4.10 89/05/31 17:46:22 jtkohl Exp $ - * $Id: get_cred.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_cred.c,v 1.3 1995/07/18 16:38:28 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_cred.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_cred.c,v 1.3 1995/07/18 16:38:28 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -25,11 +27,7 @@ static char *rcsid = * On failure it returns a Kerberos error code. */ -krb_get_cred(service,instance,realm,c) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - CREDENTIALS *c; /* Credentials struct */ +int krb_get_cred(char *service, char *instance, char *realm, CREDENTIALS *c) { int tf_status; /* return value of tf function calls */ diff --git a/eBones/krb/get_in_tkt.c b/eBones/krb/get_in_tkt.c index 00fc57a..79758f6 100644 --- a/eBones/krb/get_in_tkt.c +++ b/eBones/krb/get_in_tkt.c @@ -4,20 +4,22 @@ * . * * from: get_in_tkt.c,v 4.12 89/07/18 16:32:56 jtkohl Exp $ - * $Id: get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $"; #endif /* lint */ +#endif #include #include +#include +#include "conf.h" -#ifndef NULL -#define NULL 0 -#endif +#include /* * This file contains two routines: passwd_to_key() converts @@ -42,18 +44,17 @@ static char rcsid[] = */ /*ARGSUSED */ -static int passwd_to_key(user,instance,realm,passwd,key) - char *user, *instance, *realm, *passwd; - C_Block key; +static int passwd_to_key(char *user, char *instance, char *realm, + char *passwd, des_cblock key) { #ifdef NOENCRYPTION if (!passwd) placebo_read_password(key, "Password: ", 0); #else if (passwd) - string_to_key(passwd,key); + string_to_key(passwd,(des_cblock *)key); else - des_read_password(key,"Password: ",0); + des_read_password((des_cblock *)key,"Password: ",0); #endif return (0); } @@ -75,10 +76,8 @@ static int passwd_to_key(user,instance,realm,passwd,key) * The result of the call to krb_get_in_tkt() is returned. */ -krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) - char *user, *instance, *realm, *service, *sinstance; - int life; - char *password; +int krb_get_pw_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, char *password) { return(krb_get_in_tkt(user,instance,realm,service,sinstance,life, passwd_to_key, NULL, password)); @@ -86,8 +85,8 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) #ifdef NOENCRYPTION /* - * $Source: /home/ncvs/src/eBones/krb/get_in_tkt.c,v $ - * $Author: csgr $ + * $Source: /usr/cvs/src/eBones/krb/get_in_tkt.c,v $ + * $Author: mark $ * * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute * of Technology. @@ -100,41 +99,16 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) * echoing. */ +#if 0 #ifndef lint static char rcsid_read_password_c[] = -"Bones$Header: /home/ncvs/src/eBones/krb/get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"Bones$Header: /usr/cvs/src/eBones/krb/get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $"; #endif lint - -#include -#include "conf.h" - -#include -#ifdef BSDUNIX -#include -#include -#include -#include -#else -char *strcpy(); -int strcmp(); #endif -#ifdef BSDUNIX -static jmp_buf env; -#endif - -#ifdef BSDUNIX -static void sig_restore(); -static push_signals(), pop_signals(); -int placebo_read_pw_string(); -#endif /*** Routines ****************************************************** */ -int -placebo_read_password(k,prompt,verify) - des_cblock *k; - char *prompt; - int verify; +int placebo_read_password(des_cblock *k, char *prompt, int verify) { int ok; char key_string[BUFSIZ]; @@ -161,8 +135,7 @@ lose: * Returns 0 on success, non-zero on failure. */ -int -placebo_read_pw_string(s,max,prompt,verify) +int placebo_read_pw_string(char *s, int max, char *prompt, int verify) char *s; int max; char *prompt; @@ -264,23 +237,21 @@ static void (*old_sigfunc[NSIG])(); static int (*old_sigfunc[NSIG])(); #endif POSIX -static push_signals() +static void push_signals() { register i; for (i = 0; i < NSIG; i++) old_sigfunc[i] = signal(i,sig_restore); } -static pop_signals() +static void pop_signals() { register i; for (i = 0; i < NSIG; i++) signal(i,old_sigfunc[i]); } -static void sig_restore(sig,code,scp) - int sig,code; - struct sigcontext *scp; +static void sig_restore(int sig, int code, struct sigcontext *scp) { longjmp(env,1); } diff --git a/eBones/krb/get_krbhst.c b/eBones/krb/get_krbhst.c index bb1ea50..ab3abbd 100644 --- a/eBones/krb/get_krbhst.c +++ b/eBones/krb/get_krbhst.c @@ -5,13 +5,15 @@ * . * * from: get_krbhst.c,v 4.8 89/01/22 20:00:29 rfrench Exp $ - * $Id: get_krbhst.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_krbhst.c,v 1.3 1995/07/18 16:38:32 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_krbhst.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_krbhst.c,v 1.3 1995/07/18 16:38:32 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -48,10 +50,7 @@ static char *rcsid = * nameserver. */ -krb_get_krbhst(h,r,n) - char *h; - char *r; - int n; +int krb_get_krbhst(char *h, char *r, int n) { FILE *cnffile; char tr[REALM_SZ]; diff --git a/eBones/krb/get_krbrlm.c b/eBones/krb/get_krbrlm.c index 7df073d..150a916 100644 --- a/eBones/krb/get_krbrlm.c +++ b/eBones/krb/get_krbrlm.c @@ -5,13 +5,15 @@ * . * * from: get_krbrlm.c,v 4.8 89/01/22 20:02:54 rfrench Exp $ - * $Id: get_krbrlm.c,v 1.2 1994/07/19 19:25:19 g89r4222 Exp $ + * $Id: get_krbrlm.c,v 1.3 1995/07/18 16:38:34 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_krbrlm.c,v 1.2 1994/07/19 19:25:19 g89r4222 Exp $"; +"$Id: get_krbrlm.c,v 1.3 1995/07/18 16:38:34 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -32,11 +34,9 @@ static char *rcsid = * krb_get_krbhst(). */ -krb_get_lrealm(r,n) - char *r; - int n; +int krb_get_lrealm(char *r, int n) { - FILE *cnffile, *fopen(); + FILE *cnffile; if (n > 1) return(KFAILURE); /* Temporary restriction */ diff --git a/eBones/krb/get_phost.c b/eBones/krb/get_phost.c index 9b12d10..4b0f495 100644 --- a/eBones/krb/get_phost.c +++ b/eBones/krb/get_phost.c @@ -4,19 +4,21 @@ * . * * from: get_phost.c,v 4.6 89/01/23 09:25:40 jtkohl Exp $ - * $Id: get_phost.c,v 1.2 1994/07/19 19:25:20 g89r4222 Exp $ + * $Id: get_phost.c,v 1.3 1995/07/18 16:38:35 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_phost.c,v 1.2 1994/07/19 19:25:20 g89r4222 Exp $"; +"$Id: get_phost.c,v 1.3 1995/07/18 16:38:35 mark Exp $"; #endif /* lint */ +#endif #include +#include #include #include - -char *index(); +#include /* * This routine takes an alias for a host name and returns the first @@ -35,8 +37,7 @@ char *index(); * to the original "alias" argument is returned. */ -char * krb_get_phost(alias) - char *alias; +char *krb_get_phost(char *alias) { struct hostent *h; char *phost = alias; diff --git a/eBones/krb/get_pw_tkt.c b/eBones/krb/get_pw_tkt.c index 48a003c..1b016a8 100644 --- a/eBones/krb/get_pw_tkt.c +++ b/eBones/krb/get_pw_tkt.c @@ -5,13 +5,15 @@ * . * * from: get_pw_tkt.c,v 4.6 89/01/13 18:19:11 steiner Exp $ - * $Id: get_pw_tkt.c,v 1.2 1994/07/19 19:25:23 g89r4222 Exp $ + * $Id: get_pw_tkt.c,v 1.3 1995/07/18 16:38:37 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_pw_tkt.c,v 1.2 1994/07/19 19:25:23 g89r4222 Exp $"; +"$Id: get_pw_tkt.c,v 1.3 1995/07/18 16:38:37 mark Exp $"; #endif /* lint */ +#endif #include @@ -46,11 +48,7 @@ static char *rcsid = * the password-changing server will be in the user's ticket file. */ -get_pw_tkt(user,instance,realm,cpw) - char *user; - char *instance; - char *realm; - char *cpw; +int get_pw_tkt(char *user, char *instance, char *realm, char *cpw) { int kerror; diff --git a/eBones/krb/get_request.c b/eBones/krb/get_request.c index 131ffd5..dec742b 100644 --- a/eBones/krb/get_request.c +++ b/eBones/krb/get_request.c @@ -5,13 +5,15 @@ * . * * from: get_request.c,v 4.7 88/12/01 14:00:11 jtkohl Exp $ - * $Id: get_request.c,v 1.2 1994/07/19 19:25:24 g89r4222 Exp $ + * $Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_request.c,v 1.2 1994/07/19 19:25:24 g89r4222 Exp $"; +"$Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -26,11 +28,7 @@ static char *rcsid = * if there are less than n requests in the packet. */ -get_request(pkt, n, s_name, instance) - KTEXT pkt; /* The packet itself */ - int n; /* Which request do we want */ - char **s_name; /* Service name to be filled in */ - char **instance; /* Instance name to be filled in */ +int get_request(KTEXT pkt, int n, char **s_name, char **instance) { /* Go to the beginning of the request list */ char *ptr = (char *) pkt_a_realm(pkt) + 6 + diff --git a/eBones/krb/get_svc_in_tkt.c b/eBones/krb/get_svc_in_tkt.c index 0b0fe71..cd90f9e 100644 --- a/eBones/krb/get_svc_in_tkt.c +++ b/eBones/krb/get_svc_in_tkt.c @@ -4,13 +4,15 @@ * . * * from: get_svc_in_tkt.c,v 4.9 89/07/18 16:33:34 jtkohl Exp $ - * $Id: get_svc_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_svc_in_tkt.c,v 1.3 1995/07/18 16:38:41 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_svc_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_svc_in_tkt.c,v 1.3 1995/07/18 16:38:41 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -63,7 +65,7 @@ static int srvtab_to_key(user, instance, realm, srvtab, key) * It returns the return value of the krb_get_in_tkt() call. */ -krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab) +int krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab) char *user, *instance, *realm, *service, *sinstance; int life; char *srvtab; diff --git a/eBones/krb/get_tf_fullname.c b/eBones/krb/get_tf_fullname.c index 540e828..45226db 100644 --- a/eBones/krb/get_tf_fullname.c +++ b/eBones/krb/get_tf_fullname.c @@ -4,13 +4,15 @@ * . * * from: get_tf_fullname.c,v 4.3 90/03/10 22:40:20 jon Exp $ - * $Id: get_tf_fullname.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_tf_fullname.c,v 1.3 1995/07/18 16:38:42 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_tf_fullname.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_tf_fullname.c,v 1.3 1995/07/18 16:38:42 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -30,11 +32,8 @@ static char rcsid[] = * krb_get_in_tkt(). */ -krb_get_tf_fullname(ticket_file, name, instance, realm) - char *ticket_file; - char *name; - char *instance; - char *realm; +int krb_get_tf_fullname(char *ticket_file, char *name, char *instance, + char *realm) { int tf_status; CREDENTIALS c; diff --git a/eBones/krb/get_tf_realm.c b/eBones/krb/get_tf_realm.c index df2845e..704c687 100644 --- a/eBones/krb/get_tf_realm.c +++ b/eBones/krb/get_tf_realm.c @@ -4,13 +4,15 @@ * . * * from: get_tf_realm.c,v 4.2 90/01/02 13:40:19 jtkohl Exp $ - * $Id: get_tf_realm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_tf_realm.c,v 1.3 1995/07/18 16:38:44 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_tf_realm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_tf_realm.c,v 1.3 1995/07/18 16:38:44 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -26,9 +28,7 @@ static char rcsid[] = * */ -krb_get_tf_realm(ticket_file, realm) - char *ticket_file; - char *realm; +int krb_get_tf_realm(char *ticket_file, char *realm) { return(krb_get_tf_fullname(ticket_file, 0, 0, realm)); } diff --git a/eBones/krb/getrealm.c b/eBones/krb/getrealm.c index c850bd0..37686c4 100644 --- a/eBones/krb/getrealm.c +++ b/eBones/krb/getrealm.c @@ -6,13 +6,15 @@ * routine to convert hostname into realm name. * * from: getrealm.c,v 4.6 90/01/02 13:35:56 jtkohl Exp $ - * $Id: getrealm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: getrealm.c,v 1.3 1995/07/18 16:38:46 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: getrealm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: getrealm.c,v 1.3 1995/07/18 16:38:46 mark Exp $"; #endif lint +#endif #include #include @@ -45,9 +47,7 @@ static char rcsid[] = static char ret_realm[REALM_SZ+1]; -char * -krb_realmofhost(host) -char *host; +char *krb_realmofhost(char *host) { char *domain; FILE *trans_file; diff --git a/eBones/krb/getst.c b/eBones/krb/getst.c index edd55ec..549ec50 100644 --- a/eBones/krb/getst.c +++ b/eBones/krb/getst.c @@ -4,13 +4,17 @@ * . * * form: getst.c,v 4.5 88/11/15 16:31:39 jtkohl Exp $ - * $Id: getst.c,v 1.2 1994/07/19 19:25:33 g89r4222 Exp $ + * $Id: getst.c,v 1.3 1995/07/18 16:38:47 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: getst.c,v 1.2 1994/07/19 19:25:33 g89r4222 Exp $"; +"$Id: getst.c,v 1.3 1995/07/18 16:38:47 mark Exp $"; #endif /* lint */ +#endif + +#include /* * getst() takes a file descriptor, a string and a count. It reads @@ -22,9 +26,7 @@ static char rcsid[] = * the null terminator. */ -getst(fd, s, n) - int fd; - register char *s; +int getst(int fd, char *s, int n) { register count = n; while (read(fd, s, 1) > 0 && --count) diff --git a/eBones/krb/in_tkt.c b/eBones/krb/in_tkt.c index 5a05259..12fbb39 100644 --- a/eBones/krb/in_tkt.c +++ b/eBones/krb/in_tkt.c @@ -5,16 +5,19 @@ * . * * from: kt.c,v 4.9 89/10/25 19:03:35 qjb Exp $ - * $Id: in_tkt.c,v 1.1.1.1 1994/09/30 14:50:01 csgr Exp $ + * $Id: in_tkt.c,v 1.6 1995/07/18 16:38:49 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: in_tkt.c,v 1.1.1.1 1994/09/30 14:50:01 csgr Exp $"; +"$Id: in_tkt.c,v 1.6 1995/07/18 16:38:49 mark Exp $"; #endif /* lint */ +#endif #include #include +#include #include #include #include @@ -24,8 +27,6 @@ static char rcsid[] = #include #endif -extern int krb_debug; - /* * in_tkt() is used to initialize the ticket store. It creates the * file to contain the tickets and writes the given user's name "pname" @@ -33,9 +34,7 @@ extern int krb_debug; * success, or KFAILURE if something goes wrong. */ -in_tkt(pname,pinst) - char *pname; - char *pinst; +int in_tkt(char *pname, char *pinst) { int tktfile; uid_t me, metoo; @@ -91,7 +90,7 @@ in_tkt(pname,pinst) return(KFAILURE); } else if (krb_debug) - printf("swapped UID's %d and %d\n",metoo,me); + printf("swapped UID's %ld and %ld\n",metoo,me); } if ((tktfile = open(file,O_CREAT | O_TRUNC | O_WRONLY,0600)) < 0) { if (krb_debug) @@ -106,7 +105,7 @@ in_tkt(pname,pinst) return(KFAILURE); } else if (krb_debug) - printf("swapped UID's %d and %d\n",me,metoo); + printf("swapped UID's %ld and %ld\n",me,metoo); } if (lstat(file,&buf) < 0) { if (krb_debug) diff --git a/eBones/krb/k_gethostname.c b/eBones/krb/k_gethostname.c index e5c11ca..093ee5d 100644 --- a/eBones/krb/k_gethostname.c +++ b/eBones/krb/k_gethostname.c @@ -4,13 +4,17 @@ * . * * from: k_gethostname.c,v 4.1 88/12/01 14:04:42 jtkohl Exp $ - * $Id: k_gethostname.c,v 1.2 1994/07/19 19:25:36 g89r4222 Exp $ + * $Id: k_gethostname.c,v 1.3 1995/07/18 16:38:51 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: k_gethostname.c,v 1.2 1994/07/19 19:25:36 g89r4222 Exp $"; +"$Id: k_gethostname.c,v 1.3 1995/07/18 16:38:51 mark Exp $"; #endif /* lint */ +#endif + +#include #ifndef PC #ifndef BSD42 @@ -37,8 +41,7 @@ extern get_custom(); * not work. */ -k_gethostname(name, namelen) - char *name; +int k_gethostname(char *name, int namelen) { #ifdef BSD42 return gethostname(name, namelen); diff --git a/eBones/krb/klog.c b/eBones/krb/klog.c index b530e8b..97d52c7 100644 --- a/eBones/krb/klog.c +++ b/eBones/krb/klog.c @@ -5,13 +5,15 @@ * . * * from: klog.c,v 4.6 88/12/01 14:06:05 jtkohl Exp $ - * $Id: klog.c,v 1.2 1994/07/19 19:25:37 g89r4222 Exp $ + * $Id: klog.c,v 1.3 1995/07/18 16:38:52 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: klog.c,v 1.2 1994/07/19 19:25:37 g89r4222 Exp $"; +"$Id: klog.c,v 1.3 1995/07/18 16:38:52 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -48,14 +50,11 @@ static char logtxt[1000]; * text string "logtxt". */ -char * klog(type,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) - int type; - char *format; - int a1,a2,a3,a4,a5,a6,a7,a8,a9,a0; +char *klog(int type, char *format, int a1, int a2, int a3, int a4, int a5, + int a6, int a7, int a8, int a9, int a0) { - FILE *logfile, *fopen(); + FILE *logfile; long time(),now; - char *month_sname(); struct tm *tm; static int logtype_array[NLOGTYPE] = {0,0}; static int array_initialized; @@ -100,8 +99,7 @@ char * klog(type,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) * the logfile defaults to KRBLOG, defined in "krb.h". */ -kset_logfile(filename) - char *filename; +void kset_logfile(char *filename) { log_name = filename; is_open = 0; diff --git a/eBones/krb/kname_parse.c b/eBones/krb/kname_parse.c index dd5fe0b..c69b5cc 100644 --- a/eBones/krb/kname_parse.c +++ b/eBones/krb/kname_parse.c @@ -4,13 +4,15 @@ * . * * from: kname_parse.c,v 4.4 88/12/01 14:07:29 jtkohl Exp $ - * $Id: kname_parse.c,v 1.2 1994/07/19 19:25:39 g89r4222 Exp $ + * $Id: kname_parse.c,v 1.3 1995/07/18 16:38:54 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kname_parse.c,v 1.2 1994/07/19 19:25:39 g89r4222 Exp $"; +"$Id: kname_parse.c,v 1.3 1995/07/18 16:38:54 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -38,7 +40,7 @@ extern char *krb_err_txt[]; * Definition of "syntactically legitimate" names is according to * the Project Athena Technical Plan Section E.2.1, page 7 "Specifying * names", version dated 21 Dec 1987. - * / + */ /* * kname_parse() takes a Kerberos name "fullname" of the form: @@ -52,8 +54,7 @@ extern char *krb_err_txt[]; * KNAME_FMT is returned. */ -kname_parse(np, ip, rp, fullname) - char *np, *ip, *rp, *fullname; +int kname_parse(char *np, char *ip, char *rp, char *fullname) { static char buf[FULL_SZ]; char *rnext, *wnext; /* next char to read, write */ @@ -70,7 +71,7 @@ kname_parse(np, ip, rp, fullname) return KNAME_FMT; (void) strcpy(buf, fullname); - while (c = *rnext++) { + while ((c = *rnext++)) { if (backslash) { *wnext++ = c; backslash = 0; @@ -136,8 +137,7 @@ kname_parse(np, ip, rp, fullname) * Kerberos name; returns 0 if it's not. */ -k_isname(s) - char *s; +int k_isname(char *s) { register char c; int backslash = 0; @@ -146,7 +146,7 @@ k_isname(s) return 0; if (strlen(s) > ANAME_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; @@ -172,15 +172,14 @@ k_isname(s) * Kerberos instance; returns 0 if it's not. */ -k_isinst(s) - char *s; +int k_isinst(char *s) { register char c; int backslash = 0; if (strlen(s) > INST_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; @@ -205,8 +204,7 @@ k_isinst(s) * Kerberos realm; returns 0 if it's not. */ -k_isrealm(s) - char *s; +int k_isrealm(char *s) { register char c; int backslash = 0; @@ -215,7 +213,7 @@ k_isrealm(s) return 0; if (strlen(s) > REALM_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; diff --git a/eBones/krb/kntoln.c b/eBones/krb/kntoln.c index 62ec1b5..ddb1ba2 100644 --- a/eBones/krb/kntoln.c +++ b/eBones/krb/kntoln.c @@ -5,13 +5,15 @@ * . * * from: kntoln.c,v 4.7 89/01/23 09:25:15 jtkohl Exp $ - * $Id: kntoln.c,v 1.2 1994/07/19 19:25:40 g89r4222 Exp $ + * $Id: kntoln.c,v 1.3 1995/07/18 16:38:56 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: kntoln.c,v 1.2 1994/07/19 19:25:40 g89r4222 Exp $"; +"$Id: kntoln.c,v 1.3 1995/07/18 16:38:56 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -42,9 +44,7 @@ static char *rcsid = * KSUCCESS if all goes well, otherwise KFAILURE. */ -krb_kntoln(ad,lname) - AUTH_DAT *ad; - char *lname; +int krb_kntoln(AUTH_DAT *ad, char *lname) { static char lrealm[REALM_SZ] = ""; diff --git a/eBones/krb/kparse.c b/eBones/krb/kparse.c index d79f1cf..edb471c 100644 --- a/eBones/krb/kparse.c +++ b/eBones/krb/kparse.c @@ -30,15 +30,18 @@ * * * from: kparse.c,v 4.5 89/01/21 17:20:39 jtkohl Exp $ - * $Id: kparse.c,v 1.2 1994/07/19 19:25:42 g89r4222 Exp $ + * $Id: kparse.c,v 1.3 1995/07/18 16:38:58 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kparse.c,v 1.2 1994/07/19 19:25:42 g89r4222 Exp $"; +"$Id: kparse.c,v 1.3 1995/07/18 16:38:58 mark Exp $"; #endif lint +#endif #include +#include #include #include @@ -47,23 +50,21 @@ static char rcsid[] = #define TRUE 1 #endif -#define void int - #define MAXKEY 80 #define MAXVALUE 80 -char *malloc(); -char *strcpy(); +int fGetKeywordValue(FILE *fp, char *keyword, int klen, char *value, int vlen); +int fGetToken(FILE *fp, char *dest, int maxlen); +int fGetChar(FILE *fp); +int fUngetChar(int ch, FILE*fp); +int fGetLiteral(FILE *fp);; int LineNbr=1; /* current line nbr in parameter file */ char ErrorMsg[80]; /* meaningful only when KV_SYNTAX, PS_SYNTAX, * or PS_BAD_KEYWORD is returned by * fGetKeywordValue or fGetParameterSet */ -int fGetParameterSet( fp,parm,parmcount ) - FILE *fp; - parmtable parm[]; - int parmcount; +int fGetParameterSet(FILE *fp, parmtable parm[], int parmcount ) { int rc,i; char keyword[MAXKEY]; @@ -126,11 +127,7 @@ int fGetParameterSet( fp,parm,parmcount ) * different. Like strcmp, ParmCompare returns 0 for a match found, -1 * otherwise */ -int ParmCompare( parm, parmcount, keyword, value ) - parmtable parm[]; - int parmcount; - char *keyword; - char *value; +int ParmCompare(parmtable parm[], int parmcount, char *keyword, char *value ) { int i; @@ -146,9 +143,7 @@ int ParmCompare( parm, parmcount, keyword, value ) return(-1); } -void FreeParameterSet(parm,parmcount) - parmtable parm[]; - int parmcount; +void FreeParameterSet(parmtable parm[], int parmcount) { int i; @@ -160,12 +155,7 @@ void FreeParameterSet(parm,parmcount) } } -int fGetKeywordValue( fp, keyword, klen, value, vlen ) - FILE *fp; - char *keyword; - int klen; - char *value; - int vlen; +int fGetKeywordValue(FILE *fp, char *keyword, int klen, char *value, int vlen) { int rc; int gotit; @@ -321,6 +311,7 @@ int fGetKeywordValue( fp, keyword, klen, value, vlen ) } while ( !gotit ); /*NOTREACHED*/ + return 0; /* I know, I know. - markm */ } /* @@ -352,10 +343,7 @@ int fGetKeywordValue( fp, keyword, klen, value, vlen ) * classification for end of file is * always zero. */ -int fGetToken(fp, dest, maxlen) - FILE *fp; - char *dest; - int maxlen; +int fGetToken(FILE *fp, char *dest, int maxlen) { int ch='\0'; int len=0; @@ -448,8 +436,7 @@ int fGetToken(fp, dest, maxlen) * special case certain values (\n, \f, \r, \b) or return a literal * otherwise (useful for \", for example). */ -fGetLiteral(fp) - FILE *fp; +int fGetLiteral(FILE *fp) { int ch; int n=0; @@ -524,9 +511,7 @@ fGetLiteral(fp) * exactly the same as ungetc(3) except that the line number of the * input file is maintained. */ -fUngetChar(ch,fp) - int ch; - FILE *fp; +int fUngetChar(int ch, FILE*fp) { if (ch=='\n') LineNbr--; return(ungetc(ch,fp)); @@ -537,8 +522,7 @@ fUngetChar(ch,fp) * exactly the same as fgetc(3) except that the line number of the * input file is maintained. */ -fGetChar(fp) - FILE *fp; +int fGetChar(FILE *fp) { int ch = fgetc(fp); if (ch=='\n') LineNbr++; @@ -564,8 +548,7 @@ fGetChar(fp) * Return Value: pointer to copied string * */ -char * strsave(p) - char *p; +char *strsave(char *p) { return(strcpy(malloc(strlen(p)+1),p)); } @@ -576,8 +559,7 @@ char * strsave(p) * the pointer to the beginning of the string is returned. */ -char * strutol( start ) - char *start; +char *strutol(char *start) { char *q; for (q=start; *q; q++) @@ -592,9 +574,7 @@ char * strutol( start ) char *pgm = "gettoken"; -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { char *p; int type; @@ -647,9 +627,7 @@ main(argc,argv) #ifdef KVTEST -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { int rc,ch; FILE *fp; @@ -706,9 +684,7 @@ parmtable kparm[] = { { "instance", "", (char *)NULL } }; -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { int rc,i,ch; FILE *fp; diff --git a/eBones/krb/krb_err.et b/eBones/krb/krb_err.et index 2c6830b..7d2baef 100644 --- a/eBones/krb/krb_err.et +++ b/eBones/krb/krb_err.et @@ -1,9 +1,9 @@ # Copyright 1987,1988 Massachusetts Institute of Technology # For copying and distribution information, see the file # "Copyright.MIT". -# +# # from: krb_err.et,v 4.1 89/09/26 09:24:20 jtkohl Exp $ -# $Id: krb_err.et,v 1.2 1994/07/19 19:25:44 g89r4222 Exp $ +# $Id: krb_err.et,v 1.3 1995/07/18 16:39:00 mark Exp $ # error_table krb @@ -45,7 +45,7 @@ ec KRBET_KRB_RES12, "Reserved 12" - + ec KRBET_KRB_RES13, "Reserved 13" diff --git a/eBones/krb/krb_err_txt.c b/eBones/krb/krb_err_txt.c index 785563f..2c8c0ca 100644 --- a/eBones/krb/krb_err_txt.c +++ b/eBones/krb/krb_err_txt.c @@ -4,13 +4,15 @@ * . * * from: krb_err_txt.c,v 4.7 88/12/01 14:10:14 jtkohl Exp $ - * $Id: krb_err_txt.c,v 1.2 1994/07/19 19:25:45 g89r4222 Exp $ + * $Id: krb_err_txt.c,v 1.3 1995/07/18 16:39:02 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_err_txt.c,v 1.2 1994/07/19 19:25:45 g89r4222 Exp $"; +"$Id: krb_err_txt.c,v 1.3 1995/07/18 16:39:02 mark Exp $"; #endif lint +#endif /* * This file contains an array of error text strings. diff --git a/eBones/krb/krb_get_in_tkt.c b/eBones/krb/krb_get_in_tkt.c index af92bc6..e17b60e 100644 --- a/eBones/krb/krb_get_in_tkt.c +++ b/eBones/krb/krb_get_in_tkt.c @@ -5,13 +5,15 @@ * . * * from: der: krb_get_in_tkt.c,v 4.19 89/07/18 16:31:31 jtkohl Exp $ - * $Id: krb_get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: krb_get_in_tkt.c,v 1.3 1995/07/18 16:39:04 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: krb_get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: krb_get_in_tkt.c,v 1.3 1995/07/18 16:39:04 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -33,13 +35,8 @@ int swap_bytes; * using the key returned by key_proc. */ -static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) - char *user; - char *instance; - char *realm; - char *arg; - int (*key_proc)(); - KTEXT *cipp; +static int decrypt_tkt(char *user, char *instance, char *realm, char *arg, + int (*key_proc)(), KTEXT *cipp) { KTEXT cip = *cipp; C_Block key; /* Key for decrypting cipher */ @@ -59,9 +56,9 @@ static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) } #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)cip->dat,(C_Block *)cip->dat, - (long) cip->length,key_s,key,DES_DECRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)cip->dat,(des_cblock *)cip->dat, + (long) cip->length,key_s,(des_cblock *)key,DES_DECRYPT); #endif /* !NOENCRYPTION */ /* Get rid of all traces of key */ bzero((char *)key,sizeof(key)); @@ -111,17 +108,9 @@ static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) * string sinstance service's instance */ -krb_get_in_tkt(user, instance, realm, service, sinstance, life, - key_proc, decrypt_proc, arg) - char *user; - char *instance; - char *realm; - char *service; - char *sinstance; - int life; - int (*key_proc)(); - int (*decrypt_proc)(); - char *arg; +int krb_get_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, int (*key_proc)(), int (*decrypt_proc)(), + char *arg) { KTEXT_ST pkt_st; KTEXT pkt = &pkt_st; /* Packet to KDC */ @@ -182,7 +171,7 @@ krb_get_in_tkt(user, instance, realm, service, sinstance, life, /* SEND THE REQUEST AND RECEIVE THE RETURN PACKET */ - if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); + if ((kerror = send_to_kdc(pkt, rpkt, realm))) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION) @@ -289,8 +278,8 @@ krb_get_in_tkt(user, instance, realm, service, sinstance, life, return(INTK_ERR); /* stash ticket, session key, etc. for future use */ - if (kerror = save_credentials(s_name, s_instance, rlm, ses, - lifetime, kvno, tkt, t_local.tv_sec)) + if ((kerror = save_credentials(s_name, s_instance, rlm, ses, + lifetime, kvno, tkt, t_local.tv_sec))) return(kerror); return(INTK_OK); diff --git a/eBones/krb/krbglue.c b/eBones/krb/krbglue.c index 8e864c1..de5b7e2 100644 --- a/eBones/krb/krbglue.c +++ b/eBones/krb/krbglue.c @@ -4,13 +4,15 @@ * . * * from: krbglue.c,v 4.1 89/01/23 15:51:50 wesommer Exp $ - * $Id: krbglue.c,v 1.2 1994/07/19 19:25:49 g89r4222 Exp $ + * $Id: krbglue.c,v 1.3 1995/07/18 16:39:05 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -$Id: krbglue.c,v 1.2 1994/07/19 19:25:49 g89r4222 Exp $"; +$Id: krbglue.c,v 1.3 1995/07/18 16:39:05 mark Exp $"; #endif lint +#endif #ifndef NCOMPAT /* diff --git a/eBones/krb/kuserok.c b/eBones/krb/kuserok.c index 404532d..15a25e8 100644 --- a/eBones/krb/kuserok.c +++ b/eBones/krb/kuserok.c @@ -7,16 +7,19 @@ * access to a local account * * from: kuserok.c,v 4.5 89/01/23 09:25:21 jtkohl Exp $ - * $Id: kuserok.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: kuserok.c,v 1.3 1995/07/18 16:39:07 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kuserok.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: kuserok.c,v 1.3 1995/07/18 16:39:07 mark Exp $"; #endif lint +#endif #include #include +#include #include #include #include @@ -83,9 +86,7 @@ parmtable kparm[] = { #define KPARMS kparm,PARMCOUNT(kparm) #endif ATHENA_COMPAT -kuserok(kdata, luser) - AUTH_DAT *kdata; - char *luser; +int kuserok(AUTH_DAT *kdata, char *luser) { struct stat sbuf; struct passwd *pwd; @@ -178,7 +179,7 @@ kuserok(kdata, luser) linebuf[BUFSIZ-1] = '\0'; newline = NULL; /* nuke the newline if it exists */ - if (newline = index(linebuf, '\n')) + if ((newline = index(linebuf, '\n'))) *newline = '\0'; rc = kname_parse(principal, inst, realm, linebuf); if (rc == KSUCCESS) { diff --git a/eBones/krb/log.c b/eBones/krb/log.c index 42fccfb..aea6ab9 100644 --- a/eBones/krb/log.c +++ b/eBones/krb/log.c @@ -5,13 +5,15 @@ * . * * from: log.c,v 4.7 88/12/01 14:15:14 jtkohl Exp $ - * $Id: log.c,v 1.2 1994/07/19 19:25:53 g89r4222 Exp $ + * $Id: log.c,v 1.3 1995/07/18 16:39:09 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: log.c,v 1.2 1994/07/19 19:25:53 g89r4222 Exp $"; +"$Id: log.c,v 1.3 1995/07/18 16:39:09 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -42,18 +44,12 @@ static is_open; * The return value is undefined. */ -__BEGIN_DECLS -char *month_sname __P((int)); -__END_DECLS - - /*VARARGS1 */ -void log(format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) - char *format; - int a1,a2,a3,a4,a5,a6,a7,a8,a9,a0; +void log(char *format,int a1,int a2,int a3,int a4,int a5,int a6,int a7, + int a8,int a9,int a0) { - FILE *logfile, *fopen(); - long time(),now; + FILE *logfile; + long now; struct tm *tm; if ((logfile = fopen(log_name,"a")) == NULL) @@ -77,8 +73,7 @@ void log(format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) * the logfile defaults to KRBLOG, defined in "krb.h". */ -set_logfile(filename) - char *filename; +void set_logfile(char *filename) { log_name = filename; is_open = 0; @@ -91,9 +86,7 @@ set_logfile(filename) * on success. */ -new_log(t,string) - long t; - char *string; +int new_log(long t, char *string) { static FILE *logfile; diff --git a/eBones/krb/mk_err.c b/eBones/krb/mk_err.c index 331cba9..8600240 100644 --- a/eBones/krb/mk_err.c +++ b/eBones/krb/mk_err.c @@ -5,13 +5,15 @@ * . * * from: mk_err.c,v 4.4 88/11/15 16:33:36 jtkohl Exp $ - * $Id: mk_err.c,v 1.2 1994/07/19 19:25:54 g89r4222 Exp $ + * $Id: mk_err.c,v 1.3 1995/07/18 16:39:11 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: mk_err.c,v 1.2 1994/07/19 19:25:54 g89r4222 Exp $"; +"$Id: mk_err.c,v 1.3 1995/07/18 16:39:11 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/krb/mk_priv.c b/eBones/krb/mk_priv.c index 3050cf4..bc377de 100644 --- a/eBones/krb/mk_priv.c +++ b/eBones/krb/mk_priv.c @@ -16,16 +16,19 @@ * Steve Miller Project Athena MIT/DEC * * from: mk_priv.c,v 4.13 89/03/22 14:48:59 jtkohl Exp $ - * $Id: mk_priv.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_priv.c,v 1.3 1995/07/18 16:39:13 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: mk_priv.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_priv.c,v 1.3 1995/07/18 16:39:13 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -37,13 +40,8 @@ static char rcsid[] = #include #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ - static u_long c_length; static struct timeval msg_time; static u_char msg_time_5ms; @@ -92,16 +90,9 @@ static long msg_time_sec; * 0<=n<=7 bytes pad to 8 byte multiple zeroes */ -long krb_mk_priv(in,out,length,schedule,key,sender,receiver) - u_char *in; /* application data */ - u_char *out; /* put msg here, leave room for - * header! breaks if in and out - * (header stuff) overlap */ - u_long length; /* of in data */ - Key_schedule schedule; /* precomputed key schedule */ - C_Block key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender address */ - struct sockaddr_in *receiver; /* receiver address */ +long krb_mk_priv(u_char *in, u_char *out, u_long length, + des_key_schedule schedule, des_cblock key, struct sockaddr_in *sender, + struct sockaddr_in *receiver) { register u_char *p,*q; static u_char *c_length_ptr; @@ -196,7 +187,8 @@ long krb_mk_priv(in,out,length,schedule,key,sender,receiver) bcopy((char *) &c_length,(char *)c_length_ptr,sizeof(c_length)); #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)q,(C_Block *)q,(long)(p-q),schedule,key,ENCRYPT); + pcbc_encrypt((des_cblock *)q,(des_cblock *)q,(long)(p-q),schedule, + (des_cblock *)key,ENCRYPT); #endif /* NOENCRYPTION */ return (q - out + c_length); /* resulting size */ diff --git a/eBones/krb/mk_req.c b/eBones/krb/mk_req.c index fd31717..971e6a2 100644 --- a/eBones/krb/mk_req.c +++ b/eBones/krb/mk_req.c @@ -5,13 +5,15 @@ * . * * from: der: mk_req.c,v 4.17 89/07/07 15:20:35 jtkohl Exp $ - * $Id: mk_req.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_req.c,v 1.3 1995/07/18 16:39:15 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: mk_req.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_req.c,v 1.3 1995/07/18 16:39:15 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -19,7 +21,6 @@ static char *rcsid = #include #include -extern int krb_ap_req_debug; static struct timeval tv_local = { 0, 0 }; static int lifetime = DEFAULT_TKT_LIFE; @@ -67,12 +68,8 @@ static int lifetime = DEFAULT_TKT_LIFE; * all rounded up to multiple of 8. */ -krb_mk_req(authent,service,instance,realm,checksum) - register KTEXT authent; /* Place to build the authenticator */ - char *service; /* Name of the service */ - char *instance; /* Service instance */ - char *realm; /* Authentication domain of service */ - long checksum; /* Checksum of data (optional) */ +int krb_mk_req(KTEXT authent, char *service, char *instance, char *realm, + long checksum) { static KTEXT_ST req_st; /* Temp storage for req id */ register KTEXT req_id = &req_st; @@ -106,9 +103,9 @@ krb_mk_req(authent,service,instance,realm,checksum) retval = krb_get_cred(service,instance,realm,&cr); if (retval == RET_NOTKT) { - if (retval = get_ad_tkt(service,instance,realm,lifetime)) + if ((retval = get_ad_tkt(service,instance,realm,lifetime))) return(retval); - if (retval = krb_get_cred(service,instance,realm,&cr)) + if ((retval = krb_get_cred(service,instance,realm,&cr))) return(retval); } @@ -126,7 +123,7 @@ krb_mk_req(authent,service,instance,realm,checksum) if (krb_ap_req_debug) printf("Ticket->length = %d\n",ticket->length); if (krb_ap_req_debug) - printf("Issue date: %d\n",cr.issue_date); + printf("Issue date: %ld\n",cr.issue_date); /* Build request id */ (void) strcpy((char *)(req_id->dat),cr.pname); /* Auth name */ @@ -154,9 +151,9 @@ krb_mk_req(authent,service,instance,realm,checksum) req_id->length = ((req_id->length+7)/8)*8; #ifndef NOENCRYPTION - key_sched(cr.session,key_s); - pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat, - (long)req_id->length,key_s,cr.session,ENCRYPT); + key_sched((des_cblock *)cr.session,key_s); + pcbc_encrypt((des_cblock *)req_id->dat,(des_cblock *)req_id->dat, + (long)req_id->length,key_s,(des_cblock *)cr.session,ENCRYPT); bzero((char *) key_s, sizeof(key_s)); #endif /* NOENCRYPTION */ @@ -184,9 +181,7 @@ krb_mk_req(authent,service,instance,realm,checksum) * It returns the previous value of the default lifetime. */ -int -krb_set_lifetime(newval) -int newval; +int krb_set_lifetime(int newval) { int olife = lifetime; diff --git a/eBones/krb/mk_safe.c b/eBones/krb/mk_safe.c index 46a80f7..f4aab32 100644 --- a/eBones/krb/mk_safe.c +++ b/eBones/krb/mk_safe.c @@ -15,16 +15,19 @@ * Steve Miller Project Athena MIT/DEC * * from: mk_safe.c,v 4.12 89/03/22 14:50:49 jtkohl Exp $ - * $Id: mk_safe.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_safe.c,v 1.3 1995/07/18 16:39:17 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: mk_safe.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_safe.c,v 1.3 1995/07/18 16:39:17 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -80,17 +83,8 @@ static long msg_time_sec; * above using "key" */ -long krb_mk_safe(in,out,length,key,sender,receiver) - u_char *in; /* application data */ - u_char *out; /* - * put msg here, leave room for header! - * breaks if in and out (header stuff) - * overlap - */ - u_long length; /* of in data */ - C_Block *key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender address */ - struct sockaddr_in *receiver; /* receiver address */ +long krb_mk_safe(u_char *in, u_char *out, u_long length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver) { register u_char *p,*q; @@ -154,10 +148,10 @@ long krb_mk_safe(in,out,length,key,sender,receiver) cksum = 0; bzero(big_cksum, sizeof(big_cksum)); #else - cksum=quad_cksum(q,big_cksum,p-q,2,key); + cksum=quad_cksum((des_cblock *)q,big_cksum,p-q,2,(des_cblock *)key); #endif if (krb_debug) - printf("\ncksum = %u",cksum); + printf("\ncksum = %lu",cksum); /* stuff checksum */ bcopy((char *)big_cksum,(char *)p,sizeof(big_cksum)); diff --git a/eBones/krb/month_sname.c b/eBones/krb/month_sname.c index e7a63ec..3443e41 100644 --- a/eBones/krb/month_sname.c +++ b/eBones/krb/month_sname.c @@ -5,13 +5,15 @@ * . * * from: month_sname.c,v 4.4 88/11/15 16:39:32 jtkohl Exp $ - * $Id: month_sname.c,v 1.2 1994/07/19 19:26:00 g89r4222 Exp $ + * $Id: month_sname.c,v 1.3 1995/07/18 16:39:19 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: month_sname.c,v 1.2 1994/07/19 19:26:00 g89r4222 Exp $"; +"$Id: month_sname.c,v 1.3 1995/07/18 16:39:19 mark Exp $"; #endif /* lint */ +#endif /* @@ -20,8 +22,7 @@ static char *rcsid = * month. Returns 0 if the argument is out of range. */ -char *month_sname(n) - int n; +char *month_sname(int n) { static char *name[] = { "Jan","Feb","Mar","Apr","May","Jun", diff --git a/eBones/krb/netread.c b/eBones/krb/netread.c index eb86327..c773bc8 100644 --- a/eBones/krb/netread.c +++ b/eBones/krb/netread.c @@ -4,13 +4,19 @@ * . * * from: netread.c,v 4.1 88/11/15 16:47:21 jtkohl Exp $ - * $Id: netread.c,v 1.2 1994/07/19 19:26:03 g89r4222 Exp $ + * $Id: netread.c,v 1.3 1995/07/18 16:39:20 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: netread.c,v 1.2 1994/07/19 19:26:03 g89r4222 Exp $"; +"$Id: netread.c,v 1.3 1995/07/18 16:39:20 mark Exp $"; #endif lint +#endif + +#include +#include +#include /* * krb_net_read() reads from the file descriptor "fd" to the buffer @@ -22,11 +28,7 @@ static char rcsid[] = * XXX must not use non-blocking I/O */ -int -krb_net_read(fd, buf, len) -int fd; -register char *buf; -register int len; +int krb_net_read(int fd, char *buf, int len) { int cc, len2 = 0; diff --git a/eBones/krb/netwrite.c b/eBones/krb/netwrite.c index 5945ce0..7af91ff 100644 --- a/eBones/krb/netwrite.c +++ b/eBones/krb/netwrite.c @@ -4,13 +4,19 @@ * . * * from: netwrite.c,v 4.1 88/11/15 16:48:58 jtkohl Exp $"; - * $Id: netwrite.c,v 1.2 1994/07/19 19:26:04 g89r4222 Exp $ + * $Id: netwrite.c,v 1.3 1995/07/18 16:39:22 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: netwrite.c,v 1.2 1994/07/19 19:26:04 g89r4222 Exp $"; +"$Id: netwrite.c,v 1.3 1995/07/18 16:39:22 mark Exp $"; #endif lint +#endif + +#include +#include +#include /* * krb_net_write() writes "len" bytes from "buf" to the file @@ -21,11 +27,7 @@ static char rcsid[] = * XXX must not use non-blocking I/O */ -int -krb_net_write(fd, buf, len) -int fd; -register char *buf; -int len; +int krb_net_write(int fd, char *buf, int len) { int cc; register int wrlen = len; diff --git a/eBones/krb/one.c b/eBones/krb/one.c index c0e8bc6..ef02ae1 100644 --- a/eBones/krb/one.c +++ b/eBones/krb/one.c @@ -4,13 +4,15 @@ * . * * form: one.c,v 4.1 88/11/15 16:51:41 jtkohl Exp $ - * $Id: one.c,v 1.2 1994/07/19 19:26:05 g89r4222 Exp $ + * $Id: one.c,v 1.3 1995/07/18 16:39:24 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: one.c,v 1.2 1994/07/19 19:26:05 g89r4222 Exp $"; +"$Id: one.c,v 1.3 1995/07/18 16:39:24 mark Exp $"; #endif lint +#endif /* * definition of variable set to 1. diff --git a/eBones/krb/pkt_cipher.c b/eBones/krb/pkt_cipher.c index 6ef870c..9c32b72 100644 --- a/eBones/krb/pkt_cipher.c +++ b/eBones/krb/pkt_cipher.c @@ -5,13 +5,15 @@ * . * * from: pkt_cipher.c,v 4.8 89/01/13 17:46:14 steiner Exp $ - * $Id: pkt_cipher.c,v 1.2 1994/07/19 19:26:07 g89r4222 Exp $ + * $Id: pkt_cipher.c,v 1.3 1995/07/18 16:39:25 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: pkt_cipher.c,v 1.2 1994/07/19 19:26:07 g89r4222 Exp $"; +"$Id: pkt_cipher.c,v 1.3 1995/07/18 16:39:25 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/krb/pkt_clen.c b/eBones/krb/pkt_clen.c index 23ad4c3..17d46c2 100644 --- a/eBones/krb/pkt_clen.c +++ b/eBones/krb/pkt_clen.c @@ -5,18 +5,20 @@ * . * * from: pkt_clen.c,v 4.7 88/11/15 16:56:36 jtkohl Exp $ - * $Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $ + * $Id: pkt_clen.c,v 1.3 1995/07/18 16:39:27 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $"; +"$Id: pkt_clen.c,v 1.3 1995/07/18 16:39:27 mark Exp $"; #endif /* lint */ +#endif #include #include +#include -extern int krb_debug; extern int swap_bytes; /* @@ -27,8 +29,7 @@ extern int swap_bytes; * ciphertext length out of the packet. */ -pkt_clen(pkt) - KTEXT pkt; +int pkt_clen(KTEXT pkt) { static unsigned short temp,temp2; int clen = 0; diff --git a/eBones/krb/rd_err.c b/eBones/krb/rd_err.c index e73c47b..8c5b8a2 100644 --- a/eBones/krb/rd_err.c +++ b/eBones/krb/rd_err.c @@ -13,16 +13,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_err.c,v 4.5 89/01/13 17:26:38 steiner Exp $ - * $Id: rd_err.c,v 1.2 1994/07/19 19:26:10 g89r4222 Exp $ + * $Id: rd_err.c,v 1.3 1995/07/18 16:39:29 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: rd_err.c,v 1.2 1994/07/19 19:26:10 g89r4222 Exp $"; +"$Id: rd_err.c,v 1.3 1995/07/18 16:39:29 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -47,12 +50,7 @@ static char rcsid[] = * The AUTH_MSG_APPL_ERR message format can be found in mk_err.c */ -int -krb_rd_err(in,in_length,code,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* of in msg */ - long *code; /* received error code */ - MSG_DAT *m_data; +int krb_rd_err(u_char *in, u_long in_length, long *code, MSG_DAT *m_data) { register u_char *p; int swap_bytes = 0; diff --git a/eBones/krb/rd_priv.c b/eBones/krb/rd_priv.c index 0e3d906..457352e 100644 --- a/eBones/krb/rd_priv.c +++ b/eBones/krb/rd_priv.c @@ -15,16 +15,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_priv.c,v 4.14 89/04/28 11:59:42 jtkohl Exp $ - * $Id: rd_priv.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: rd_priv.c,v 1.3 1995/07/18 16:39:31 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[]= -"$Id: rd_priv.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: rd_priv.c,v 1.3 1995/07/18 16:39:31 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -36,10 +39,6 @@ static char rcsid[]= #include #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ static u_long c_length; @@ -69,14 +68,9 @@ int private_msg_ver = KRB_PROT_VERSION; * information, MSG_DAT, is defined in "krb.h". */ -long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* length of "in" msg */ - Key_schedule schedule; /* precomputed key schedule */ - C_Block key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; - struct sockaddr_in *receiver; - MSG_DAT *m_data; /*various input/output data from msg */ +long krb_rd_priv(u_char *in, u_long in_length, des_key_schedule schedule, + des_cblock key, struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *m_data) { register u_char *p,*q; static u_long src_addr; /* Can't send structs since no @@ -109,7 +103,8 @@ long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) q = p; /* mark start of encrypted stuff */ #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)q,(C_Block *)q,(long)c_length,schedule,key,DECRYPT); + pcbc_encrypt((des_cblock *)q,(des_cblock *)q,(long)c_length,schedule, + (des_cblock *)key,DECRYPT); #endif /* safely get application data length */ @@ -176,7 +171,7 @@ long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) if (delta_t > CLOCK_SKEW) return RD_AP_TIME; if (krb_debug) - printf("\ndelta_t = %d",delta_t); + printf("\ndelta_t = %ld",delta_t); /* * caller must check timestamps for proper order and diff --git a/eBones/krb/rd_req.c b/eBones/krb/rd_req.c index 22b6540..b77ec48 100644 --- a/eBones/krb/rd_req.c +++ b/eBones/krb/rd_req.c @@ -5,22 +5,23 @@ * . * * from: der: rd_req.c,v 4.16 89/03/22 14:52:06 jtkohl Exp $ - * $Id: rd_req.c,v 1.2 1994/07/19 19:26:13 g89r4222 Exp $ + * $Id: rd_req.c,v 1.3 1995/07/18 16:39:33 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: rd_req.c,v 1.2 1994/07/19 19:26:13 g89r4222 Exp $"; +"$Id: rd_req.c,v 1.3 1995/07/18 16:39:33 mark Exp $"; #endif /* lint */ +#endif +#include #include #include #include #include #include -extern int krb_ap_req_debug; - static struct timeval t_local = { 0, 0 }; /* @@ -64,20 +65,17 @@ static char st_inst[INST_SZ]; /* server's instance */ * krb_rd_req(). */ -int -krb_set_key(key,cvt) - char *key; - int cvt; +int krb_set_key(char *key, int cvt) { #ifdef NOENCRYPTION bzero(ky, sizeof(ky)); return KSUCCESS; #else if (cvt) - string_to_key(key,ky); + string_to_key(key,(des_cblock *)ky); else bcopy(key,(char *)ky,8); - return(des_key_sched(ky,serv_key)); + return(des_key_sched((des_cblock *)ky,serv_key)); #endif } @@ -123,13 +121,8 @@ krb_set_key(key,cvt) * Mutual authentication is not implemented. */ -krb_rd_req(authent,service,instance,from_addr,ad,fn) - register KTEXT authent; /* The received message */ - char *service; /* Service name */ - char *instance; /* Service instance */ - long from_addr; /* Net address of originating host */ - AUTH_DAT *ad; /* Structure to be filled in */ - char *fn; /* Filename to get keys from */ +int krb_rd_req (KTEXT authent, char *service, char *instance, long from_addr, + AUTH_DAT *ad, char *fn) { static KTEXT_ST ticket; /* Temp storage for ticket */ static KTEXT tkt = &ticket; @@ -208,7 +201,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) #ifndef NOENCRYPTION if (read_service_key(service,instance,realm,s_kvno,fn,(char *)skey)) return(RD_AP_UNDEC); - if (status=krb_set_key((char *)skey,0)) return(status); + if ((status=krb_set_key((char *)skey,0))) return(status); #endif (void) strcpy(st_rlm,realm); (void) strcpy(st_nam,service); @@ -248,9 +241,10 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) bcopy(ptr + tkt->length, (char *)(req_id->dat),req_id->length); #ifndef NOENCRYPTION - key_sched(ad->session,seskey_sched); - pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat, - (long)req_id->length,seskey_sched,ad->session,DES_DECRYPT); + key_sched((des_cblock *)ad->session,seskey_sched); + pcbc_encrypt((des_cblock *)req_id->dat,(des_cblock *)req_id->dat, + (long)req_id->length,seskey_sched,(des_cblock *)ad->session, + DES_DECRYPT); #endif /* NOENCRYPTION */ #define check_ptr() if ((ptr - (char *) req_id->dat) > req_id->length) return(RD_AP_MODIFIED); diff --git a/eBones/krb/rd_safe.c b/eBones/krb/rd_safe.c index 3bfc490..48d43c5 100644 --- a/eBones/krb/rd_safe.c +++ b/eBones/krb/rd_safe.c @@ -13,16 +13,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_safe.c,v 4.12 89/01/23 15:16:16 steiner Exp $ - * $Id: rd_safe.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: rd_safe.c,v 1.3 1995/07/18 16:39:34 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: rd_safe.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: rd_safe.c,v 1.3 1995/07/18 16:39:34 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -34,10 +37,6 @@ static char rcsid[] = #include #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ static C_Block calc_cksum[2]; @@ -63,13 +62,9 @@ static u_long delta_t; * information, MSG_DAT, is defined in "krb.h". */ -long krb_rd_safe(in,in_length,key,sender,receiver,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* length of "in" msg */ - C_Block *key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender's address */ - struct sockaddr_in *receiver; /* receiver's address -- me */ - MSG_DAT *m_data; /* where to put message information */ +long krb_rd_safe(u_char *in, u_long in_length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *m_data) { register u_char *p,*q; static u_long src_addr; /* Can't send structs since no @@ -167,11 +162,11 @@ krb_rd_safe protocol err sizeof(u_long) != sizeof(struct in_addr)"); #ifdef NOENCRYPTION bzero(calc_cksum, sizeof(calc_cksum)); #else - quad_cksum(q,calc_cksum,p-q,2,key); + quad_cksum((des_cblock *)q,calc_cksum,p-q,2,(des_cblock *)key); #endif if (krb_debug) - printf("\ncalc_cksum = %u, received cksum = %u", + printf("\ncalc_cksum = %lu, received cksum = %lu", (long) calc_cksum[0], (long) big_cksum[0]); if (bcmp((char *)big_cksum,(char *)calc_cksum,sizeof(big_cksum))) return(RD_AP_MODIFIED); diff --git a/eBones/krb/read_service_key.c b/eBones/krb/read_service_key.c index c68a8fc..aa577fd 100644 --- a/eBones/krb/read_service_key.c +++ b/eBones/krb/read_service_key.c @@ -5,17 +5,20 @@ * . * * from: _service_key.c,v 4.10 90/03/10 19:06:56 jon Exp $ - * $Id: read_service_key.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: read_service_key.c,v 1.3 1995/07/18 16:39:36 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: read_service_key.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: read_service_key.c,v 1.3 1995/07/18 16:39:36 mark Exp $"; #endif /* lint */ +#endif #include #include #include +#include /* * The private keys for servers on a given host are stored in a @@ -51,13 +54,8 @@ static char *rcsid = /*ARGSUSED */ -read_service_key(service,instance,realm,kvno,file,key) - char *service; /* Service Name */ - char *instance; /* Instance name or "*" */ - char *realm; /* Realm */ - int kvno; /* Key version number */ - char *file; /* Filename */ - char *key; /* Pointer to key to be filled in */ +int read_service_key(char *service, char *instance, char *realm, int kvno, + char *file, char *key) { char serv[SNAME_SZ]; char inst[INST_SZ]; diff --git a/eBones/krb/recvauth.c b/eBones/krb/recvauth.c index 2ab364f..8e9a6bb 100644 --- a/eBones/krb/recvauth.c +++ b/eBones/krb/recvauth.c @@ -4,21 +4,25 @@ * . * * from: recvauth.c,v 4.4 90/03/10 19:03:08 jon Exp $"; - * $Id: recvauth.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: recvauth.c,v 1.3 1995/07/18 16:39:38 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: recvauth.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: recvauth.c,v 1.3 1995/07/18 16:39:38 mark Exp $"; #endif lint +#endif -#include #include #include #include #include #include +#include +#include #include +#include #define KRB_SENDAUTH_VERS "AUTHV0.1" /* MUST be KRB_SENDAUTH_VLEN @@ -30,8 +34,6 @@ static char rcsid[] = * be sure to support old versions of krb_sendauth! */ -extern int errno; - /* * krb_recvauth() reads (and optionally responds to) a message sent * using krb_sendauth(). The "options" argument is a bit-field of @@ -118,24 +120,14 @@ extern int errno; #endif /* max */ int -krb_recvauth(options, fd, ticket, service, instance, faddr, laddr, kdata, - filename, schedule, version) -long options; /* bit-pattern of options */ -int fd; /* file descr. to read from */ -KTEXT ticket; /* storage for client's ticket */ -char *service; /* service expected */ -char *instance; /* inst expected (may be filled in) */ -struct sockaddr_in *faddr; /* address of foreign host on fd */ -struct sockaddr_in *laddr; /* local address */ -AUTH_DAT *kdata; /* kerberos data (returned) */ -char *filename; /* name of file with service keys */ -Key_schedule schedule; /* key schedule (return) */ -char *version; /* version string (filled in) */ +krb_recvauth(long options, int fd, KTEXT ticket, char *service, char *instance, + struct sockaddr_in *faddr, struct sockaddr_in *laddr, AUTH_DAT *kdata, + char *filename, des_key_schedule schedule, char *version) { int i, cc, old_vers = 0; char krb_vers[KRB_SENDAUTH_VLEN + 1]; /* + 1 for the null terminator */ - char *cp; + char *cp = NULL; int rem; long tkt_len, priv_len; u_long cksum; @@ -250,7 +242,7 @@ char *version; /* version string (filled in) */ cksum = kdata->checksum + 1; cksum = htonl(cksum); #ifndef NOENCRYPTION - key_sched(kdata->session,schedule); + key_sched((des_cblock *)kdata->session,schedule); #endif priv_len = krb_mk_priv((unsigned char *)&cksum, tmp_buf, diff --git a/eBones/krb/save_credentials.c b/eBones/krb/save_credentials.c index 129c912..bec225f 100644 --- a/eBones/krb/save_credentials.c +++ b/eBones/krb/save_credentials.c @@ -5,13 +5,15 @@ * . * * from: save_credentials.c,v 4.9 89/05/31 17:45:43 jtkohl Exp $ - * $Id: save_credentials.c,v 1.2 1994/07/19 19:26:19 g89r4222 Exp $ + * $Id: save_credentials.c,v 1.3 1995/07/18 16:39:40 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: save_credentials.c,v 1.2 1994/07/19 19:26:19 g89r4222 Exp $"; +"$Id: save_credentials.c,v 1.3 1995/07/18 16:39:40 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -28,16 +30,8 @@ static char *rcsid = * by the tf_init() or tf_save_cred() routines. */ -save_credentials(service, instance, realm, session, lifetime, kvno, - ticket, issue_date) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT ticket; /* The ticket itself */ - long issue_date; /* The issue time */ +int save_credentials(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date) { int tf_status; /* return values of the tf_util calls */ diff --git a/eBones/krb/send_to_kdc.c b/eBones/krb/send_to_kdc.c index 43f04a2..1e1da44 100644 --- a/eBones/krb/send_to_kdc.c +++ b/eBones/krb/send_to_kdc.c @@ -4,18 +4,22 @@ * . * * from: send_to_kdc.c,v 4.20 90/01/02 13:40:37 jtkohl Exp $ - * $Id: send_to_kdc.c,v 1.3 1995/01/25 06:37:33 gibbs Exp $ + * $Id: send_to_kdc.c,v 1.3 1995/07/18 16:39:42 mark Exp $ */ +#if 0 #ifndef lint static char rcsid_send_to_kdc_c[] = "$Id: send_to_kdc.c,v 1.1 1994/03/21 17:35:39 piero Exp "; #endif /* lint */ +#endif #include #include #include +#include +#include #include #include #include @@ -24,16 +28,12 @@ static char rcsid_send_to_kdc_c[] = #endif /* lint */ #include #include +#include #include #include #define S_AD_SZ sizeof(struct sockaddr_in) -extern int errno; -extern int krb_debug; - -extern char *malloc(), *calloc(), *realloc(); - int krb_udp_port = 0; /* CLIENT_KRB_TIMEOUT indicates the time to wait before @@ -41,7 +41,6 @@ int krb_udp_port = 0; */ static struct timeval timeout = { CLIENT_KRB_TIMEOUT, 0}; static char *prog = "send_to_kdc"; -static send_recv(); /* * This file contains two routines, send_to_kdc() and send_recv(). @@ -49,6 +48,85 @@ static send_recv(); */ /* + * try to send out and receive message. + * return 1 on success, 0 on failure + */ + +static int send_recv(KTEXT pkt, KTEXT rpkt, int f, struct sockaddr_in *_to, + struct hostent *addrs) +{ + fd_set readfds; + register struct hostent *hp; + struct sockaddr_in from; + int sin_size; + int numsent; + + if (krb_debug) { + if (_to->sin_family == AF_INET) + printf("Sending message to %s...", + inet_ntoa(_to->sin_addr)); + else + printf("Sending message..."); + (void) fflush(stdout); + } + if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, + (struct sockaddr *)_to, + S_AD_SZ)) != pkt->length) { + if (krb_debug) + printf("sent only %d/%d\n",numsent, pkt->length); + return 0; + } + if (krb_debug) { + printf("Sent\nWaiting for reply..."); + (void) fflush(stdout); + } + FD_ZERO(&readfds); + FD_SET(f, &readfds); + errno = 0; + /* select - either recv is ready, or timeout */ + /* see if timeout or error or wrong descriptor */ + if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 + || !FD_ISSET(f, &readfds)) { + if (krb_debug) { + fprintf(stderr, "select failed: readfds=%lx", + (unsigned long)&readfds); + perror(""); + } + return 0; + } + sin_size = sizeof(from); + if (recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, + (struct sockaddr *)&from, &sin_size) + < 0) { + if (krb_debug) + perror("recvfrom"); + return 0; + } + if (krb_debug) { + printf("received packet from %s\n", inet_ntoa(from.sin_addr)); + fflush(stdout); + } + for (hp = addrs; hp->h_name != (char *)NULL; hp++) { + if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, + hp->h_length)) { + if (krb_debug) { + printf("Received it\n"); + (void) fflush(stdout); + } + return 1; + } + if (krb_debug) + fprintf(stderr, + "packet not from %lx\n", + (unsigned long)hp->h_addr); + } + if (krb_debug) + fprintf(stderr, "%s: received packet from wrong host! (%lx)\n", + "send_to_kdc(send_rcv)", (unsigned long)from.sin_addr.s_addr); + return 0; +} + +/* * send_to_kdc() sends a message to the Kerberos authentication * server(s) in the given realm and returns the reply message. * The "pkt" argument points to the message to be sent to Kerberos; @@ -75,10 +153,7 @@ static send_recv(); * after several retries */ -send_to_kdc(pkt,rpkt,realm) - KTEXT pkt; - KTEXT rpkt; - char *realm; +int send_to_kdc(KTEXT pkt, KTEXT rpkt, char *realm) { int i, f; int no_host; /* was a kerberos host found? */ @@ -230,86 +305,3 @@ rtn: } return(retval); } - -/* - * try to send out and receive message. - * return 1 on success, 0 on failure - */ - -static send_recv(pkt,rpkt,f,_to,addrs) - KTEXT pkt; - KTEXT rpkt; - int f; - struct sockaddr_in *_to; - struct hostent *addrs; -{ - fd_set readfds; - register struct hostent *hp; - struct sockaddr_in from; - int sin_size; - int numsent; - - if (krb_debug) { - if (_to->sin_family == AF_INET) - printf("Sending message to %s...", - inet_ntoa(_to->sin_addr)); - else - printf("Sending message..."); - (void) fflush(stdout); - } - if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, - (struct sockaddr *)_to, - S_AD_SZ)) != pkt->length) { - if (krb_debug) - printf("sent only %d/%d\n",numsent, pkt->length); - return 0; - } - if (krb_debug) { - printf("Sent\nWaiting for reply..."); - (void) fflush(stdout); - } - FD_ZERO(&readfds); - FD_SET(f, &readfds); - errno = 0; - /* select - either recv is ready, or timeout */ - /* see if timeout or error or wrong descriptor */ - if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 - || !FD_ISSET(f, &readfds)) { - if (krb_debug) { - fprintf(stderr, "select failed: readfds=%x", - readfds); - perror(""); - } - return 0; - } - sin_size = sizeof(from); - if (recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, - (struct sockaddr *)&from, &sin_size) - < 0) { - if (krb_debug) - perror("recvfrom"); - return 0; - } - if (krb_debug) { - printf("received packet from %s\n", inet_ntoa(from.sin_addr)); - fflush(stdout); - } - for (hp = addrs; hp->h_name != (char *)NULL; hp++) { - if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, - hp->h_length)) { - if (krb_debug) { - printf("Received it\n"); - (void) fflush(stdout); - } - return 1; - } - if (krb_debug) - fprintf(stderr, - "packet not from %x\n", - hp->h_addr); - } - if (krb_debug) - fprintf(stderr, "%s: received packet from wrong host! (%x)\n", - "send_to_kdc(send_rcv)", from.sin_addr.s_addr); - return 0; -} diff --git a/eBones/krb/sendauth.c b/eBones/krb/sendauth.c index 7d798bb..add71d9 100644 --- a/eBones/krb/sendauth.c +++ b/eBones/krb/sendauth.c @@ -4,13 +4,15 @@ * . * * from: sendauth.c,v 4.6 90/03/10 23:18:28 jon Exp $ - * $Id: sendauth.c,v 1.2 1994/07/19 19:26:23 g89r4222 Exp $ + * $Id: sendauth.c,v 1.3 1995/07/18 16:39:44 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: sendauth.c,v 1.2 1994/07/19 19:26:23 g89r4222 Exp $"; +"$Id: sendauth.c,v 1.3 1995/07/18 16:39:44 mark Exp $"; #endif lint +#endif #include #include @@ -26,10 +28,6 @@ static char rcsid[] = * and make appropriate changes in krb_recvauth.c */ -extern int errno; - -extern char *krb_get_phost(); - /* * This file contains two routines: krb_sendauth() and krb_sendsrv(). * @@ -109,21 +107,10 @@ extern char *krb_get_phost(); * will disappear when krb_sendauth() returns. */ -int -krb_sendauth(options, fd, ticket, service, inst, realm, checksum, - msg_data, cred, schedule, laddr, faddr, version) -long options; /* bit-pattern of options */ -int fd; /* file descriptor to write onto */ -KTEXT ticket; /* where to put ticket (return); or - * supplied in case of KOPT_DONT_MK_REQ */ -char *service, *inst, *realm; /* service name, instance, realm */ -u_long checksum; /* checksum to include in request */ -MSG_DAT *msg_data; /* mutual auth MSG_DAT (return) */ -CREDENTIALS *cred; /* credentials (return) */ -Key_schedule schedule; /* key schedule (return) */ -struct sockaddr_in *laddr; /* local address */ -struct sockaddr_in *faddr; /* address of foreign host on fd */ -char *version; /* version string */ +int krb_sendauth(long options, int fd, KTEXT ticket, char *service, char *inst, + char *realm, u_long checksum, MSG_DAT *msg_data, CREDENTIALS *cred, + des_key_schedule schedule, struct sockaddr_in *laddr, + struct sockaddr_in *faddr, char *version) { int rem, i, cc; char srv_inst[INST_SZ]; @@ -168,7 +155,7 @@ char *version; /* version string */ /* if mutual auth, get credentials so we have service session keys for decryption below */ if (options & KOPT_DO_MUTUAL) - if (cc = krb_get_cred(service, srv_inst, realm, cred)) + if ((cc = krb_get_cred(service, srv_inst, realm, cred))) return(cc); /* zero the buffer */ @@ -211,10 +198,10 @@ char *version; /* version string */ /* ...and decrypt it */ #ifndef NOENCRYPTION - key_sched(cred->session,schedule); + key_sched((des_cblock *)cred->session,schedule); #endif - if (cc = krb_rd_priv(priv_buf,(unsigned long) tkt_len, schedule, - cred->session, faddr, laddr, msg_data)) + if ((cc = krb_rd_priv(priv_buf,(unsigned long) tkt_len, schedule, + cred->session, faddr, laddr, msg_data))) return(cc); /* fetch the (modified) checksum */ @@ -234,10 +221,7 @@ char *version; /* version string */ * krb_sendsvc */ -int -krb_sendsvc(fd, service) -int fd; -char *service; +int krb_sendsvc(int fd, char *service) { /* write the service name length and then the service name to the fd */ diff --git a/eBones/krb/stime.c b/eBones/krb/stime.c index c040374..f70c33d 100644 --- a/eBones/krb/stime.c +++ b/eBones/krb/stime.c @@ -5,13 +5,15 @@ * . * * from: stime.c,v 4.5 88/11/15 16:58:05 jtkohl Exp $ - * $Id: stime.c,v 1.2 1994/07/19 19:26:25 g89r4222 Exp $ + * $Id: stime.c,v 1.3 1995/07/18 16:39:46 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: stime.c,v 1.2 1994/07/19 19:26:25 g89r4222 Exp $"; +"$Id: stime.c,v 1.3 1995/07/18 16:39:46 mark Exp $"; #endif /* lint */ +#endif #include #include /* for sprintf() */ diff --git a/eBones/krb/tf_shm.c b/eBones/krb/tf_shm.c index f2f97ab..ad6690a 100644 --- a/eBones/krb/tf_shm.c +++ b/eBones/krb/tf_shm.c @@ -7,13 +7,15 @@ * contributed by Dan Kolkowitz (kolk@jessica.stanford.edu). * * from: tf_shm.c,v 4.2 89/10/25 23:26:46 qjb Exp $ - * $Id: tf_shm.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: tf_shm.c,v 1.3 1995/07/18 16:39:48 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: tf_shm.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: tf_shm.c,v 1.3 1995/07/18 16:39:48 mark Exp $"; #endif lint +#endif #include #include @@ -26,9 +28,6 @@ static char rcsid[] = #define MAX_BUFF sizeof(des_cblock)*1000 /* room for 1k keys */ -extern int errno; -extern int krb_debug; - /* * krb_create_shmtkt: * @@ -36,9 +35,7 @@ extern int krb_debug; * in the specified filename. */ -int -krb_shm_create(file_name) -char *file_name; +int krb_shm_create(char *file_name) { int retval; int shmid; @@ -136,8 +133,7 @@ int krb_is_diskless() * file pointing to it. */ -int krb_shm_dest(file) -char *file; +int krb_shm_dest(char *file) { int shmid; FILE *sfile; @@ -169,6 +165,3 @@ char *file; } else return(RET_TKFIL); /* XXX */ } - - - diff --git a/eBones/krb/tf_util.c b/eBones/krb/tf_util.c index cb4908e..ef91658 100644 --- a/eBones/krb/tf_util.c +++ b/eBones/krb/tf_util.c @@ -4,15 +4,19 @@ * . * * from: tf_util.c,v 4.9 90/03/10 19:19:45 jon Exp $ - * $Id: tf_util.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: tf_util.c,v 1.3 1995/07/18 16:39:50 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: tf_util.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: tf_util.c,v 1.3 1995/07/18 16:39:50 mark Exp $"; #endif /* lint */ +#endif #include +#include +#include #include #include #include @@ -29,9 +33,6 @@ static char rcsid[] = #define TF_LCK_RETRY ((unsigned)2) /* seconds to sleep before * retry if ticket file is * locked */ -extern errno; -extern int krb_debug; - #ifdef TKT_SHMEM char *krb_shm_addr = 0; static char *tmp_shm_addr = 0; @@ -53,9 +54,9 @@ char *shmat(); * c. In tf_close, be sure it gets reinitialized to a negative * number. */ -static fd = -1; -static curpos; /* Position in tfbfr */ -static lastpos; /* End of tfbfr */ +static int fd = -1; +static int curpos; /* Position in tfbfr */ +static int lastpos; /* End of tfbfr */ static char tfbfr[BUFSIZ]; /* Buffer for ticket data */ static tf_gets(), tf_read(); @@ -122,8 +123,7 @@ static tf_gets(), tf_read(); * TKT_FIL_LCK - couldn't lock the file, even after a retry */ -tf_init(tf_name, rw) - char *tf_name; +int tf_init(char *tf_name, int rw) { int wflag; uid_t me, getuid(); @@ -259,8 +259,7 @@ tf_init(tf_name, rw) * was longer than ANAME_SZ, TKT_FIL_FMT is returned. */ -tf_get_pname(p) - char *p; +int tf_get_pname(char *p) { if (fd < 0) { if (krb_debug) @@ -282,8 +281,7 @@ tf_get_pname(p) * instance may be null. */ -tf_get_pinst(inst) - char *inst; +int tf_get_pinst(char *inst) { if (fd < 0) { if (krb_debug) @@ -296,6 +294,33 @@ tf_get_pinst(inst) } /* + * tf_close() closes the ticket file and sets "fd" to -1. If "fd" is + * not a valid file descriptor, it just returns. It also clears the + * buffer used to read tickets. + * + * The return value is not defined. + */ + +void tf_close() +{ + if (!(fd < 0)) { +#ifdef TKT_SHMEM + if (shmdt(krb_shm_addr)) { + /* what kind of error? */ + if (krb_debug) + fprintf(stderr, "shmdt 0x%x: errno %d",krb_shm_addr, errno); + } else { + krb_shm_addr = 0; + } +#endif TKT_SHMEM + (void) flock(fd, LOCK_UN); + (void) close(fd); + fd = -1; /* see declaration of fd above */ + } + bzero(tfbfr, sizeof(tfbfr)); +} + +/* * tf_get_cred() reads a CREDENTIALS record from a ticket file and fills * in the given structure "c". It should only be called after tf_init(), * tf_get_pname(), and tf_get_pinst() have been called. If all goes well, @@ -306,8 +331,7 @@ tf_get_pinst(inst) * EOF - end of file encountered */ -tf_get_cred(c) - CREDENTIALS *c; +int tf_get_cred(CREDENTIALS *c) { KTEXT ticket = &c->ticket_st; /* pointer to ticket */ int k_errno; @@ -364,33 +388,6 @@ tf_get_cred(c) } /* - * tf_close() closes the ticket file and sets "fd" to -1. If "fd" is - * not a valid file descriptor, it just returns. It also clears the - * buffer used to read tickets. - * - * The return value is not defined. - */ - -tf_close() -{ - if (!(fd < 0)) { -#ifdef TKT_SHMEM - if (shmdt(krb_shm_addr)) { - /* what kind of error? */ - if (krb_debug) - fprintf(stderr, "shmdt 0x%x: errno %d",krb_shm_addr, errno); - } else { - krb_shm_addr = 0; - } -#endif TKT_SHMEM - (void) flock(fd, LOCK_UN); - (void) close(fd); - fd = -1; /* see declaration of fd above */ - } - bzero(tfbfr, sizeof(tfbfr)); -} - -/* * tf_gets() is an internal routine. It takes a string "s" and a count * "n", and reads from the file until either it has read "n" characters, * or until it reads a null byte. When finished, what has been read exists @@ -408,9 +405,7 @@ tf_close() * file is seriously ill. */ -static -tf_gets(s, n) - register char *s; +static int tf_gets(char *s, int n) { register count; @@ -449,12 +444,9 @@ tf_gets(s, n) * 0 on end of file or read error */ -static -tf_read(s, n) - register char *s; - register n; +static int tf_read(char *s, int n) { - register count; + int count; for (count = n; count > 0; --count) { if (curpos >= sizeof(tfbfr)) { @@ -486,16 +478,8 @@ char *tkt_string(); * called previously, and KFAILURE for anything else that went wrong. */ -tf_save_cred(service, instance, realm, session, lifetime, kvno, - ticket, issue_date) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT ticket; /* The ticket itself */ - long issue_date; /* The issue time */ +int tf_save_cred(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date) { off_t lseek(); diff --git a/eBones/krb/tkt_string.c b/eBones/krb/tkt_string.c index ba22db8..bbbdbc5 100644 --- a/eBones/krb/tkt_string.c +++ b/eBones/krb/tkt_string.c @@ -5,22 +5,23 @@ * . * * from: tkt_string.c,v 4.6 89/01/05 12:31:51 raeburn Exp $ - * $Id: tkt_string.c,v 1.2 1994/07/19 19:26:29 g89r4222 Exp $ + * $Id: tkt_string.c,v 1.3 1995/07/18 16:39:52 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: tkt_string.c,v 1.2 1994/07/19 19:26:29 g89r4222 Exp $"; +"$Id: tkt_string.c,v 1.3 1995/07/18 16:39:52 mark Exp $"; #endif /* lint */ +#endif #include +#include #include #include #include #include -char *getenv(); - /* * This routine is used to generate the name of the file that holds * the user's cache of server tickets and associated session keys. @@ -43,14 +44,14 @@ char *tkt_string() uid_t getuid(); if (!*krb_ticket_string) { - if (env = getenv("KRBTKFILE")) { + if ((env = getenv("KRBTKFILE"))) { (void) strncpy(krb_ticket_string, env, sizeof(krb_ticket_string)-1); krb_ticket_string[sizeof(krb_ticket_string)-1] = '\0'; } else { /* 32 bits of signed integer will always fit in 11 characters (including the sign), so no need to worry about overflow */ - (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,getuid()); + (void) sprintf(krb_ticket_string, "%s%ld",TKT_ROOT,getuid()); } } return krb_ticket_string; @@ -67,9 +68,7 @@ char *tkt_string() * and return an undesired ticket file name until this routine is called. */ -void -krb_set_tkt_string(val) -char *val; +void krb_set_tkt_string(char *val) { (void) strncpy(krb_ticket_string, val, sizeof(krb_ticket_string)-1); diff --git a/eBones/krb/util.c b/eBones/krb/util.c index 8e48557..8dca743 100644 --- a/eBones/krb/util.c +++ b/eBones/krb/util.c @@ -6,13 +6,15 @@ * Miscellaneous debug printing utilities * * from: util.c,v 4.8 89/01/17 22:02:08 wesommer Exp $ - * $Id: util.c,v 1.2 1994/07/19 19:26:31 g89r4222 Exp $ + * $Id: util.c,v 1.3 1995/07/18 16:39:54 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: util.c,v 1.2 1994/07/19 19:26:31 g89r4222 Exp $"; +"$Id: util.c,v 1.3 1995/07/18 16:39:54 mark Exp $"; #endif lint +#endif #include #include @@ -28,14 +30,13 @@ static char rcsid[] = * pname, pinst, prealm, netaddr, flags, cksum, timestamp, session */ -ad_print(x) -AUTH_DAT *x; +void ad_print(AUTH_DAT *x) { struct in_addr in; /* Print the contents of an auth_dat struct. */ in.s_addr = x->address; - printf("\n%s %s %s %s flags %u cksum 0x%X\n\ttkt_tm 0x%X sess_key", + printf("\n%s %s %s %s flags %u cksum 0x%lX\n\ttkt_tm 0x%lX sess_key", x->pname, x->pinst, x->prealm, inet_ntoa(in), x->k_flags, x->checksum, x->time_sec); @@ -43,7 +44,7 @@ AUTH_DAT *x; #ifdef NOENCRYPTION placebo_cblock_print(x->session); #else - des_cblock_print_file(x->session,stdout); + des_cblock_print_file((des_cblock *)x->session,stdout); #endif /* skip reply for now */ } diff --git a/eBones/ksrvtgt/Makefile b/eBones/ksrvtgt/Makefile index 5e8944d..1c6b0dc 100644 --- a/eBones/ksrvtgt/Makefile +++ b/eBones/ksrvtgt/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:26:54 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:40:05 mark Exp $ PROG= ksrvtgt CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/ksrvtgt/ksrvtgt.c b/eBones/ksrvtgt/ksrvtgt.c index 79acf3e..c51457c 100644 --- a/eBones/ksrvtgt/ksrvtgt.c +++ b/eBones/ksrvtgt/ksrvtgt.c @@ -7,12 +7,12 @@ * The lifetime is the shortest allowed [1 five-minute interval] * * from: ksrvtgt.c,v 4.3 89/07/28 10:17:28 jtkohl Exp $ - * $Id: ksrvtgt.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: ksrvtgt.c,v 1.3 1995/07/18 16:40:07 mark Exp $ */ #ifndef lint const char rcsid[] = -"$Id: ksrvtgt.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: ksrvtgt.c,v 1.3 1995/07/18 16:40:07 mark Exp $"; #endif /* lint */ #include @@ -49,7 +49,7 @@ main(argc,argv) (void) strcpy(srvtab, KEYFILE); if (realm[0] == 0) - if (krb_get_lrealm(realm) != KSUCCESS) + if (krb_get_lrealm(realm, 1) != KSUCCESS) (void) strcpy(realm, KRB_REALM); code = krb_get_svc_in_tkt(argv[1], argv[2], realm, diff --git a/eBones/ksrvutil/Makefile b/eBones/ksrvutil/Makefile index bdff452..1fcaf0c 100644 --- a/eBones/ksrvutil/Makefile +++ b/eBones/ksrvutil/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:40:09 mark Exp $ PROG= ksrvutil SRCS= ksrvutil.c diff --git a/eBones/ksrvutil/ksrvutil.c b/eBones/ksrvutil/ksrvutil.c index d1e9474..6d81e72 100644 --- a/eBones/ksrvutil/ksrvutil.c +++ b/eBones/ksrvutil/ksrvutil.c @@ -13,7 +13,7 @@ static char rcsid_ksrvutil_c[] = "BonesHeader: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/ksrvutil.c,v 4.1 89/09/26 09:33:49 jtkohl Exp "; #endif static const char rcsid[] = - "$Id: ksrvutil.c,v 1.2 1995/01/23 22:54:08 wollman Exp $"; + "$Id: ksrvutil.c,v 1.1 1995/07/18 16:40:11 mark Exp $"; #endif lint /* diff --git a/eBones/kstash/Makefile b/eBones/kstash/Makefile index d096b9c..b194a2c 100644 --- a/eBones/kstash/Makefile +++ b/eBones/kstash/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.2 (Berkeley) 3/5/91 -# $Id: Makefile,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:40:14 mark Exp $ PROG= kstash CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/kstash/kstash.c b/eBones/kstash/kstash.c index d8afe20..d5a59bf 100644 --- a/eBones/kstash/kstash.c +++ b/eBones/kstash/kstash.c @@ -5,12 +5,12 @@ * . * * from: kstash.c,v 4.0 89/01/23 09:45:43 jtkohl Exp $ - * $Id: kstash.c,v 1.1.1.1 1994/09/30 14:50:05 csgr Exp $ + * $Id: kstash.c,v 1.3 1995/07/18 16:40:16 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kstash.c,v 1.1.1.1 1994/09/30 14:50:05 csgr Exp $"; +"$Id: kstash.c,v 1.3 1995/07/18 16:40:16 mark Exp $"; #endif lint #include diff --git a/eBones/lib/libacl/Makefile b/eBones/lib/libacl/Makefile index 77c9a01..0ac5183 100644 --- a/eBones/lib/libacl/Makefile +++ b/eBones/lib/libacl/Makefile @@ -1,10 +1,10 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.3 1994/09/09 21:43:17 g89r4222 Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:34:47 mark Exp $ LIB= acl SHLIB_MAJOR= 2 SHLIB_MINOR= 0 -CFLAGS+=-DDEBUG -DKERBEROS -I${.CURDIR}/../include +CFLAGS+=-DDEBUG -DKERBEROS -I${.CURDIR}/../include -Wall SRCS= acl_files.c .include diff --git a/eBones/lib/libacl/acl_files.c b/eBones/lib/libacl/acl_files.c index 1b97bb2..1f488f3 100644 --- a/eBones/lib/libacl/acl_files.c +++ b/eBones/lib/libacl/acl_files.c @@ -6,25 +6,29 @@ * . * * from: acl_files.c,v 4.4 89/12/19 13:30:53 jtkohl Exp $ - * $Id: acl_files.c,v 1.1.1.1 1994/09/30 14:49:48 csgr Exp $ + * $Id: acl_files.c,v 1.3 1995/07/18 16:34:49 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: acl_files.c,v 1.1.1.1 1994/09/30 14:49:48 csgr Exp $"; +"$Id: acl_files.c,v 1.3 1995/07/18 16:34:49 mark Exp $"; #endif lint +#endif /*** Routines for manipulating access control list files ***/ #include +#include #include #include #include #include #include #include -#include "krb.h" +#include +#include __BEGIN_DECLS static int acl_abort __P((char *, FILE *)); @@ -55,17 +59,14 @@ __END_DECLS extern int errno; -extern char *malloc(), *calloc(); -extern time_t time(); +/* extern time_t time(); */ /* Canonicalize a principal name */ /* If instance is missing, it becomes "" */ /* If realm is missing, it becomes the local realm */ /* Canonicalized form is put in canon, which must be big enough to hold MAX_PRINCIPAL_SIZE characters */ -acl_canonicalize_principal(principal, canon) -char *principal; -char *canon; +void acl_canonicalize_principal(char *principal, char *canon) { char *dot, *atsign, *end; int len; @@ -126,8 +127,7 @@ char *canon; /* Return new FILE pointer */ /* or NULL if file cannot be modified */ /* REQUIRES WRITE PERMISSION TO CONTAINING DIRECTORY */ -static FILE *acl_lock_file(acl_file) -char *acl_file; +static FILE *acl_lock_file(char *acl_file) { struct stat s; char new[LINESIZE]; @@ -174,9 +174,7 @@ char *acl_file; /* Returns > 0 if lock was broken */ /* Returns < 0 if some other error occurs */ /* Closes f */ -static int acl_commit(acl_file, f) -char *acl_file; -FILE *f; +static int acl_commit(char *acl_file, FILE *f) { char new[LINESIZE]; int ret; @@ -200,10 +198,7 @@ FILE *f; * Returns 0 if successful, < 0 otherwise * Closes f */ -static int -acl_abort(acl_file, f) -char *acl_file; -FILE *f; +static int acl_abort(char *acl_file, FILE *f) { char new[LINESIZE]; int ret; @@ -225,9 +220,7 @@ FILE *f; /* Creates the file with permissions perm if it does not exist */ /* Erases it if it does */ /* Returns return value of acl_commit */ -int acl_initialize(acl_file, perm) -char *acl_file; -int perm; +int acl_initialize(char *acl_file, int perm) { FILE *new; int fd; @@ -248,8 +241,7 @@ int perm; /* Eliminate all whitespace character in buf */ /* Modifies its argument */ -static nuke_whitespace(buf) -char *buf; +static void nuke_whitespace(char *buf) { register char *pin, *pout; @@ -281,8 +273,7 @@ int size; } /* Destroy a hash table */ -static destroy_hash(h) -struct hashtbl *h; +static void destroy_hash(struct hashtbl *h) { int i; @@ -294,8 +285,7 @@ struct hashtbl *h; } /* Compute hash value for a string */ -static unsigned hashval(s) -register char *s; +static unsigned hashval(char *s) { register unsigned hv; @@ -306,9 +296,7 @@ register char *s; } /* Add an element to a hash table */ -static add_hash(h, el) -struct hashtbl *h; -char *el; +static void add_hash(struct hashtbl *h, char *el) { unsigned hv; char *s; @@ -339,9 +327,7 @@ char *el; } /* Returns nonzero if el is in h */ -static check_hash(h, el) -struct hashtbl *h; -char *el; +static int check_hash(struct hashtbl *h, char *el) { unsigned hv; @@ -368,8 +354,7 @@ static int acl_cache_next = 0; /* Returns < 0 if unsuccessful in loading acl */ /* Returns index into acl_cache otherwise */ /* Note that if acl is already loaded, this is just a lookup */ -static int acl_load(name) -char *name; +static int acl_load(char *name) { int i; FILE *f; @@ -436,9 +421,7 @@ char *name; /* Returns nonzero if it can be determined that acl contains principal */ /* Principal is not canonicalized, and no wildcarding is done */ -acl_exact_match(acl, principal) -char *acl; -char *principal; +int acl_exact_match(char *acl, char *principal) { int idx; @@ -449,9 +432,7 @@ char *principal; /* Returns nonzero if it can be determined that acl contains principal */ /* Recognizes wildcards in acl of the form name.*@realm, *.*@realm, and *.*@* */ -acl_check(acl, principal) -char *acl; -char *principal; +int acl_check(char *acl, char *principal) { char buf[MAX_PRINCIPAL_SIZE]; char canon[MAX_PRINCIPAL_SIZE]; @@ -477,9 +458,7 @@ char *principal; /* Adds principal to acl */ /* Wildcards are interpreted literally */ -acl_add(acl, principal) -char *acl; -char *principal; +int acl_add(char *acl, char *principal) { int idx; int i; @@ -511,9 +490,7 @@ char *principal; /* Removes principal from acl */ /* Wildcards are interpreted literally */ -acl_delete(acl, principal) -char *acl; -char *principal; +int acl_delete(char *acl, char *principal) { int idx; int i; diff --git a/eBones/lib/libacl/acl_files.doc b/eBones/lib/libacl/acl_files.doc index 78c448a..4096f9b 100644 --- a/eBones/lib/libacl/acl_files.doc +++ b/eBones/lib/libacl/acl_files.doc @@ -1,7 +1,7 @@ PROTOTYPE ACL LIBRARY Introduction - + An access control list (ACL) is a list of principals, where each principal is is represented by a text string which cannot contain whitespace. The library allows application programs to refer to named @@ -90,7 +90,7 @@ int mode; Initialize acl. If acl file does not exist, creates it with mode mode. If acl exists, removes all members. Returns 0 if successful, nonzero otherwise. WARNING: Mode argument is likely to change with -the eventual introduction of an ACL service. +the eventual introduction of an ACL service. Known problems diff --git a/eBones/lib/libkadm/Makefile b/eBones/lib/libkadm/Makefile index f587d5c..4642530 100644 --- a/eBones/lib/libkadm/Makefile +++ b/eBones/lib/libkadm/Makefile @@ -1,9 +1,9 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:40:20 mark Exp $ LIB= kadm SRCS= kadm_err.c kadm_stream.c kadm_supp.c kadm_cli_wrap.c -CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../include -I${KRBOBJDIR} -DPOSIX +CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../include -I${KRBOBJDIR} -DPOSIX -Wall CLEANFILES+= kadm_err.c kadm_err.h kadm_err.c kadm_err.h: kadm_err.et diff --git a/eBones/lib/libkadm/kadm.h b/eBones/lib/libkadm/kadm.h index 965b530..eea05df 100644 --- a/eBones/lib/libkadm/kadm.h +++ b/eBones/lib/libkadm/kadm.h @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/libkadm/kadm.h,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/libkadm/kadm.h,v $ + * $Author: mark $ * Header: /afs/athena.mit.edu/astaff/project/kerberos/src/include/RCS/kadm.h,v 4.2 89/09/26 09:15:20 jtkohl Exp * * Copyright 1988 by the Massachusetts Institute of Technology. @@ -25,6 +25,7 @@ #define MAXHOSTNAMELEN 64 #endif +#include #include #include #include @@ -121,20 +122,27 @@ MODACL #define MOD_ENT 4 #define GET_ENT 5 -extern long kdb_get_master_key(); /* XXX should be in krb_db.h */ -extern long kdb_verify_master_key(); /* XXX ditto */ - -extern long krb_mk_priv(), krb_rd_priv(); /* XXX should be in krb.h */ -extern void krb_set_tkt_string(); /* XXX ditto */ - -extern unsigned long quad_cksum(); /* XXX should be in des.h */ - /* XXX This doesn't belong here!!! */ -char *malloc(), *realloc(); #ifdef POSIX typedef void sigtype; #else typedef int sigtype; #endif +int vals_to_stream(Kadm_vals *dt_in, u_char **dt_out); +int stream_to_vals(u_char *dt_in, Kadm_vals *dt_out, int maxlen); + +int build_field_header(u_char *cont, u_char **st); +int check_field_header(u_char *st, u_char *cont, int maxlen); + +int stv_string(u_char *st, char *dat, int loc, int stlen, int maxlen); +int stv_short(u_char *st, u_short *dat, int loc, int maxlen); +int stv_long(u_char *st, u_long *dat, int loc, int maxlen); +int stv_char(u_char *st, u_char *dat, int loc, int maxlen); + +int vts_string(char *dat, u_char **st, int loc); +int vts_short(u_short dat, u_char **st, int loc); +int vts_long(u_long dat, u_char **st, int loc); +int vts_char(u_char dat, u_char **st, int loc); + #endif KADM_DEFS diff --git a/eBones/lib/libkadm/kadm_cli_wrap.c b/eBones/lib/libkadm/kadm_cli_wrap.c index 7e1cfa9..3522e74 100644 --- a/eBones/lib/libkadm/kadm_cli_wrap.c +++ b/eBones/lib/libkadm/kadm_cli_wrap.c @@ -7,20 +7,22 @@ * Kerberos administration server client-side routines */ -#ifndef lint #if 0 +#ifndef lint static char rcsid_kadm_cli_wrap_c[] = "from: Id: kadm_cli_wrap.c,v 4.6 89/12/30 20:09:45 qjb Exp"; -#endif static const char rcsid[] = - "$Id: kadm_cli_wrap.c,v 1.1 1995/01/20 02:02:51 wollman Exp $"; + "$Id: kadm_cli_wrap.c,v 1.1 1995/07/18 16:40:23 mark Exp $"; #endif lint +#endif /* * kadm_cli_wrap.c the client side wrapping of the calls to the admin server */ #include +#include +#include #include #include #include @@ -29,6 +31,12 @@ static const char rcsid[] = #include #include +int kadm_cli_out(u_char *dat, int dat_len, u_char **ret_dat, int *ret_siz); +int kadm_cli_send(u_char *st_dat, int st_siz, u_char **ret_dat, int *ret_siz); +int kadm_cli_keyd(des_cblock *s_k, des_key_schedule s_s); +int kadm_cli_conn(void); +void kadm_cli_disconn(void); + #ifndef NULL #define NULL 0 #endif @@ -42,8 +50,7 @@ static Kadm_Client client_parm; static des_cblock sess_key; /* to be filled in by kadm_cli_keyd */ static Key_schedule sess_sched; -static -clear_secrets() +static void clear_secrets() { bzero((char *)sess_key, sizeof(sess_key)); bzero((char *)sess_sched, sizeof(sess_sched)); @@ -58,10 +65,7 @@ clear_secrets() * data about the connection between the server and client, the services * used, the locations and other fun things */ -kadm_init_link(n, i, r) -char n[]; -char i[]; -char r[]; +int kadm_init_link(char n[], char i[], char r[]) { struct servent *sep; /* service we will talk to */ struct hostent *hop; /* host we will talk to */ @@ -100,8 +104,7 @@ char r[]; * key. Returns no actual data from the master server, since this is called * by a user */ -kadm_change_pw(newkey) -des_cblock newkey; /* The DES form of the users key */ +int kadm_change_pw(des_cblock newkey) { int stsize, retc; /* stream size and return code */ u_char *send_st; /* send stream */ @@ -145,8 +148,7 @@ des_cblock newkey; /* The DES form of the users key */ * entry, so if you leave certain fields blank you will be able to determine * the default values they are set to */ -kadm_add(vals) -Kadm_vals *vals; +int kadm_add(Kadm_vals *vals) { u_char *st, *st2; /* st will hold the stream of values */ int st_len; /* st2 the final stream with opcode */ @@ -182,9 +184,7 @@ Kadm_vals *vals; * Modifies all entries corresponding to the first values so they match the * second values. returns the values for the changed entries in vals2 */ -kadm_mod(vals1, vals2) -Kadm_vals *vals1; -Kadm_vals *vals2; +int kadm_mod(Kadm_vals *vals1, Kadm_vals *vals2) { u_char *st, *st2; /* st will hold the stream of values */ int st_len, nlen; /* st2 the final stream with opcode */ @@ -228,10 +228,7 @@ Kadm_vals *vals2; * this data for each matching recipient, after a count of how many such * matches there were */ -kadm_get(vals, fl) -Kadm_vals *vals; -u_char fl[4]; - +int kadm_get(Kadm_vals *vals, u_char fl[4]) { int loop; /* for copying the fields data */ u_char *st, *st2; /* st will hold the stream of values */ @@ -279,11 +276,7 @@ u_char fl[4]; * connection to the admin server. If the connection is succesfully open * then it sends the data and waits for a reply. */ -kadm_cli_send(st_dat, st_siz, ret_dat, ret_siz) -u_char *st_dat; /* the actual data */ -int st_siz; /* length of said data */ -u_char **ret_dat; /* to give return info */ -int *ret_siz; /* length of returned info */ +int kadm_cli_send(u_char *st_dat, int st_siz, u_char **ret_dat, int *ret_siz) { int act_len, retdat; /* current offset into packet, return * data */ @@ -299,7 +292,7 @@ int *ret_siz; /* length of returned info */ (void) strncpy((char *)act_st, KADM_VERSTR, KADM_VERSIZE); act_len = KADM_VERSIZE; - if ((retdat = kadm_cli_keyd(sess_key, sess_sched)) != KADM_SUCCESS) { + if ((retdat = kadm_cli_keyd(&sess_key, sess_sched)) != KADM_SUCCESS) { free((char *)act_st); return retdat; /* couldnt get key working */ } @@ -318,11 +311,11 @@ int *ret_siz; /* length of returned info */ #ifdef NOENCRYPTION cksum = 0; #else - cksum = quad_cksum(priv_pak, (u_long *)0, (long)priv_len, 0, - sess_key); + cksum = quad_cksum((des_cblock *)priv_pak, (des_cblock *)0, + (long)priv_len, 0, &sess_key); #endif - if (retdat = krb_mk_req(&authent, client_parm.sname, client_parm.sinst, - client_parm.krbrlm, (long)cksum)) { + if ((retdat = krb_mk_req(&authent, client_parm.sname, client_parm.sinst, + client_parm.krbrlm, (long)cksum))) { /* authenticator? */ RET_N_FREE(retdat + krb_err_base); } @@ -359,9 +352,9 @@ int *ret_siz; /* length of returned info */ RET_N_FREE2(retdat); } /* need to decode the ret_dat */ - if (retdat = krb_rd_priv(*ret_dat, (u_long)*ret_siz, sess_sched, + if ((retdat = krb_rd_priv(*ret_dat, (u_long)*ret_siz, sess_sched, sess_key, &client_parm.admin_addr, - &client_parm.my_addr, &mdat)) + &client_parm.my_addr, &mdat))) RET_N_FREE2(retdat+krb_err_base); if (mdat.app_length < KADM_VERSIZE + 4) /* too short! */ @@ -386,23 +379,21 @@ int *ret_siz; /* length of returned info */ } /* takes in the sess_key and key_schedule and sets them appropriately */ -kadm_cli_keyd(s_k, s_s) -des_cblock s_k; /* session key */ -des_key_schedule s_s; /* session key schedule */ +int kadm_cli_keyd(des_cblock *s_k, des_key_schedule s_s) { CREDENTIALS cred; /* to get key data */ int stat; /* want .sname and .sinst here.... */ - if (stat = krb_get_cred(client_parm.sname, client_parm.sinst, - client_parm.krbrlm, &cred)) + if ((stat = krb_get_cred(client_parm.sname, client_parm.sinst, + client_parm.krbrlm, &cred))) return stat + krb_err_base; bcopy((char *) cred.session, (char *) s_k, sizeof(des_cblock)); bzero((char *) cred.session, sizeof(des_cblock)); #ifdef NOENCRYPTION bzero(s_s, sizeof(des_key_schedule)); #else - if (stat = key_sched(s_k,s_s)) + if ((stat = key_sched(s_k,s_s))) return(stat+krb_err_base); #endif return KADM_SUCCESS; @@ -410,7 +401,7 @@ des_key_schedule s_s; /* session key schedule */ static sigtype (*opipe)(); -kadm_cli_conn() +int kadm_cli_conn() { /* this connects and sets my_addr */ int on = 1; @@ -444,20 +435,15 @@ kadm_cli_conn() return KADM_SUCCESS; } -kadm_cli_disconn() +void kadm_cli_disconn() { (void) close(client_parm.admin_fd); (void) signal(SIGPIPE, opipe); return; } -kadm_cli_out(dat, dat_len, ret_dat, ret_siz) -u_char *dat; -int dat_len; -u_char **ret_dat; -int *ret_siz; +int kadm_cli_out(u_char *dat, int dat_len, u_char **ret_dat, int *ret_siz) { - extern int errno; u_short dlen; int retval; @@ -474,8 +460,8 @@ int *ret_siz; if (krb_net_write(client_parm.admin_fd, (char *) dat, dat_len) < 0) return (errno); /* XXX */ - if (retval = krb_net_read(client_parm.admin_fd, (char *) &dlen, - sizeof(u_short)) != sizeof(u_short)) { + if ((retval = krb_net_read(client_parm.admin_fd, (char *) &dlen, + sizeof(u_short))) != sizeof(u_short)) { if (retval < 0) return(errno); /* XXX */ else @@ -487,8 +473,8 @@ int *ret_siz; if (!*ret_dat) return(KADM_NOMEM); - if (retval = krb_net_read(client_parm.admin_fd, (char *) *ret_dat, - (int) dlen) != dlen) { + if ((retval = krb_net_read(client_parm.admin_fd, (char *) *ret_dat, + (int) dlen)) != dlen) { if (retval < 0) return(errno); /* XXX */ else diff --git a/eBones/lib/libkadm/kadm_err.et b/eBones/lib/libkadm/kadm_err.et index 9a04851..e45a9c2 100644 --- a/eBones/lib/libkadm/kadm_err.et +++ b/eBones/lib/libkadm/kadm_err.et @@ -1,6 +1,6 @@ -# $Source: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_err.et,v $ -# $Author: jtkohl $ -# $Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_err.et,v 4.0 89/01/24 15:16:10 jtkohl Exp $ +# $Source: /usr/cvs/src/eBones/libkadm/kadm_err.et,v $ +# $Author: mark $ +# $Header: /usr/cvs/src/eBones/libkadm/kadm_err.et,v 1.1 1995/07/18 16:40:25 mark Exp $ # Copyright 1988 by the Massachusetts Institute of Technology. # # For copying and distribution information, please see the file @@ -12,7 +12,7 @@ # KADM_SUCCESS, as all success codes should be, is zero -ec KADM_RCSID, "$Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_err.et,v 4.0 89/01/24 15:16:10 jtkohl Exp $" +ec KADM_RCSID, "$Header: /usr/cvs/src/eBones/libkadm/kadm_err.et,v 1.1 1995/07/18 16:40:25 mark Exp $" # /* Building and unbuilding the packet errors */ ec KADM_NO_REALM, "Cannot fetch local realm" ec KADM_NO_CRED, "Unable to fetch credentials" diff --git a/eBones/lib/libkadm/kadm_stream.c b/eBones/lib/libkadm/kadm_stream.c index 6ceb02e..02b8263 100644 --- a/eBones/lib/libkadm/kadm_stream.c +++ b/eBones/lib/libkadm/kadm_stream.c @@ -7,14 +7,14 @@ * Stream conversion functions for Kerberos administration server */ -#ifndef lint #if 0 +#ifndef lint static char rcsid_kadm_stream_c[] = "Header: /afs/athena.mit.edu/astaff/project/kerberos/src/lib/kadm/RCS/kadm_stream.c,v 4.2 89/09/26 09:20:48 jtkohl Exp "; -#endif static const char rcsid[] = - "$Id: kadm_stream.c,v 1.1 1995/01/20 02:02:53 wollman Exp $"; + "$Id: kadm_stream.c,v 1.1 1995/07/18 16:40:27 mark Exp $"; #endif lint +#endif /* kadm_stream.c @@ -28,6 +28,7 @@ static const char rcsid[] = fatal: prints out a kadm fatal error message, exits */ +#include #include "kadm.h" #define min(a,b) (((a) < (b)) ? (a) : (b)) @@ -39,9 +40,7 @@ vals_to_stream this function creates a byte-stream representation of the kadm_vals structure */ -vals_to_stream(dt_in, dt_out) -Kadm_vals *dt_in; -u_char **dt_out; +int vals_to_stream(Kadm_vals *dt_in, u_char **dt_out) { int vsloop, stsize; /* loop counter, stream size */ @@ -75,29 +74,21 @@ u_char **dt_out; return(stsize); } -build_field_header(cont, st) -u_char *cont; /* container for fields data */ -u_char **st; /* stream */ +int build_field_header(u_char *cont, u_char **st) { *st = (u_char *) malloc (4); bcopy((char *) cont, (char *) *st, 4); return 4; /* return pointer to current stream location */ } -vts_string(dat, st, loc) -char *dat; /* a string to put on the stream */ -u_char **st; /* base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_string(char *dat, u_char **st, int loc) { *st = (u_char *) realloc ((char *)*st, (unsigned) (loc + strlen(dat) + 1)); bcopy(dat, (char *)(*st + loc), strlen(dat)+1); return strlen(dat)+1; } -vts_short(dat, st, loc) -u_short dat; /* the attributes field */ -u_char **st; /* a base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_short(u_short dat, u_char **st, int loc) { u_short temp; /* to hold the net order short */ @@ -107,10 +98,7 @@ int loc; /* offset into the stream for current data */ return sizeof(u_short); } -vts_long(dat, st, loc) -u_long dat; /* the attributes field */ -u_char **st; /* a base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_long(u_long dat, u_char **st, int loc) { u_long temp; /* to hold the net order short */ @@ -121,10 +109,7 @@ int loc; /* offset into the stream for current data */ } -vts_char(dat, st, loc) -u_char dat; /* the attributes field */ -u_char **st; /* a base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_char(u_char dat, u_char **st, int loc) { *st = (u_char *) realloc ((char *)*st, (unsigned)(loc + sizeof(u_char))); (*st)[loc] = (u_char) dat; @@ -138,10 +123,7 @@ stream_to_vals this decodes a byte stream represntation of a vals struct into kadm_vals */ -stream_to_vals(dt_in, dt_out, maxlen) -u_char *dt_in; -Kadm_vals *dt_out; -int maxlen; /* max length to use */ +int stream_to_vals(u_char *dt_in, Kadm_vals *dt_out, int maxlen) { register int vsloop, stsize; /* loop counter, stream size */ register int status; @@ -200,10 +182,7 @@ int maxlen; /* max length to use */ return stsize; } -check_field_header(st, cont, maxlen) -u_char *st; /* stream */ -u_char *cont; /* container for fields data */ -int maxlen; +int check_field_header(u_char *st, u_char *cont, int maxlen) { if (4 > maxlen) return(-1); @@ -211,12 +190,7 @@ int maxlen; return 4; /* return pointer to current stream location */ } -stv_string(st, dat, loc, stlen, maxlen) -register u_char *st; /* base pointer to the stream */ -char *dat; /* a string to read from the stream */ -register int loc; /* offset into the stream for current data */ -int stlen; /* max length of string to copy in */ -int maxlen; /* max length of input stream */ +int stv_string(u_char *st, char *dat, int loc, int stlen, int maxlen) { int maxcount; /* max count of chars to copy */ @@ -229,11 +203,7 @@ int maxlen; /* max length of input stream */ return strlen(dat)+1; } -stv_short(st, dat, loc, maxlen) -u_char *st; /* a base pointer to the stream */ -u_short *dat; /* the attributes field */ -int loc; /* offset into the stream for current data */ -int maxlen; +int stv_short(u_char *st, u_short *dat, int loc, int maxlen) { u_short temp; /* to hold the net order short */ @@ -244,11 +214,7 @@ int maxlen; return sizeof(u_short); } -stv_long(st, dat, loc, maxlen) -u_char *st; /* a base pointer to the stream */ -u_long *dat; /* the attributes field */ -int loc; /* offset into the stream for current data */ -int maxlen; /* maximum length of st */ +int stv_long(u_char *st, u_long *dat, int loc, int maxlen) { u_long temp; /* to hold the net order short */ @@ -259,15 +225,10 @@ int maxlen; /* maximum length of st */ return sizeof(u_long); } -stv_char(st, dat, loc, maxlen) -u_char *st; /* a base pointer to the stream */ -u_char *dat; /* the attributes field */ -int loc; /* offset into the stream for current data */ -int maxlen; +int stv_char(u_char *st, u_char *dat, int loc, int maxlen) { if (loc + 1 > maxlen) return(-1); *dat = *(st + loc); return 1; } - diff --git a/eBones/lib/libkadm/kadm_supp.c b/eBones/lib/libkadm/kadm_supp.c index 8b18621..deaf63b 100644 --- a/eBones/lib/libkadm/kadm_supp.c +++ b/eBones/lib/libkadm/kadm_supp.c @@ -7,14 +7,14 @@ * Support functions for Kerberos administration server & clients */ -#ifndef lint #if 0 +#ifndef lint static char rcsid_kadm_supp_c[] = "Header: /afs/athena.mit.edu/astaff/project/kerberos/src/lib/kadm/RCS/kadm_supp.c,v 4.1 89/09/26 09:21:07 jtkohl Exp "; -#endif static const char rcsid[] = - "$Id: kadm_supp.c,v 1.1 1995/01/20 02:02:54 wollman Exp $"; + "$Id: kadm_supp.c,v 1.1 1995/07/18 16:40:28 mark Exp $"; #endif lint +#endif /* kadm_supp.c @@ -26,6 +26,8 @@ static const char rcsid[] = structure */ +#include +#include #include "kadm.h" #include "krb_db.h" @@ -33,19 +35,17 @@ static const char rcsid[] = prin_vals: recieves : a vals structure */ -prin_vals(vals) -Kadm_vals *vals; +void prin_vals(Kadm_vals *vals) { printf("Info in Database for %s.%s:\n", vals->name, vals->instance); printf(" Max Life: %d Exp Date: %s\n",vals->max_life, asctime(localtime((long *)&vals->exp_date))); - printf(" Attribs: %.2x key: %u %u\n",vals->attributes, + printf(" Attribs: %.2x key: %lu %lu\n",vals->attributes, vals->key_low, vals->key_high); } #ifdef notdef -nierror(s) -int s; +int nierror(int s) { extern char *error_message(); printf("Kerberos admin server loses..... %s\n",error_message(s)); @@ -57,10 +57,7 @@ int s; it copies the fields in Principal specified by fields into Kadm_vals, i.e from old to new */ -kadm_prin_to_vals(fields, new, old) -u_char fields[FLDSZ]; -Kadm_vals *new; -Principal *old; +void kadm_prin_to_vals(u_char fields[], Kadm_vals *new, Principal *old) { bzero((char *)new, sizeof(*new)); if (IS_FIELD(KADM_NAME,fields)) { @@ -90,10 +87,7 @@ Principal *old; } } -kadm_vals_to_prin(fields, new, old) -u_char fields[FLDSZ]; -Principal *new; -Kadm_vals *old; +void kadm_vals_to_prin(u_char fields[], Principal *new, Kadm_vals *old) { bzero((char *)new, sizeof(*new)); diff --git a/eBones/lib/libkdb/Makefile b/eBones/lib/libkdb/Makefile index b69c0d9..42f4235 100644 --- a/eBones/lib/libkdb/Makefile +++ b/eBones/lib/libkdb/Makefile @@ -1,11 +1,11 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.3 1994/09/09 21:43:41 g89r4222 Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:37:10 mark Exp $ SHLIB_MAJOR= 2 SHLIB_MINOR= 0 LIB= kdb -CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include +CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -Wall SRCS= krb_cache.c krb_dbm.c krb_kdb_utils.c krb_lib.c print_princ.c .include diff --git a/eBones/lib/libkdb/krb_cache.c b/eBones/lib/libkdb/krb_cache.c index 8da1d7d..0dafb140 100644 --- a/eBones/lib/libkdb/krb_cache.c +++ b/eBones/lib/libkdb/krb_cache.c @@ -6,13 +6,15 @@ * This is where a cache would be implemented, if it were necessary. * * from: krb_cache.c,v 4.5 89/01/24 18:12:34 jon Exp $ - * $Id: krb_cache.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * $Id: krb_cache.c,v 1.3 1995/07/18 16:37:12 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_cache.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: krb_cache.c,v 1.3 1995/07/18 16:37:12 mark Exp $"; #endif lint +#endif #include #include @@ -25,8 +27,6 @@ static char rcsid[] = #include #include -extern char *strncpy(); - #ifdef DEBUG extern int debug; extern long kerb_debug; @@ -49,15 +49,10 @@ kerb_cache_init() */ int -kerb_cache_get_principal(serv, inst, principal, max) - char *serv; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - unsigned int max; /* max number of name structs to return */ - +kerb_cache_get_principal(char *serv, char *inst, Principal *principal, + unsigned int max) { int found = 0; - u_long i; if (!init) kerb_cache_init(); @@ -70,7 +65,7 @@ kerb_cache_get_principal(serv, inst, principal, max) #ifdef DEBUG if (kerb_debug & 2) { if (found) { - fprintf(stderr, "cache get %s %s found %s %s sid = %d\n", + fprintf(stderr, "cache get %s %s found %s %s\n", serv, inst, principal->name, principal->instance); } else { fprintf(stderr, "cache %s %s not found\n", serv, @@ -87,13 +82,8 @@ kerb_cache_get_principal(serv, inst, principal, max) */ int -kerb_cache_put_principal(principal, max) - Principal *principal; - unsigned int max; /* max number of principal structs to - * insert */ - +kerb_cache_put_principal(Principal *principal, unsigned int max) { - int found = 0; u_long i; int count = 0; @@ -125,15 +115,9 @@ kerb_cache_put_principal(principal, max) */ int -kerb_cache_get_dba(serv, inst, dba, max) - char *serv; /* could have wild card */ - char *inst; /* could have wild card */ - Dba *dba; - unsigned int max; /* max number of name structs to return */ - +kerb_cache_get_dba(char *serv, char *inst, Dba *dba, unsigned int max) { int found = 0; - u_long i; if (!init) kerb_cache_init(); @@ -147,7 +131,7 @@ kerb_cache_get_dba(serv, inst, dba, max) #ifdef DEBUG if (kerb_debug & 2) { if (found) { - fprintf(stderr, "cache get %s %s found %s %s sid = %d\n", + fprintf(stderr, "cache get %s %s found %s %s\n", serv, inst, dba->name, dba->instance); } else { fprintf(stderr, "cache %s %s not found\n", serv, inst); @@ -162,12 +146,8 @@ kerb_cache_get_dba(serv, inst, dba, max) */ int -kerb_cache_put_dba(dba, max) - Dba *dba; - unsigned int max; /* max number of dba structs to insert */ - +kerb_cache_put_dba(Dba *dba, unsigned int max) { - int found = 0; u_long i; int count = 0; @@ -190,4 +170,3 @@ kerb_cache_put_dba(dba, max) } return count; } - diff --git a/eBones/lib/libkdb/krb_dbm.c b/eBones/lib/libkdb/krb_dbm.c index c42df20..68f428b 100644 --- a/eBones/lib/libkdb/krb_dbm.c +++ b/eBones/lib/libkdb/krb_dbm.c @@ -4,19 +4,27 @@ * . * * from: krb_dbm.c,v 4.9 89/04/18 16:15:13 wesommer Exp $ - * $Id: krb_dbm.c,v 1.3 1995/05/30 06:40:38 rgrimes Exp $ - */ + * $Id: krb_dbm.c,v 1.4 1995/08/03 17:15:42 mark Exp $ +*/ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_dbm.c,v 1.3 1995/05/30 06:40:38 rgrimes Exp $"; +"$Id: krb_dbm.c,v 1.4 1995/08/03 17:15:42 mark Exp $"; #endif lint +#endif #if defined(__FreeBSD__) || defined(__NetBSD__) -#define NDBM +#define NDBM_ +#endif + +#if defined(__FreeBSD__) || defined(__NetBSD__) +#define DBM_ #endif #include +#include +#include #include #include #include @@ -27,17 +35,17 @@ static char rcsid[] = #include #include #include -#ifdef NDBM +#ifdef NDBM_ #include -#else /*NDBM*/ +#else /*NDBM_*/ #include -#endif /*NDBM*/ +#endif /*NDBM_*/ /* before krb_db.h */ #include #include #ifdef dbm_pagfno -#define DB +#define DBM_ #endif #define KERB_DB_MAX_RETRY 5 @@ -47,10 +55,8 @@ extern int debug; extern long kerb_debug; extern char *progname; #endif -extern char *malloc(); -extern int errno; -static init = 0; +static init = 0; static char default_db_name[] = DBM_FILE; static char *current_db_name = default_db_name; static void encode_princ_key(), decode_princ_key(); @@ -122,7 +128,7 @@ static int non_blocking = 0; * Instead, all routines call "dbm_next" instead. */ -#ifndef NDBM +#ifndef NDBM_ typedef char DBM; #define dbm_open(file, flags, mode) ((dbminit(file) == 0)?"":((char *)0)) @@ -139,9 +145,7 @@ typedef char DBM; * Utility routine: generate name of database file. */ -static char *gen_dbsuffix(db_name, sfx) - char *db_name; - char *sfx; +static char *gen_dbsuffix(char *db_name, char *sfx) { char *dbsuffix; @@ -158,7 +162,7 @@ static char *gen_dbsuffix(db_name, sfx) * initialization for data base routines. */ -kerb_db_init() +int kerb_db_init() { init = 1; return (0); @@ -169,7 +173,7 @@ kerb_db_init() * a kerb_db_init */ -kerb_db_fini() +void kerb_db_fini() { } @@ -180,8 +184,7 @@ kerb_db_fini() * If the alternate database doesn't exist, nothing is changed. */ -kerb_db_set_name(name) - char *name; +int kerb_db_set_name(char *name) { DBM *db; @@ -225,8 +228,7 @@ long kerb_get_db_age() * the server (for example, during slave updates). */ -static long kerb_start_update(db_name) - char *db_name; +static long kerb_start_update(char *db_name) { char *okname = gen_dbsuffix(db_name, ".ok"); long age = kerb_get_db_age(); @@ -239,9 +241,7 @@ static long kerb_start_update(db_name) return age; } -static long kerb_end_update(db_name, age) - char *db_name; - long age; +static long kerb_end_update(char *db_name, long age) { int fd; int retval = 0; @@ -281,8 +281,7 @@ static long kerb_start_read() return kerb_get_db_age(); } -static long kerb_end_read(age) - u_long age; +static long kerb_end_read(u_long age) { if (kerb_get_db_age() != age || age == -1) { return -1; @@ -294,13 +293,12 @@ static long kerb_end_read(age) * Create the database, assuming it's not there. */ -kerb_db_create(db_name) - char *db_name; +int kerb_db_create(char *db_name) { char *okname = gen_dbsuffix(db_name, ".ok"); int fd; register int ret = 0; -#ifdef NDBM +#ifdef NDBM_ DBM *db; db = dbm_open(db_name, O_RDWR|O_CREAT|O_EXCL, 0600); @@ -343,11 +341,10 @@ kerb_db_create(db_name) * necessarily know to complete the transaction the rename, but... */ -kerb_db_rename(from, to) - char *from; - char *to; +int kerb_db_rename(char *from, char *to) { -#ifdef DB + int ok = 0; +#ifdef DBM_ char *fromdb = gen_dbsuffix (from, ".db"); char *todb = gen_dbsuffix (to, ".db"); #else @@ -358,9 +355,8 @@ kerb_db_rename(from, to) #endif char *fromok = gen_dbsuffix(from, ".ok"); long trans = kerb_start_update(to); - int ok; -#ifdef DB +#ifdef DBM_ if (rename (fromdb, todb) == 0) { #else if ((rename (fromdir, todir) == 0) @@ -371,7 +367,7 @@ kerb_db_rename(from, to) } free (fromok); -#ifdef DB +#ifdef DBM_ free (fromdb); free (todb); #else @@ -389,15 +385,15 @@ kerb_db_rename(from, to) /* * look up a principal in the data base returns number of principals * found , and whether there were more than requested. + char *name could have wild card + char *inst could have wild card + Principal *principal + unsigned int max max number of name structs to return + int *more where there more than 'max' tuples? */ -kerb_db_get_principal(name, inst, principal, max, more) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - unsigned int max; /* max number of name structs to return */ - int *more; /* where there more than 'max' tuples? */ - +int kerb_db_get_principal(char *name, char *inst, Principal *principal, + unsigned int max, int *more) { int found = 0, code; extern int errorproc(); @@ -495,11 +491,7 @@ kerb_db_get_principal(name, inst, principal, max, more) * successfully updated. */ -kerb_db_put_principal(principal, max) - Principal *principal; - unsigned int max; /* number of principal structs to - * update */ - +int kerb_db_put_principal(Principal *principal, unsigned int max) { int found = 0, code; u_long i; @@ -544,9 +536,7 @@ kerb_db_put_principal(principal, max) } static void -encode_princ_key(key, name, instance) - datum *key; - char *name, *instance; +encode_princ_key(datum *key, char *name, char *instance) { static char keystring[ANAME_SZ + INST_SZ]; @@ -558,9 +548,7 @@ encode_princ_key(key, name, instance) } static void -decode_princ_key(key, name, instance) - datum *key; - char *name, *instance; +decode_princ_key(datum *key, char *name, char *instance) { strncpy(name, key->dptr, ANAME_SZ); strncpy(instance, key->dptr + ANAME_SZ, INST_SZ); @@ -569,24 +557,19 @@ decode_princ_key(key, name, instance) } static void -encode_princ_contents(contents, principal) - datum *contents; - Principal *principal; +encode_princ_contents(datum *contents, Principal *principal) { contents->dsize = sizeof(*principal); contents->dptr = (char *) principal; } static void -decode_princ_contents(contents, principal) - datum *contents; - Principal *principal; +decode_princ_contents(datum *contents, Principal *principal) { bcopy(contents->dptr, (char *) principal, sizeof(*principal)); } -kerb_db_get_stat(s) - DB_stat *s; +void kerb_db_get_stat(DB_stat *s) { gettimeofday(×tamp, NULL); @@ -604,13 +587,11 @@ kerb_db_get_stat(s) /* update local copy too */ } -kerb_db_put_stat(s) - DB_stat *s; +void kerb_db_put_stat(DB_stat *s) { } -delta_stat(a, b, c) - DB_stat *a, *b, *c; +void delta_stat(DB_stat *a, DB_stat *b, DB_stat *c) { /* c = a - b then b = a for the next time */ @@ -626,7 +607,6 @@ delta_stat(a, b, c) c->n_put_stat = a->n_put_stat - b->n_put_stat; bcopy(a, b, sizeof(DB_stat)); - return; } /* @@ -634,21 +614,14 @@ delta_stat(a, b, c) * whether there were more than requested. */ -kerb_db_get_dba(dba_name, dba_inst, dba, max, more) - char *dba_name; /* could have wild card */ - char *dba_inst; /* could have wild card */ - Dba *dba; - unsigned int max; /* max number of name structs to return */ - int *more; /* where there more than 'max' tuples? */ - +int kerb_db_get_dba(char *dba_name, char *dba_inst, Dba *dba, unsigned int max, + int *more) { *more = 0; return (0); } -kerb_db_iterate (func, arg) - int (*func)(); - char *arg; /* void *, really */ +int kerb_db_iterate (int (*func)(), char *arg) { datum key, contents; Principal *principal; @@ -677,7 +650,7 @@ static int dblfd = -1; static int mylock = 0; static int inited = 0; -static kerb_dbl_init() +static int kerb_dbl_init() { if (!inited) { char *filename = gen_dbsuffix (current_db_name, ".ok"); @@ -701,8 +674,7 @@ static void kerb_dbl_fini() mylock = 0; } -static int kerb_dbl_lock(mode) - int mode; +static int kerb_dbl_lock(int mode) { int flock_mode; @@ -750,8 +722,7 @@ static void kerb_dbl_unlock() mylock = 0; } -int kerb_db_set_lockmode(mode) - int mode; +int kerb_db_set_lockmode(int mode) { int old = non_blocking; non_blocking = mode; diff --git a/eBones/lib/libkdb/krb_kdb_utils.c b/eBones/lib/libkdb/krb_kdb_utils.c index c283e0f..275cc39 100644 --- a/eBones/lib/libkdb/krb_kdb_utils.c +++ b/eBones/lib/libkdb/krb_kdb_utils.c @@ -10,25 +10,27 @@ * Jon Rochlis, MIT Telecom, March 1988 * * from: krb_kdb_utils.c,v 4.1 89/07/26 11:01:12 jtkohl Exp $ - * $Id: krb_kdb_utils.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * $Id: krb_kdb_utils.c,v 1.3 1995/07/18 16:37:15 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_kdb_utils.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: krb_kdb_utils.c,v 1.3 1995/07/18 16:37:15 mark Exp $"; #endif lint +#endif -#include +#include +#include +#include +#include +#include #include #include #include -#include -#include -long kdb_get_master_key(prompt, master_key, master_key_sched) - int prompt; - C_Block master_key; - Key_schedule master_key_sched; +long kdb_get_master_key(int prompt, C_Block master_key, + Key_schedule master_key_sched) { int kfile; @@ -37,7 +39,7 @@ long kdb_get_master_key(prompt, master_key, master_key_sched) placebo_read_password(master_key, "\nEnter Kerberos master key: ", 0); #else - des_read_password(master_key, + des_read_password((C_Block *)master_key, "\nEnter Kerberos master key: ", 0); #endif printf ("\n"); @@ -55,20 +57,33 @@ long kdb_get_master_key(prompt, master_key, master_key_sched) } #ifndef NOENCRYPTION - key_sched(master_key,master_key_sched); + key_sched((C_Block *)master_key,master_key_sched); #endif return (0); } +/* The old algorithm used the key schedule as the initial vector which + was byte order depedent ... */ + +void kdb_encrypt_key (C_Block in, C_Block out, C_Block master_key, + Key_schedule master_key_sched, int e_d_flag) +{ + +#ifdef NOENCRYPTION + bcopy(in, out, sizeof(C_Block)); +#else + pcbc_encrypt((C_Block *)in,(C_Block *)out,(long)sizeof(C_Block), + master_key_sched,(C_Block *)master_key, e_d_flag); +#endif +} + /* The caller is reasponsible for cleaning up the master key and sched, even if we can't verify the master key */ /* Returns master key version if successful, otherwise -1 */ -long kdb_verify_master_key (master_key, master_key_sched, out) - C_Block master_key; - Key_schedule master_key_sched; - FILE *out; /* setting this to non-null be do output */ +long kdb_verify_master_key (C_Block master_key, Key_schedule master_key_sched, + FILE *out) { C_Block key_from_db; Principal principal_data[1]; @@ -122,20 +137,3 @@ long kdb_verify_master_key (master_key, master_key_sched, out) return (master_key_version); } - -/* The old algorithm used the key schedule as the initial vector which - was byte order depedent ... */ - -kdb_encrypt_key (in, out, master_key, master_key_sched, e_d_flag) - C_Block in, out, master_key; - Key_schedule master_key_sched; - int e_d_flag; -{ - -#ifdef NOENCRYPTION - bcopy(in, out, sizeof(C_Block)); -#else - pcbc_encrypt(in,out,(long)sizeof(C_Block),master_key_sched,master_key, - e_d_flag); -#endif -} diff --git a/eBones/lib/libkdb/krb_lib.c b/eBones/lib/libkdb/krb_lib.c index b90d1a5..5610dbb 100644 --- a/eBones/lib/libkdb/krb_lib.c +++ b/eBones/lib/libkdb/krb_lib.c @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kdb/krb_lib.c,v $ - * $Author: csgr $ + * $Source: /usr/cvs/src/eBones/kdb/krb_lib.c,v $ + * $Author: mark $ * * Copyright 1988 by the Massachusetts Institute of Technology. * @@ -8,12 +8,15 @@ * . */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_lib.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: krb_lib.c,v 1.3 1995/07/18 16:37:17 mark Exp $"; #endif lint +#endif #include +#include #include #include #include @@ -30,10 +33,6 @@ extern char *progname; long kerb_debug; #endif -extern char *strncpy(); -extern char *ctime(); -extern char *getenv(); - static init = 0; /* @@ -47,7 +46,7 @@ kerb_init() if (!init) { char *dbg = getenv("KERB_DBG"); if (dbg) - sscanf(dbg, "%d", &kerb_debug); + sscanf(dbg, "%ld", &kerb_debug); init = 1; } #endif @@ -67,7 +66,7 @@ kerb_init() * caches, if they're ever really implemented. */ -int +void kerb_fini() { kerb_db_fini(); @@ -79,13 +78,8 @@ kerb_fini() */ int -kerb_get_principal(name, inst, principal, max, more) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Principal *principal; - unsigned int max; /* max number of name structs to return */ - int *more; /* more tuples than room for */ - +kerb_get_principal(char *name, char *inst, Principal *principal, + unsigned int max, int *more) { int found = 0; #ifdef CACHE @@ -137,9 +131,7 @@ kerb_get_principal(name, inst, principal, max, more) } /* principals */ -kerb_put_principal(principal, n) - Principal *principal; - unsigned int n; /* number of principal structs to write */ +int kerb_put_principal(Principal *principal, unsigned int n) { long time(); struct tm *tp, *localtime(); @@ -184,13 +176,7 @@ kerb_put_principal(principal, n) } int -kerb_get_dba(name, inst, dba, max, more) - char *name; /* could have wild card */ - char *inst; /* could have wild card */ - Dba *dba; - unsigned int max; /* max number of name structs to return */ - int *more; /* more tuples than room for */ - +kerb_get_dba(char *name, char *inst, Dba *dba, unsigned int max, int *more) { int found = 0; #ifdef CACHE diff --git a/eBones/lib/libkdb/print_princ.c b/eBones/lib/libkdb/print_princ.c index d04ca39..b1d1ca9 100644 --- a/eBones/lib/libkdb/print_princ.c +++ b/eBones/lib/libkdb/print_princ.c @@ -3,14 +3,16 @@ * For copying and distribution information, please see the file * . * - * from: $Header: /home/ncvs/src/eBones/kdb/print_princ.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ - * $Id: print_princ.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $ + * from: $Header: /usr/cvs/src/eBones/kdb/print_princ.c,v 1.3 1995/07/18 16:37:19 mark Exp $ + * $Id: print_princ.c,v 1.3 1995/07/18 16:37:19 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: print_princ.c,v 1.1.1.1 1994/09/30 14:49:55 csgr Exp $"; +"$Id: print_princ.c,v 1.3 1995/07/18 16:37:19 mark Exp $"; #endif lint +#endif #include #include @@ -20,15 +22,11 @@ static char rcsid[] = #include extern int debug; -extern char *strncpy(); -extern char *ctime(); -extern struct tm *localtime(); -struct tm *time_p; long kerb_debug; +static struct tm *time_p; -krb_print_principal(a_n) - Principal *a_n; +void krb_print_principal(Principal *a_n) { /* run-time database does not contain string versions */ time_p = localtime(&(a_n->exp_date)); @@ -42,9 +40,9 @@ krb_print_principal(a_n) a_n->max_life, 5 * a_n->max_life, a_n->attributes); fprintf(stderr, - "\n\tkey_ver %d k_low 0x%08x k_high 0x%08x akv %d exists %d\n", + "\n\tkey_ver %d k_low 0x%08lx k_high 0x%08lx akv %d exists %d\n", a_n->key_version, a_n->key_low, a_n->key_high, - a_n->kdc_key_ver, a_n->old); + a_n->kdc_key_ver, (int)a_n->old); fflush(stderr); } diff --git a/eBones/lib/libkrb/Makefile b/eBones/lib/libkrb/Makefile index 205b024..10ef4ba 100644 --- a/eBones/lib/libkrb/Makefile +++ b/eBones/lib/libkrb/Makefile @@ -1,10 +1,10 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.4 1995/01/20 01:12:19 wollman Exp $ +# $Id: Makefile,v 1.5 1995/07/18 16:38:02 mark Exp $ LIB= krb SHLIB_MAJOR= 2 SHLIB_MINOR= 0 -CFLAGS+=-DKERBEROS -DCRYPT -DDEBUG -I${.CURDIR}/../include -DBSD42 +CFLAGS+=-DKERBEROS -DCRYPT -DDEBUG -I${.CURDIR}/../include -DBSD42 -Wall SRCS= krb_err.c create_auth_reply.c create_ciph.c \ create_death_packet.c create_ticket.c debug_decl.c decomp_ticket.c \ des_rw.c dest_tkt.c extract_ticket.c fgetst.c get_ad_tkt.c \ diff --git a/eBones/lib/libkrb/add_ticket.c b/eBones/lib/libkrb/add_ticket.c index cb79a18..bec7cd8 100644 --- a/eBones/lib/libkrb/add_ticket.c +++ b/eBones/lib/libkrb/add_ticket.c @@ -5,13 +5,15 @@ * . * * from: add_ticket.c,v 4.7 88/10/07 06:06:26 shanzer Exp $ - * $Id: add_ticket.c,v 1.2 1994/07/19 19:24:54 g89r4222 Exp $ + * $Id: add_ticket.c,v 1.3 1995/07/18 16:38:04 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: add_ticket.c,v 1.2 1994/07/19 19:24:54 g89r4222 Exp $"; +"$Id: add_ticket.c,v 1.3 1995/07/18 16:38:04 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/lib/libkrb/create_auth_reply.c b/eBones/lib/libkrb/create_auth_reply.c index bfc3cfe..ea3afd6 100644 --- a/eBones/lib/libkrb/create_auth_reply.c +++ b/eBones/lib/libkrb/create_auth_reply.c @@ -5,14 +5,17 @@ * . * * from: create_auth_reply.c,v 4.10 89/01/13 17:47:38 steiner Exp $ - * $Id: create_auth_reply.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_auth_reply.c,v 1.3 1995/07/18 16:38:06 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_auth_reply.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_auth_reply.c,v 1.3 1995/07/18 16:38:06 mark Exp $"; #endif /* lint */ +#endif +#include #include #include #include diff --git a/eBones/lib/libkrb/create_ciph.c b/eBones/lib/libkrb/create_ciph.c index 634d371..a383604 100644 --- a/eBones/lib/libkrb/create_ciph.c +++ b/eBones/lib/libkrb/create_ciph.c @@ -5,13 +5,15 @@ * . * * from: create_ciph.c,v 4.8 89/05/18 21:24:26 jis Exp $ - * $Id: create_ciph.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_ciph.c,v 1.3 1995/07/18 16:38:07 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_ciph.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_ciph.c,v 1.3 1995/07/18 16:38:07 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -54,18 +56,9 @@ static char *rcsid = * */ -create_ciph(c, session, service, instance, realm, life, kvno, tkt, - kdc_time, key) - KTEXT c; /* Text block to hold ciphertext */ - C_Block session; /* Session key to send to user */ - char *service; /* Service name on ticket */ - char *instance; /* Instance name on ticket */ - char *realm; /* Realm of this KDC */ - unsigned long life; /* Lifetime of the ticket */ - int kvno; /* Key version number for service */ - KTEXT tkt; /* The ticket for the service */ - unsigned long kdc_time; /* KDC time */ - C_Block key; /* Key to encrypt ciphertext with */ +int create_ciph(KTEXT c, des_cblock session, char *service, char *instance, + char *realm, unsigned long life, int kvno, KTEXT tkt, + unsigned long kdc_time, des_cblock key) { char *ptr; Key_schedule key_s; @@ -100,9 +93,9 @@ create_ciph(c, session, service, instance, realm, life, kvno, tkt, c->length = (((ptr - (char *) c->dat) + 7) / 8) * 8; #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)c->dat,(C_Block *)c->dat,(long) c->length,key_s, - key,ENCRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)c->dat,(des_cblock *)c->dat,(long) c->length, + key_s,(des_cblock *)key,ENCRYPT); #endif /* NOENCRYPTION */ return(KSUCCESS); diff --git a/eBones/lib/libkrb/create_death_packet.c b/eBones/lib/libkrb/create_death_packet.c index 080e8a8..bdc0e34 100644 --- a/eBones/lib/libkrb/create_death_packet.c +++ b/eBones/lib/libkrb/create_death_packet.c @@ -5,13 +5,15 @@ * . * * from: create_death_packet.c,v 4.9 89/01/17 16:05:59 rfrench Exp $ - * $Id: create_death_packet.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_death_packet.c,v 1.3 1995/07/18 16:38:09 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_death_packet.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_death_packet.c,v 1.3 1995/07/18 16:38:09 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/lib/libkrb/create_ticket.c b/eBones/lib/libkrb/create_ticket.c index 95d5ced..264d1ac 100644 --- a/eBones/lib/libkrb/create_ticket.c +++ b/eBones/lib/libkrb/create_ticket.c @@ -5,13 +5,15 @@ * . * * from: create_ticket.c,v 4.11 89/03/22 14:43:23 jtkohl Exp $ - * $Id: create_ticket.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_ticket.c,v 1.3 1995/07/18 16:38:12 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: create_ticket.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_ticket.c,v 1.3 1995/07/18 16:38:12 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -68,20 +70,9 @@ static char rcsid[] = * */ -int krb_create_ticket(tkt, flags, pname, pinstance, prealm, paddress, - session, life, time_sec, sname, sinstance, key) - KTEXT tkt; /* Gets filled in by the ticket */ - unsigned char flags; /* Various Kerberos flags */ - char *pname; /* Principal's name */ - char *pinstance; /* Principal's instance */ - char *prealm; /* Principal's authentication domain */ - long paddress; /* Net address of requesting entity */ - char *session; /* Session key inserted in ticket */ - short life; /* Lifetime of the ticket */ - long time_sec; /* Issue time and date */ - char *sname; /* Service Name */ - char *sinstance; /* Instance Name */ - C_Block key; /* Service's secret key */ +int krb_create_ticket(KTEXT tkt, unsigned char flags, char *pname, + char *pinstance, char *prealm, long paddress, char *session, short life, + long time_sec, char *sname, char *sinstance, des_cblock key) { Key_schedule key_s; register char *data; /* running index into ticket */ @@ -122,9 +113,9 @@ int krb_create_ticket(tkt, flags, pname, pinstance, prealm, paddress, } #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,(long)tkt->length, - key_s,key,ENCRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)tkt->dat,(des_cblock *)tkt->dat, + (long)tkt->length,key_s,(des_cblock *)key,ENCRYPT); #endif return 0; } diff --git a/eBones/lib/libkrb/debug_decl.c b/eBones/lib/libkrb/debug_decl.c index 1a0f6df..f548e2a 100644 --- a/eBones/lib/libkrb/debug_decl.c +++ b/eBones/lib/libkrb/debug_decl.c @@ -4,13 +4,15 @@ * . * * from: debug_decl.c,v 4.5 88/10/07 06:07:49 shanzer Exp $ - * $Id: debug_decl.c,v 1.2 1994/07/19 19:25:03 g89r4222 Exp $ + * $Id: debug_decl.c,v 1.3 1995/07/18 16:38:14 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: debug_decl.c,v 1.2 1994/07/19 19:25:03 g89r4222 Exp $"; +"$Id: debug_decl.c,v 1.3 1995/07/18 16:38:14 mark Exp $"; #endif lint +#endif /* Declare global debugging variables. */ diff --git a/eBones/lib/libkrb/decomp_ticket.c b/eBones/lib/libkrb/decomp_ticket.c index 181864c..ab46450 100644 --- a/eBones/lib/libkrb/decomp_ticket.c +++ b/eBones/lib/libkrb/decomp_ticket.c @@ -5,13 +5,15 @@ * . * * from: decomp_ticket.c,v 4.12 89/05/16 18:44:46 jtkohl Exp $ - * $Id: decomp_ticket.c,v 1.2 1994/07/19 19:25:05 g89r4222 Exp $ + * $Id: decomp_ticket.c,v 1.3 1995/07/18 16:38:15 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: decomp_ticket.c,v 1.2 1994/07/19 19:25:05 g89r4222 Exp $"; +"$Id: decomp_ticket.c,v 1.3 1995/07/18 16:38:15 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -44,31 +46,18 @@ static char *rcsid = * See create_ticket.c for the format of the ticket packet. */ -decomp_ticket(tkt, flags, pname, pinstance, prealm, paddress, session, - life, time_sec, sname, sinstance, key, key_s) - KTEXT tkt; /* The ticket to be decoded */ - unsigned char *flags; /* Kerberos ticket flags */ - char *pname; /* Authentication name */ - char *pinstance; /* Principal's instance */ - char *prealm; /* Principal's authentication domain */ - unsigned long *paddress; /* Net address of entity - * requesting ticket */ - C_Block session; /* Session key inserted in ticket */ - int *life; /* Lifetime of the ticket */ - unsigned long *time_sec; /* Issue time and date */ - char *sname; /* Service name */ - char *sinstance; /* Service instance */ - C_Block key; /* Service's secret key - * (to decrypt the ticket) */ - Key_schedule key_s; /* The precomputed key schedule */ +int decomp_ticket(KTEXT tkt, unsigned char *flags, char *pname, + char *pinstance, char *prealm, unsigned long *paddress, des_cblock session, + int *life, unsigned long *time_sec, char *sname, char *sinstance, + des_cblock key, des_key_schedule key_s) { static int tkt_swap_bytes; unsigned char *uptr; char *ptr = (char *)tkt->dat; #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,(long)tkt->length, - key_s,key,DECRYPT); + pcbc_encrypt((des_cblock *)tkt->dat,(des_cblock *)tkt->dat, + (long)tkt->length,key_s,(des_cblock *)key,DECRYPT); #endif /* ! NOENCRYPTION */ *flags = *ptr; /* get flags byte */ diff --git a/eBones/lib/libkrb/des_rw.c b/eBones/lib/libkrb/des_rw.c index e5acb39..774e62b 100644 --- a/eBones/lib/libkrb/des_rw.c +++ b/eBones/lib/libkrb/des_rw.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: des_rw.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: des_rw.c,v 1.6 1995/07/18 16:38:17 mark Exp $ */ /* @@ -100,18 +100,11 @@ #include #include -#include -#include - -extern int krb_net_read(int fd, void * data, size_t length); -extern int des_pcbc_encrypt(des_cblock *input, des_cblock *output, - register long length, - des_key_schedule schedule, - des_cblock *ivec, - int encrypt); +#include +#include static bit_64 des_key; -static des_key_schedule key_sched; +static des_key_schedule key_schedule; /* * Buffer for storing extra data when more data is received, then was @@ -127,12 +120,10 @@ static u_char *buff_ptr = buffer; * inkey is the initial vector for the DES encryption, while insched is * the DES key, in unwrapped form. */ -void des_set_key(inkey, insched) - bit_64 *inkey; - u_char *insched; +void des_set_key(bit_64 *inkey, u_char *insched) { bcopy(inkey, &des_key, sizeof(bit_64)); - bcopy(insched, &key_sched, sizeof(des_key_schedule)); + bcopy(insched, &key_schedule, sizeof(des_key_schedule)); } /* @@ -142,13 +133,10 @@ void des_set_key(inkey, insched) void des_clear_key() { bzero(&des_key, sizeof(des_cblock)); - bzero(&key_sched, sizeof(des_key_schedule)); + bzero(&key_schedule, sizeof(des_key_schedule)); } -int des_read(fd, buf, len) - int fd; - register char * buf; - int len; +int des_read(int fd, char *buf, int len) { int msg_length; /* length of actual message data */ int pad_length; /* length of padded message */ @@ -173,7 +161,7 @@ int des_read(fd, buf, len) } } - nread = krb_net_read(fd, &msg_length, sizeof(msg_length)); + nread = krb_net_read(fd,(char *)&msg_length, sizeof(msg_length)); if(nread != (int)(sizeof(msg_length))) return(0); @@ -186,7 +174,7 @@ int des_read(fd, buf, len) des_pcbc_encrypt((des_cblock*) des_buff, (des_cblock*) buff_ptr, (msg_length < 8 ? 8 : msg_length), - key_sched, (des_cblock*) &des_key, DES_DECRYPT); + key_schedule, (des_cblock*) &des_key, DES_DECRYPT); if(msg_length < 8) @@ -212,17 +200,13 @@ int des_read(fd, buf, len) * Write a message onto a file descriptor (generally a socket), using * DES to encrypt the message. */ -int des_write(fd, buf, len) - int fd; - char * buf; - int len; +int des_write(int fd, char *buf, int len) { static int seeded = 0; char garbage[8]; long rnd; int pad_len; int write_len; - int nwritten = 0; int i; char *data; @@ -249,7 +233,7 @@ int des_write(fd, buf, len) } des_pcbc_encrypt((des_cblock*) data, (des_cblock*) des_buff, - (len < 8)?8:len, key_sched, (des_cblock*) &des_key, DES_ENCRYPT); + (len < 8)?8:len, key_schedule, (des_cblock*) &des_key, DES_ENCRYPT); write_len = htonl(len); diff --git a/eBones/lib/libkrb/dest_tkt.c b/eBones/lib/libkrb/dest_tkt.c index 6a06454..6e6082e 100644 --- a/eBones/lib/libkrb/dest_tkt.c +++ b/eBones/lib/libkrb/dest_tkt.c @@ -5,15 +5,20 @@ * . * * from: dest_tkt.c,v 4.9 89/10/02 16:23:07 jtkohl Exp $ - * $Id: dest_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: dest_tkt.c,v 1.3 1995/07/18 16:38:19 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: dest_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: dest_tkt.c,v 1.3 1995/07/18 16:38:19 mark Exp $"; #endif /* lint */ +#endif #include +#include +#include +#include #include #include #include @@ -32,7 +37,7 @@ static char *rcsid = * The ticket file (TKT_FILE) is defined in "krb.h". */ -dest_tkt() +int dest_tkt() { char *file = TKT_FILE; int i,fd; diff --git a/eBones/lib/libkrb/extract_ticket.c b/eBones/lib/libkrb/extract_ticket.c index 571d5da..97e8432 100644 --- a/eBones/lib/libkrb/extract_ticket.c +++ b/eBones/lib/libkrb/extract_ticket.c @@ -5,13 +5,15 @@ * . * * from: extract_ticket.c,v 4.6 88/10/07 06:08:15 shanzer Exp $ - * $Id: extract_ticket.c,v 1.2 1994/07/19 19:25:08 g89r4222 Exp $ + * $Id: extract_ticket.c,v 1.3 1995/07/18 16:38:21 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: extract_ticket.c,v 1.2 1994/07/19 19:25:08 g89r4222 Exp $"; +"$Id: extract_ticket.c,v 1.3 1995/07/18 16:38:21 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -25,14 +27,8 @@ static char *rcsid = * session, liftime and kvno. */ -extract_ticket(cipher,n,session,lifetime,kvno,realm,ticket) - KTEXT cipher; /* The ciphertext */ - int n; /* Which ticket */ - char *session; /* The session key for this tkt */ - int *lifetime; /* The life of this ticket */ - int *kvno; /* The kvno for the service */ - char *realm; /* Realm in which tkt issued */ - KTEXT ticket; /* The ticket itself */ +void extract_ticket(KTEXT cipher, int n, char *session, int *lifetime, + int *kvno, char *realm, KTEXT ticket) { char *ptr; int i; diff --git a/eBones/lib/libkrb/fgetst.c b/eBones/lib/libkrb/fgetst.c index b855541..4c6a364 100644 --- a/eBones/lib/libkrb/fgetst.c +++ b/eBones/lib/libkrb/fgetst.c @@ -4,13 +4,15 @@ * . * * from: fgetst.c,v 4.0 89/01/23 10:08:31 jtkohl Exp $ - * $Id: fgetst.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: fgetst.c,v 1.3 1995/07/18 16:38:23 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: fgetst.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: fgetst.c,v 1.3 1995/07/18 16:38:23 mark Exp $"; #endif /* lint */ +#endif #include @@ -23,10 +25,7 @@ static char rcsid[] = * returns the number of characters read, including the null terminator. */ -fgetst(f, s, n) - FILE *f; - register char *s; - int n; +int fgetst(FILE *f, char *s, int n) { register count = n; int ch; /* NOT char; otherwise you don't see EOF */ diff --git a/eBones/lib/libkrb/get_ad_tkt.c b/eBones/lib/libkrb/get_ad_tkt.c index 1c14d3c..ad76a4f 100644 --- a/eBones/lib/libkrb/get_ad_tkt.c +++ b/eBones/lib/libkrb/get_ad_tkt.c @@ -5,13 +5,15 @@ * . * * from: get_ad_tkt.c,v 4.15 89/07/07 15:18:51 jtkohl Exp $ - * $Id: get_ad_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: get_ad_tkt.c,v 1.3 1995/07/18 16:38:25 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_ad_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: get_ad_tkt.c,v 1.3 1995/07/18 16:38:25 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -25,8 +27,6 @@ static char rcsid[] = #include #include -extern int krb_debug; - struct timeval tt_local = { 0, 0 }; int swap_bytes; @@ -65,11 +65,7 @@ unsigned long rep_err_code; * extraction macros like pkt_version(), pkt_msg_type(), etc. */ -get_ad_tkt(service,sinstance,realm,lifetime) - char *service; - char *sinstance; - char *realm; - int lifetime; +int get_ad_tkt(char *service, char *sinstance, char *realm, int lifetime) { static KTEXT_ST pkt_st; KTEXT pkt = & pkt_st; /* Packet to KDC */ @@ -150,7 +146,7 @@ get_ad_tkt(service,sinstance,realm,lifetime) rpkt->length = 0; /* Send the request to the local ticket-granting server */ - if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); + if ((kerror = send_to_kdc(pkt, rpkt, realm))) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION ) @@ -181,9 +177,9 @@ get_ad_tkt(service,sinstance,realm,lifetime) bcopy((char *) pkt_cipher(rpkt),(char *) (cip->dat),cip->length); #ifndef NOENCRYPTION - key_sched(cr.session,key_s); - pcbc_encrypt((C_Block *)cip->dat,(C_Block *)cip->dat,(long)cip->length, - key_s,cr.session,DECRYPT); + key_sched((des_cblock *)cr.session,key_s); + pcbc_encrypt((des_cblock *)cip->dat,(des_cblock *)cip->dat, + (long)cip->length,key_s,(des_cblock *)cr.session,DECRYPT); #endif /* Get rid of all traces of key */ bzero((char *) cr.session, sizeof(key)); @@ -226,8 +222,8 @@ get_ad_tkt(service,sinstance,realm,lifetime) code */ } - if (kerror = save_credentials(s_name,s_instance,rlm,ses,lifetime, - kvno,tkt,tt_local.tv_sec)) + if ((kerror = save_credentials(s_name,s_instance,rlm,ses,lifetime, + kvno,tkt,tt_local.tv_sec))) return(kerror); return(AD_OK); diff --git a/eBones/lib/libkrb/get_admhst.c b/eBones/lib/libkrb/get_admhst.c index c36e997..b33b828 100644 --- a/eBones/lib/libkrb/get_admhst.c +++ b/eBones/lib/libkrb/get_admhst.c @@ -5,13 +5,15 @@ * . * * from: get_admhst.c,v 4.0 89/01/23 10:08:55 jtkohl Exp $ - * $Id: get_admhst.c,v 1.2 1994/07/19 19:25:13 g89r4222 Exp $ + * $Id: get_admhst.c,v 1.3 1995/07/18 16:38:27 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_admhst.c,v 1.2 1994/07/19 19:25:13 g89r4222 Exp $"; +"$Id: get_admhst.c,v 1.3 1995/07/18 16:38:27 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -37,10 +39,7 @@ static char *rcsid = * provided by a nameserver. */ -krb_get_admhst(h, r, n) - char *h; - char *r; - int n; +int krb_get_admhst(char *h, char *r, int n) { FILE *cnffile; char tr[REALM_SZ]; diff --git a/eBones/lib/libkrb/get_cred.c b/eBones/lib/libkrb/get_cred.c index 6eb63f6..14e1cc1 100644 --- a/eBones/lib/libkrb/get_cred.c +++ b/eBones/lib/libkrb/get_cred.c @@ -5,13 +5,15 @@ * . * * from: get_cred.c,v 4.10 89/05/31 17:46:22 jtkohl Exp $ - * $Id: get_cred.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_cred.c,v 1.3 1995/07/18 16:38:28 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_cred.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_cred.c,v 1.3 1995/07/18 16:38:28 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -25,11 +27,7 @@ static char *rcsid = * On failure it returns a Kerberos error code. */ -krb_get_cred(service,instance,realm,c) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - CREDENTIALS *c; /* Credentials struct */ +int krb_get_cred(char *service, char *instance, char *realm, CREDENTIALS *c) { int tf_status; /* return value of tf function calls */ diff --git a/eBones/lib/libkrb/get_in_tkt.c b/eBones/lib/libkrb/get_in_tkt.c index 00fc57a..79758f6 100644 --- a/eBones/lib/libkrb/get_in_tkt.c +++ b/eBones/lib/libkrb/get_in_tkt.c @@ -4,20 +4,22 @@ * . * * from: get_in_tkt.c,v 4.12 89/07/18 16:32:56 jtkohl Exp $ - * $Id: get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $"; #endif /* lint */ +#endif #include #include +#include +#include "conf.h" -#ifndef NULL -#define NULL 0 -#endif +#include /* * This file contains two routines: passwd_to_key() converts @@ -42,18 +44,17 @@ static char rcsid[] = */ /*ARGSUSED */ -static int passwd_to_key(user,instance,realm,passwd,key) - char *user, *instance, *realm, *passwd; - C_Block key; +static int passwd_to_key(char *user, char *instance, char *realm, + char *passwd, des_cblock key) { #ifdef NOENCRYPTION if (!passwd) placebo_read_password(key, "Password: ", 0); #else if (passwd) - string_to_key(passwd,key); + string_to_key(passwd,(des_cblock *)key); else - des_read_password(key,"Password: ",0); + des_read_password((des_cblock *)key,"Password: ",0); #endif return (0); } @@ -75,10 +76,8 @@ static int passwd_to_key(user,instance,realm,passwd,key) * The result of the call to krb_get_in_tkt() is returned. */ -krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) - char *user, *instance, *realm, *service, *sinstance; - int life; - char *password; +int krb_get_pw_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, char *password) { return(krb_get_in_tkt(user,instance,realm,service,sinstance,life, passwd_to_key, NULL, password)); @@ -86,8 +85,8 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) #ifdef NOENCRYPTION /* - * $Source: /home/ncvs/src/eBones/krb/get_in_tkt.c,v $ - * $Author: csgr $ + * $Source: /usr/cvs/src/eBones/krb/get_in_tkt.c,v $ + * $Author: mark $ * * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute * of Technology. @@ -100,41 +99,16 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) * echoing. */ +#if 0 #ifndef lint static char rcsid_read_password_c[] = -"Bones$Header: /home/ncvs/src/eBones/krb/get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"Bones$Header: /usr/cvs/src/eBones/krb/get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $"; #endif lint - -#include -#include "conf.h" - -#include -#ifdef BSDUNIX -#include -#include -#include -#include -#else -char *strcpy(); -int strcmp(); #endif -#ifdef BSDUNIX -static jmp_buf env; -#endif - -#ifdef BSDUNIX -static void sig_restore(); -static push_signals(), pop_signals(); -int placebo_read_pw_string(); -#endif /*** Routines ****************************************************** */ -int -placebo_read_password(k,prompt,verify) - des_cblock *k; - char *prompt; - int verify; +int placebo_read_password(des_cblock *k, char *prompt, int verify) { int ok; char key_string[BUFSIZ]; @@ -161,8 +135,7 @@ lose: * Returns 0 on success, non-zero on failure. */ -int -placebo_read_pw_string(s,max,prompt,verify) +int placebo_read_pw_string(char *s, int max, char *prompt, int verify) char *s; int max; char *prompt; @@ -264,23 +237,21 @@ static void (*old_sigfunc[NSIG])(); static int (*old_sigfunc[NSIG])(); #endif POSIX -static push_signals() +static void push_signals() { register i; for (i = 0; i < NSIG; i++) old_sigfunc[i] = signal(i,sig_restore); } -static pop_signals() +static void pop_signals() { register i; for (i = 0; i < NSIG; i++) signal(i,old_sigfunc[i]); } -static void sig_restore(sig,code,scp) - int sig,code; - struct sigcontext *scp; +static void sig_restore(int sig, int code, struct sigcontext *scp) { longjmp(env,1); } diff --git a/eBones/lib/libkrb/get_krbhst.c b/eBones/lib/libkrb/get_krbhst.c index bb1ea50..ab3abbd 100644 --- a/eBones/lib/libkrb/get_krbhst.c +++ b/eBones/lib/libkrb/get_krbhst.c @@ -5,13 +5,15 @@ * . * * from: get_krbhst.c,v 4.8 89/01/22 20:00:29 rfrench Exp $ - * $Id: get_krbhst.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_krbhst.c,v 1.3 1995/07/18 16:38:32 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_krbhst.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_krbhst.c,v 1.3 1995/07/18 16:38:32 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -48,10 +50,7 @@ static char *rcsid = * nameserver. */ -krb_get_krbhst(h,r,n) - char *h; - char *r; - int n; +int krb_get_krbhst(char *h, char *r, int n) { FILE *cnffile; char tr[REALM_SZ]; diff --git a/eBones/lib/libkrb/get_krbrlm.c b/eBones/lib/libkrb/get_krbrlm.c index 7df073d..150a916 100644 --- a/eBones/lib/libkrb/get_krbrlm.c +++ b/eBones/lib/libkrb/get_krbrlm.c @@ -5,13 +5,15 @@ * . * * from: get_krbrlm.c,v 4.8 89/01/22 20:02:54 rfrench Exp $ - * $Id: get_krbrlm.c,v 1.2 1994/07/19 19:25:19 g89r4222 Exp $ + * $Id: get_krbrlm.c,v 1.3 1995/07/18 16:38:34 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_krbrlm.c,v 1.2 1994/07/19 19:25:19 g89r4222 Exp $"; +"$Id: get_krbrlm.c,v 1.3 1995/07/18 16:38:34 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -32,11 +34,9 @@ static char *rcsid = * krb_get_krbhst(). */ -krb_get_lrealm(r,n) - char *r; - int n; +int krb_get_lrealm(char *r, int n) { - FILE *cnffile, *fopen(); + FILE *cnffile; if (n > 1) return(KFAILURE); /* Temporary restriction */ diff --git a/eBones/lib/libkrb/get_phost.c b/eBones/lib/libkrb/get_phost.c index 9b12d10..4b0f495 100644 --- a/eBones/lib/libkrb/get_phost.c +++ b/eBones/lib/libkrb/get_phost.c @@ -4,19 +4,21 @@ * . * * from: get_phost.c,v 4.6 89/01/23 09:25:40 jtkohl Exp $ - * $Id: get_phost.c,v 1.2 1994/07/19 19:25:20 g89r4222 Exp $ + * $Id: get_phost.c,v 1.3 1995/07/18 16:38:35 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_phost.c,v 1.2 1994/07/19 19:25:20 g89r4222 Exp $"; +"$Id: get_phost.c,v 1.3 1995/07/18 16:38:35 mark Exp $"; #endif /* lint */ +#endif #include +#include #include #include - -char *index(); +#include /* * This routine takes an alias for a host name and returns the first @@ -35,8 +37,7 @@ char *index(); * to the original "alias" argument is returned. */ -char * krb_get_phost(alias) - char *alias; +char *krb_get_phost(char *alias) { struct hostent *h; char *phost = alias; diff --git a/eBones/lib/libkrb/get_pw_tkt.c b/eBones/lib/libkrb/get_pw_tkt.c index 48a003c..1b016a8 100644 --- a/eBones/lib/libkrb/get_pw_tkt.c +++ b/eBones/lib/libkrb/get_pw_tkt.c @@ -5,13 +5,15 @@ * . * * from: get_pw_tkt.c,v 4.6 89/01/13 18:19:11 steiner Exp $ - * $Id: get_pw_tkt.c,v 1.2 1994/07/19 19:25:23 g89r4222 Exp $ + * $Id: get_pw_tkt.c,v 1.3 1995/07/18 16:38:37 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_pw_tkt.c,v 1.2 1994/07/19 19:25:23 g89r4222 Exp $"; +"$Id: get_pw_tkt.c,v 1.3 1995/07/18 16:38:37 mark Exp $"; #endif /* lint */ +#endif #include @@ -46,11 +48,7 @@ static char *rcsid = * the password-changing server will be in the user's ticket file. */ -get_pw_tkt(user,instance,realm,cpw) - char *user; - char *instance; - char *realm; - char *cpw; +int get_pw_tkt(char *user, char *instance, char *realm, char *cpw) { int kerror; diff --git a/eBones/lib/libkrb/get_request.c b/eBones/lib/libkrb/get_request.c index 131ffd5..dec742b 100644 --- a/eBones/lib/libkrb/get_request.c +++ b/eBones/lib/libkrb/get_request.c @@ -5,13 +5,15 @@ * . * * from: get_request.c,v 4.7 88/12/01 14:00:11 jtkohl Exp $ - * $Id: get_request.c,v 1.2 1994/07/19 19:25:24 g89r4222 Exp $ + * $Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_request.c,v 1.2 1994/07/19 19:25:24 g89r4222 Exp $"; +"$Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -26,11 +28,7 @@ static char *rcsid = * if there are less than n requests in the packet. */ -get_request(pkt, n, s_name, instance) - KTEXT pkt; /* The packet itself */ - int n; /* Which request do we want */ - char **s_name; /* Service name to be filled in */ - char **instance; /* Instance name to be filled in */ +int get_request(KTEXT pkt, int n, char **s_name, char **instance) { /* Go to the beginning of the request list */ char *ptr = (char *) pkt_a_realm(pkt) + 6 + diff --git a/eBones/lib/libkrb/get_svc_in_tkt.c b/eBones/lib/libkrb/get_svc_in_tkt.c index 0b0fe71..cd90f9e 100644 --- a/eBones/lib/libkrb/get_svc_in_tkt.c +++ b/eBones/lib/libkrb/get_svc_in_tkt.c @@ -4,13 +4,15 @@ * . * * from: get_svc_in_tkt.c,v 4.9 89/07/18 16:33:34 jtkohl Exp $ - * $Id: get_svc_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_svc_in_tkt.c,v 1.3 1995/07/18 16:38:41 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_svc_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_svc_in_tkt.c,v 1.3 1995/07/18 16:38:41 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -63,7 +65,7 @@ static int srvtab_to_key(user, instance, realm, srvtab, key) * It returns the return value of the krb_get_in_tkt() call. */ -krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab) +int krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab) char *user, *instance, *realm, *service, *sinstance; int life; char *srvtab; diff --git a/eBones/lib/libkrb/get_tf_fullname.c b/eBones/lib/libkrb/get_tf_fullname.c index 540e828..45226db 100644 --- a/eBones/lib/libkrb/get_tf_fullname.c +++ b/eBones/lib/libkrb/get_tf_fullname.c @@ -4,13 +4,15 @@ * . * * from: get_tf_fullname.c,v 4.3 90/03/10 22:40:20 jon Exp $ - * $Id: get_tf_fullname.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_tf_fullname.c,v 1.3 1995/07/18 16:38:42 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_tf_fullname.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_tf_fullname.c,v 1.3 1995/07/18 16:38:42 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -30,11 +32,8 @@ static char rcsid[] = * krb_get_in_tkt(). */ -krb_get_tf_fullname(ticket_file, name, instance, realm) - char *ticket_file; - char *name; - char *instance; - char *realm; +int krb_get_tf_fullname(char *ticket_file, char *name, char *instance, + char *realm) { int tf_status; CREDENTIALS c; diff --git a/eBones/lib/libkrb/get_tf_realm.c b/eBones/lib/libkrb/get_tf_realm.c index df2845e..704c687 100644 --- a/eBones/lib/libkrb/get_tf_realm.c +++ b/eBones/lib/libkrb/get_tf_realm.c @@ -4,13 +4,15 @@ * . * * from: get_tf_realm.c,v 4.2 90/01/02 13:40:19 jtkohl Exp $ - * $Id: get_tf_realm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_tf_realm.c,v 1.3 1995/07/18 16:38:44 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_tf_realm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_tf_realm.c,v 1.3 1995/07/18 16:38:44 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -26,9 +28,7 @@ static char rcsid[] = * */ -krb_get_tf_realm(ticket_file, realm) - char *ticket_file; - char *realm; +int krb_get_tf_realm(char *ticket_file, char *realm) { return(krb_get_tf_fullname(ticket_file, 0, 0, realm)); } diff --git a/eBones/lib/libkrb/getrealm.c b/eBones/lib/libkrb/getrealm.c index c850bd0..37686c4 100644 --- a/eBones/lib/libkrb/getrealm.c +++ b/eBones/lib/libkrb/getrealm.c @@ -6,13 +6,15 @@ * routine to convert hostname into realm name. * * from: getrealm.c,v 4.6 90/01/02 13:35:56 jtkohl Exp $ - * $Id: getrealm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: getrealm.c,v 1.3 1995/07/18 16:38:46 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: getrealm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: getrealm.c,v 1.3 1995/07/18 16:38:46 mark Exp $"; #endif lint +#endif #include #include @@ -45,9 +47,7 @@ static char rcsid[] = static char ret_realm[REALM_SZ+1]; -char * -krb_realmofhost(host) -char *host; +char *krb_realmofhost(char *host) { char *domain; FILE *trans_file; diff --git a/eBones/lib/libkrb/getst.c b/eBones/lib/libkrb/getst.c index edd55ec..549ec50 100644 --- a/eBones/lib/libkrb/getst.c +++ b/eBones/lib/libkrb/getst.c @@ -4,13 +4,17 @@ * . * * form: getst.c,v 4.5 88/11/15 16:31:39 jtkohl Exp $ - * $Id: getst.c,v 1.2 1994/07/19 19:25:33 g89r4222 Exp $ + * $Id: getst.c,v 1.3 1995/07/18 16:38:47 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: getst.c,v 1.2 1994/07/19 19:25:33 g89r4222 Exp $"; +"$Id: getst.c,v 1.3 1995/07/18 16:38:47 mark Exp $"; #endif /* lint */ +#endif + +#include /* * getst() takes a file descriptor, a string and a count. It reads @@ -22,9 +26,7 @@ static char rcsid[] = * the null terminator. */ -getst(fd, s, n) - int fd; - register char *s; +int getst(int fd, char *s, int n) { register count = n; while (read(fd, s, 1) > 0 && --count) diff --git a/eBones/lib/libkrb/in_tkt.c b/eBones/lib/libkrb/in_tkt.c index 5a05259..12fbb39 100644 --- a/eBones/lib/libkrb/in_tkt.c +++ b/eBones/lib/libkrb/in_tkt.c @@ -5,16 +5,19 @@ * . * * from: kt.c,v 4.9 89/10/25 19:03:35 qjb Exp $ - * $Id: in_tkt.c,v 1.1.1.1 1994/09/30 14:50:01 csgr Exp $ + * $Id: in_tkt.c,v 1.6 1995/07/18 16:38:49 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: in_tkt.c,v 1.1.1.1 1994/09/30 14:50:01 csgr Exp $"; +"$Id: in_tkt.c,v 1.6 1995/07/18 16:38:49 mark Exp $"; #endif /* lint */ +#endif #include #include +#include #include #include #include @@ -24,8 +27,6 @@ static char rcsid[] = #include #endif -extern int krb_debug; - /* * in_tkt() is used to initialize the ticket store. It creates the * file to contain the tickets and writes the given user's name "pname" @@ -33,9 +34,7 @@ extern int krb_debug; * success, or KFAILURE if something goes wrong. */ -in_tkt(pname,pinst) - char *pname; - char *pinst; +int in_tkt(char *pname, char *pinst) { int tktfile; uid_t me, metoo; @@ -91,7 +90,7 @@ in_tkt(pname,pinst) return(KFAILURE); } else if (krb_debug) - printf("swapped UID's %d and %d\n",metoo,me); + printf("swapped UID's %ld and %ld\n",metoo,me); } if ((tktfile = open(file,O_CREAT | O_TRUNC | O_WRONLY,0600)) < 0) { if (krb_debug) @@ -106,7 +105,7 @@ in_tkt(pname,pinst) return(KFAILURE); } else if (krb_debug) - printf("swapped UID's %d and %d\n",me,metoo); + printf("swapped UID's %ld and %ld\n",me,metoo); } if (lstat(file,&buf) < 0) { if (krb_debug) diff --git a/eBones/lib/libkrb/k_gethostname.c b/eBones/lib/libkrb/k_gethostname.c index e5c11ca..093ee5d 100644 --- a/eBones/lib/libkrb/k_gethostname.c +++ b/eBones/lib/libkrb/k_gethostname.c @@ -4,13 +4,17 @@ * . * * from: k_gethostname.c,v 4.1 88/12/01 14:04:42 jtkohl Exp $ - * $Id: k_gethostname.c,v 1.2 1994/07/19 19:25:36 g89r4222 Exp $ + * $Id: k_gethostname.c,v 1.3 1995/07/18 16:38:51 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: k_gethostname.c,v 1.2 1994/07/19 19:25:36 g89r4222 Exp $"; +"$Id: k_gethostname.c,v 1.3 1995/07/18 16:38:51 mark Exp $"; #endif /* lint */ +#endif + +#include #ifndef PC #ifndef BSD42 @@ -37,8 +41,7 @@ extern get_custom(); * not work. */ -k_gethostname(name, namelen) - char *name; +int k_gethostname(char *name, int namelen) { #ifdef BSD42 return gethostname(name, namelen); diff --git a/eBones/lib/libkrb/klog.c b/eBones/lib/libkrb/klog.c index b530e8b..97d52c7 100644 --- a/eBones/lib/libkrb/klog.c +++ b/eBones/lib/libkrb/klog.c @@ -5,13 +5,15 @@ * . * * from: klog.c,v 4.6 88/12/01 14:06:05 jtkohl Exp $ - * $Id: klog.c,v 1.2 1994/07/19 19:25:37 g89r4222 Exp $ + * $Id: klog.c,v 1.3 1995/07/18 16:38:52 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: klog.c,v 1.2 1994/07/19 19:25:37 g89r4222 Exp $"; +"$Id: klog.c,v 1.3 1995/07/18 16:38:52 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -48,14 +50,11 @@ static char logtxt[1000]; * text string "logtxt". */ -char * klog(type,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) - int type; - char *format; - int a1,a2,a3,a4,a5,a6,a7,a8,a9,a0; +char *klog(int type, char *format, int a1, int a2, int a3, int a4, int a5, + int a6, int a7, int a8, int a9, int a0) { - FILE *logfile, *fopen(); + FILE *logfile; long time(),now; - char *month_sname(); struct tm *tm; static int logtype_array[NLOGTYPE] = {0,0}; static int array_initialized; @@ -100,8 +99,7 @@ char * klog(type,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) * the logfile defaults to KRBLOG, defined in "krb.h". */ -kset_logfile(filename) - char *filename; +void kset_logfile(char *filename) { log_name = filename; is_open = 0; diff --git a/eBones/lib/libkrb/kname_parse.c b/eBones/lib/libkrb/kname_parse.c index dd5fe0b..c69b5cc 100644 --- a/eBones/lib/libkrb/kname_parse.c +++ b/eBones/lib/libkrb/kname_parse.c @@ -4,13 +4,15 @@ * . * * from: kname_parse.c,v 4.4 88/12/01 14:07:29 jtkohl Exp $ - * $Id: kname_parse.c,v 1.2 1994/07/19 19:25:39 g89r4222 Exp $ + * $Id: kname_parse.c,v 1.3 1995/07/18 16:38:54 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kname_parse.c,v 1.2 1994/07/19 19:25:39 g89r4222 Exp $"; +"$Id: kname_parse.c,v 1.3 1995/07/18 16:38:54 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -38,7 +40,7 @@ extern char *krb_err_txt[]; * Definition of "syntactically legitimate" names is according to * the Project Athena Technical Plan Section E.2.1, page 7 "Specifying * names", version dated 21 Dec 1987. - * / + */ /* * kname_parse() takes a Kerberos name "fullname" of the form: @@ -52,8 +54,7 @@ extern char *krb_err_txt[]; * KNAME_FMT is returned. */ -kname_parse(np, ip, rp, fullname) - char *np, *ip, *rp, *fullname; +int kname_parse(char *np, char *ip, char *rp, char *fullname) { static char buf[FULL_SZ]; char *rnext, *wnext; /* next char to read, write */ @@ -70,7 +71,7 @@ kname_parse(np, ip, rp, fullname) return KNAME_FMT; (void) strcpy(buf, fullname); - while (c = *rnext++) { + while ((c = *rnext++)) { if (backslash) { *wnext++ = c; backslash = 0; @@ -136,8 +137,7 @@ kname_parse(np, ip, rp, fullname) * Kerberos name; returns 0 if it's not. */ -k_isname(s) - char *s; +int k_isname(char *s) { register char c; int backslash = 0; @@ -146,7 +146,7 @@ k_isname(s) return 0; if (strlen(s) > ANAME_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; @@ -172,15 +172,14 @@ k_isname(s) * Kerberos instance; returns 0 if it's not. */ -k_isinst(s) - char *s; +int k_isinst(char *s) { register char c; int backslash = 0; if (strlen(s) > INST_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; @@ -205,8 +204,7 @@ k_isinst(s) * Kerberos realm; returns 0 if it's not. */ -k_isrealm(s) - char *s; +int k_isrealm(char *s) { register char c; int backslash = 0; @@ -215,7 +213,7 @@ k_isrealm(s) return 0; if (strlen(s) > REALM_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; diff --git a/eBones/lib/libkrb/kntoln.c b/eBones/lib/libkrb/kntoln.c index 62ec1b5..ddb1ba2 100644 --- a/eBones/lib/libkrb/kntoln.c +++ b/eBones/lib/libkrb/kntoln.c @@ -5,13 +5,15 @@ * . * * from: kntoln.c,v 4.7 89/01/23 09:25:15 jtkohl Exp $ - * $Id: kntoln.c,v 1.2 1994/07/19 19:25:40 g89r4222 Exp $ + * $Id: kntoln.c,v 1.3 1995/07/18 16:38:56 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: kntoln.c,v 1.2 1994/07/19 19:25:40 g89r4222 Exp $"; +"$Id: kntoln.c,v 1.3 1995/07/18 16:38:56 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -42,9 +44,7 @@ static char *rcsid = * KSUCCESS if all goes well, otherwise KFAILURE. */ -krb_kntoln(ad,lname) - AUTH_DAT *ad; - char *lname; +int krb_kntoln(AUTH_DAT *ad, char *lname) { static char lrealm[REALM_SZ] = ""; diff --git a/eBones/lib/libkrb/kparse.c b/eBones/lib/libkrb/kparse.c index d79f1cf..edb471c 100644 --- a/eBones/lib/libkrb/kparse.c +++ b/eBones/lib/libkrb/kparse.c @@ -30,15 +30,18 @@ * * * from: kparse.c,v 4.5 89/01/21 17:20:39 jtkohl Exp $ - * $Id: kparse.c,v 1.2 1994/07/19 19:25:42 g89r4222 Exp $ + * $Id: kparse.c,v 1.3 1995/07/18 16:38:58 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kparse.c,v 1.2 1994/07/19 19:25:42 g89r4222 Exp $"; +"$Id: kparse.c,v 1.3 1995/07/18 16:38:58 mark Exp $"; #endif lint +#endif #include +#include #include #include @@ -47,23 +50,21 @@ static char rcsid[] = #define TRUE 1 #endif -#define void int - #define MAXKEY 80 #define MAXVALUE 80 -char *malloc(); -char *strcpy(); +int fGetKeywordValue(FILE *fp, char *keyword, int klen, char *value, int vlen); +int fGetToken(FILE *fp, char *dest, int maxlen); +int fGetChar(FILE *fp); +int fUngetChar(int ch, FILE*fp); +int fGetLiteral(FILE *fp);; int LineNbr=1; /* current line nbr in parameter file */ char ErrorMsg[80]; /* meaningful only when KV_SYNTAX, PS_SYNTAX, * or PS_BAD_KEYWORD is returned by * fGetKeywordValue or fGetParameterSet */ -int fGetParameterSet( fp,parm,parmcount ) - FILE *fp; - parmtable parm[]; - int parmcount; +int fGetParameterSet(FILE *fp, parmtable parm[], int parmcount ) { int rc,i; char keyword[MAXKEY]; @@ -126,11 +127,7 @@ int fGetParameterSet( fp,parm,parmcount ) * different. Like strcmp, ParmCompare returns 0 for a match found, -1 * otherwise */ -int ParmCompare( parm, parmcount, keyword, value ) - parmtable parm[]; - int parmcount; - char *keyword; - char *value; +int ParmCompare(parmtable parm[], int parmcount, char *keyword, char *value ) { int i; @@ -146,9 +143,7 @@ int ParmCompare( parm, parmcount, keyword, value ) return(-1); } -void FreeParameterSet(parm,parmcount) - parmtable parm[]; - int parmcount; +void FreeParameterSet(parmtable parm[], int parmcount) { int i; @@ -160,12 +155,7 @@ void FreeParameterSet(parm,parmcount) } } -int fGetKeywordValue( fp, keyword, klen, value, vlen ) - FILE *fp; - char *keyword; - int klen; - char *value; - int vlen; +int fGetKeywordValue(FILE *fp, char *keyword, int klen, char *value, int vlen) { int rc; int gotit; @@ -321,6 +311,7 @@ int fGetKeywordValue( fp, keyword, klen, value, vlen ) } while ( !gotit ); /*NOTREACHED*/ + return 0; /* I know, I know. - markm */ } /* @@ -352,10 +343,7 @@ int fGetKeywordValue( fp, keyword, klen, value, vlen ) * classification for end of file is * always zero. */ -int fGetToken(fp, dest, maxlen) - FILE *fp; - char *dest; - int maxlen; +int fGetToken(FILE *fp, char *dest, int maxlen) { int ch='\0'; int len=0; @@ -448,8 +436,7 @@ int fGetToken(fp, dest, maxlen) * special case certain values (\n, \f, \r, \b) or return a literal * otherwise (useful for \", for example). */ -fGetLiteral(fp) - FILE *fp; +int fGetLiteral(FILE *fp) { int ch; int n=0; @@ -524,9 +511,7 @@ fGetLiteral(fp) * exactly the same as ungetc(3) except that the line number of the * input file is maintained. */ -fUngetChar(ch,fp) - int ch; - FILE *fp; +int fUngetChar(int ch, FILE*fp) { if (ch=='\n') LineNbr--; return(ungetc(ch,fp)); @@ -537,8 +522,7 @@ fUngetChar(ch,fp) * exactly the same as fgetc(3) except that the line number of the * input file is maintained. */ -fGetChar(fp) - FILE *fp; +int fGetChar(FILE *fp) { int ch = fgetc(fp); if (ch=='\n') LineNbr++; @@ -564,8 +548,7 @@ fGetChar(fp) * Return Value: pointer to copied string * */ -char * strsave(p) - char *p; +char *strsave(char *p) { return(strcpy(malloc(strlen(p)+1),p)); } @@ -576,8 +559,7 @@ char * strsave(p) * the pointer to the beginning of the string is returned. */ -char * strutol( start ) - char *start; +char *strutol(char *start) { char *q; for (q=start; *q; q++) @@ -592,9 +574,7 @@ char * strutol( start ) char *pgm = "gettoken"; -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { char *p; int type; @@ -647,9 +627,7 @@ main(argc,argv) #ifdef KVTEST -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { int rc,ch; FILE *fp; @@ -706,9 +684,7 @@ parmtable kparm[] = { { "instance", "", (char *)NULL } }; -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { int rc,i,ch; FILE *fp; diff --git a/eBones/lib/libkrb/krb_err.et b/eBones/lib/libkrb/krb_err.et index 2c6830b..7d2baef 100644 --- a/eBones/lib/libkrb/krb_err.et +++ b/eBones/lib/libkrb/krb_err.et @@ -1,9 +1,9 @@ # Copyright 1987,1988 Massachusetts Institute of Technology # For copying and distribution information, see the file # "Copyright.MIT". -# +# # from: krb_err.et,v 4.1 89/09/26 09:24:20 jtkohl Exp $ -# $Id: krb_err.et,v 1.2 1994/07/19 19:25:44 g89r4222 Exp $ +# $Id: krb_err.et,v 1.3 1995/07/18 16:39:00 mark Exp $ # error_table krb @@ -45,7 +45,7 @@ ec KRBET_KRB_RES12, "Reserved 12" - + ec KRBET_KRB_RES13, "Reserved 13" diff --git a/eBones/lib/libkrb/krb_err_txt.c b/eBones/lib/libkrb/krb_err_txt.c index 785563f..2c8c0ca 100644 --- a/eBones/lib/libkrb/krb_err_txt.c +++ b/eBones/lib/libkrb/krb_err_txt.c @@ -4,13 +4,15 @@ * . * * from: krb_err_txt.c,v 4.7 88/12/01 14:10:14 jtkohl Exp $ - * $Id: krb_err_txt.c,v 1.2 1994/07/19 19:25:45 g89r4222 Exp $ + * $Id: krb_err_txt.c,v 1.3 1995/07/18 16:39:02 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_err_txt.c,v 1.2 1994/07/19 19:25:45 g89r4222 Exp $"; +"$Id: krb_err_txt.c,v 1.3 1995/07/18 16:39:02 mark Exp $"; #endif lint +#endif /* * This file contains an array of error text strings. diff --git a/eBones/lib/libkrb/krb_get_in_tkt.c b/eBones/lib/libkrb/krb_get_in_tkt.c index af92bc6..e17b60e 100644 --- a/eBones/lib/libkrb/krb_get_in_tkt.c +++ b/eBones/lib/libkrb/krb_get_in_tkt.c @@ -5,13 +5,15 @@ * . * * from: der: krb_get_in_tkt.c,v 4.19 89/07/18 16:31:31 jtkohl Exp $ - * $Id: krb_get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: krb_get_in_tkt.c,v 1.3 1995/07/18 16:39:04 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: krb_get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: krb_get_in_tkt.c,v 1.3 1995/07/18 16:39:04 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -33,13 +35,8 @@ int swap_bytes; * using the key returned by key_proc. */ -static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) - char *user; - char *instance; - char *realm; - char *arg; - int (*key_proc)(); - KTEXT *cipp; +static int decrypt_tkt(char *user, char *instance, char *realm, char *arg, + int (*key_proc)(), KTEXT *cipp) { KTEXT cip = *cipp; C_Block key; /* Key for decrypting cipher */ @@ -59,9 +56,9 @@ static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) } #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)cip->dat,(C_Block *)cip->dat, - (long) cip->length,key_s,key,DES_DECRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)cip->dat,(des_cblock *)cip->dat, + (long) cip->length,key_s,(des_cblock *)key,DES_DECRYPT); #endif /* !NOENCRYPTION */ /* Get rid of all traces of key */ bzero((char *)key,sizeof(key)); @@ -111,17 +108,9 @@ static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) * string sinstance service's instance */ -krb_get_in_tkt(user, instance, realm, service, sinstance, life, - key_proc, decrypt_proc, arg) - char *user; - char *instance; - char *realm; - char *service; - char *sinstance; - int life; - int (*key_proc)(); - int (*decrypt_proc)(); - char *arg; +int krb_get_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, int (*key_proc)(), int (*decrypt_proc)(), + char *arg) { KTEXT_ST pkt_st; KTEXT pkt = &pkt_st; /* Packet to KDC */ @@ -182,7 +171,7 @@ krb_get_in_tkt(user, instance, realm, service, sinstance, life, /* SEND THE REQUEST AND RECEIVE THE RETURN PACKET */ - if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); + if ((kerror = send_to_kdc(pkt, rpkt, realm))) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION) @@ -289,8 +278,8 @@ krb_get_in_tkt(user, instance, realm, service, sinstance, life, return(INTK_ERR); /* stash ticket, session key, etc. for future use */ - if (kerror = save_credentials(s_name, s_instance, rlm, ses, - lifetime, kvno, tkt, t_local.tv_sec)) + if ((kerror = save_credentials(s_name, s_instance, rlm, ses, + lifetime, kvno, tkt, t_local.tv_sec))) return(kerror); return(INTK_OK); diff --git a/eBones/lib/libkrb/krbglue.c b/eBones/lib/libkrb/krbglue.c index 8e864c1..de5b7e2 100644 --- a/eBones/lib/libkrb/krbglue.c +++ b/eBones/lib/libkrb/krbglue.c @@ -4,13 +4,15 @@ * . * * from: krbglue.c,v 4.1 89/01/23 15:51:50 wesommer Exp $ - * $Id: krbglue.c,v 1.2 1994/07/19 19:25:49 g89r4222 Exp $ + * $Id: krbglue.c,v 1.3 1995/07/18 16:39:05 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -$Id: krbglue.c,v 1.2 1994/07/19 19:25:49 g89r4222 Exp $"; +$Id: krbglue.c,v 1.3 1995/07/18 16:39:05 mark Exp $"; #endif lint +#endif #ifndef NCOMPAT /* diff --git a/eBones/lib/libkrb/kuserok.c b/eBones/lib/libkrb/kuserok.c index 404532d..15a25e8 100644 --- a/eBones/lib/libkrb/kuserok.c +++ b/eBones/lib/libkrb/kuserok.c @@ -7,16 +7,19 @@ * access to a local account * * from: kuserok.c,v 4.5 89/01/23 09:25:21 jtkohl Exp $ - * $Id: kuserok.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: kuserok.c,v 1.3 1995/07/18 16:39:07 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kuserok.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: kuserok.c,v 1.3 1995/07/18 16:39:07 mark Exp $"; #endif lint +#endif #include #include +#include #include #include #include @@ -83,9 +86,7 @@ parmtable kparm[] = { #define KPARMS kparm,PARMCOUNT(kparm) #endif ATHENA_COMPAT -kuserok(kdata, luser) - AUTH_DAT *kdata; - char *luser; +int kuserok(AUTH_DAT *kdata, char *luser) { struct stat sbuf; struct passwd *pwd; @@ -178,7 +179,7 @@ kuserok(kdata, luser) linebuf[BUFSIZ-1] = '\0'; newline = NULL; /* nuke the newline if it exists */ - if (newline = index(linebuf, '\n')) + if ((newline = index(linebuf, '\n'))) *newline = '\0'; rc = kname_parse(principal, inst, realm, linebuf); if (rc == KSUCCESS) { diff --git a/eBones/lib/libkrb/log.c b/eBones/lib/libkrb/log.c index 42fccfb..aea6ab9 100644 --- a/eBones/lib/libkrb/log.c +++ b/eBones/lib/libkrb/log.c @@ -5,13 +5,15 @@ * . * * from: log.c,v 4.7 88/12/01 14:15:14 jtkohl Exp $ - * $Id: log.c,v 1.2 1994/07/19 19:25:53 g89r4222 Exp $ + * $Id: log.c,v 1.3 1995/07/18 16:39:09 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: log.c,v 1.2 1994/07/19 19:25:53 g89r4222 Exp $"; +"$Id: log.c,v 1.3 1995/07/18 16:39:09 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -42,18 +44,12 @@ static is_open; * The return value is undefined. */ -__BEGIN_DECLS -char *month_sname __P((int)); -__END_DECLS - - /*VARARGS1 */ -void log(format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) - char *format; - int a1,a2,a3,a4,a5,a6,a7,a8,a9,a0; +void log(char *format,int a1,int a2,int a3,int a4,int a5,int a6,int a7, + int a8,int a9,int a0) { - FILE *logfile, *fopen(); - long time(),now; + FILE *logfile; + long now; struct tm *tm; if ((logfile = fopen(log_name,"a")) == NULL) @@ -77,8 +73,7 @@ void log(format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) * the logfile defaults to KRBLOG, defined in "krb.h". */ -set_logfile(filename) - char *filename; +void set_logfile(char *filename) { log_name = filename; is_open = 0; @@ -91,9 +86,7 @@ set_logfile(filename) * on success. */ -new_log(t,string) - long t; - char *string; +int new_log(long t, char *string) { static FILE *logfile; diff --git a/eBones/lib/libkrb/mk_err.c b/eBones/lib/libkrb/mk_err.c index 331cba9..8600240 100644 --- a/eBones/lib/libkrb/mk_err.c +++ b/eBones/lib/libkrb/mk_err.c @@ -5,13 +5,15 @@ * . * * from: mk_err.c,v 4.4 88/11/15 16:33:36 jtkohl Exp $ - * $Id: mk_err.c,v 1.2 1994/07/19 19:25:54 g89r4222 Exp $ + * $Id: mk_err.c,v 1.3 1995/07/18 16:39:11 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: mk_err.c,v 1.2 1994/07/19 19:25:54 g89r4222 Exp $"; +"$Id: mk_err.c,v 1.3 1995/07/18 16:39:11 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/lib/libkrb/mk_priv.c b/eBones/lib/libkrb/mk_priv.c index 3050cf4..bc377de 100644 --- a/eBones/lib/libkrb/mk_priv.c +++ b/eBones/lib/libkrb/mk_priv.c @@ -16,16 +16,19 @@ * Steve Miller Project Athena MIT/DEC * * from: mk_priv.c,v 4.13 89/03/22 14:48:59 jtkohl Exp $ - * $Id: mk_priv.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_priv.c,v 1.3 1995/07/18 16:39:13 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: mk_priv.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_priv.c,v 1.3 1995/07/18 16:39:13 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -37,13 +40,8 @@ static char rcsid[] = #include #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ - static u_long c_length; static struct timeval msg_time; static u_char msg_time_5ms; @@ -92,16 +90,9 @@ static long msg_time_sec; * 0<=n<=7 bytes pad to 8 byte multiple zeroes */ -long krb_mk_priv(in,out,length,schedule,key,sender,receiver) - u_char *in; /* application data */ - u_char *out; /* put msg here, leave room for - * header! breaks if in and out - * (header stuff) overlap */ - u_long length; /* of in data */ - Key_schedule schedule; /* precomputed key schedule */ - C_Block key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender address */ - struct sockaddr_in *receiver; /* receiver address */ +long krb_mk_priv(u_char *in, u_char *out, u_long length, + des_key_schedule schedule, des_cblock key, struct sockaddr_in *sender, + struct sockaddr_in *receiver) { register u_char *p,*q; static u_char *c_length_ptr; @@ -196,7 +187,8 @@ long krb_mk_priv(in,out,length,schedule,key,sender,receiver) bcopy((char *) &c_length,(char *)c_length_ptr,sizeof(c_length)); #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)q,(C_Block *)q,(long)(p-q),schedule,key,ENCRYPT); + pcbc_encrypt((des_cblock *)q,(des_cblock *)q,(long)(p-q),schedule, + (des_cblock *)key,ENCRYPT); #endif /* NOENCRYPTION */ return (q - out + c_length); /* resulting size */ diff --git a/eBones/lib/libkrb/mk_req.c b/eBones/lib/libkrb/mk_req.c index fd31717..971e6a2 100644 --- a/eBones/lib/libkrb/mk_req.c +++ b/eBones/lib/libkrb/mk_req.c @@ -5,13 +5,15 @@ * . * * from: der: mk_req.c,v 4.17 89/07/07 15:20:35 jtkohl Exp $ - * $Id: mk_req.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_req.c,v 1.3 1995/07/18 16:39:15 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: mk_req.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_req.c,v 1.3 1995/07/18 16:39:15 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -19,7 +21,6 @@ static char *rcsid = #include #include -extern int krb_ap_req_debug; static struct timeval tv_local = { 0, 0 }; static int lifetime = DEFAULT_TKT_LIFE; @@ -67,12 +68,8 @@ static int lifetime = DEFAULT_TKT_LIFE; * all rounded up to multiple of 8. */ -krb_mk_req(authent,service,instance,realm,checksum) - register KTEXT authent; /* Place to build the authenticator */ - char *service; /* Name of the service */ - char *instance; /* Service instance */ - char *realm; /* Authentication domain of service */ - long checksum; /* Checksum of data (optional) */ +int krb_mk_req(KTEXT authent, char *service, char *instance, char *realm, + long checksum) { static KTEXT_ST req_st; /* Temp storage for req id */ register KTEXT req_id = &req_st; @@ -106,9 +103,9 @@ krb_mk_req(authent,service,instance,realm,checksum) retval = krb_get_cred(service,instance,realm,&cr); if (retval == RET_NOTKT) { - if (retval = get_ad_tkt(service,instance,realm,lifetime)) + if ((retval = get_ad_tkt(service,instance,realm,lifetime))) return(retval); - if (retval = krb_get_cred(service,instance,realm,&cr)) + if ((retval = krb_get_cred(service,instance,realm,&cr))) return(retval); } @@ -126,7 +123,7 @@ krb_mk_req(authent,service,instance,realm,checksum) if (krb_ap_req_debug) printf("Ticket->length = %d\n",ticket->length); if (krb_ap_req_debug) - printf("Issue date: %d\n",cr.issue_date); + printf("Issue date: %ld\n",cr.issue_date); /* Build request id */ (void) strcpy((char *)(req_id->dat),cr.pname); /* Auth name */ @@ -154,9 +151,9 @@ krb_mk_req(authent,service,instance,realm,checksum) req_id->length = ((req_id->length+7)/8)*8; #ifndef NOENCRYPTION - key_sched(cr.session,key_s); - pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat, - (long)req_id->length,key_s,cr.session,ENCRYPT); + key_sched((des_cblock *)cr.session,key_s); + pcbc_encrypt((des_cblock *)req_id->dat,(des_cblock *)req_id->dat, + (long)req_id->length,key_s,(des_cblock *)cr.session,ENCRYPT); bzero((char *) key_s, sizeof(key_s)); #endif /* NOENCRYPTION */ @@ -184,9 +181,7 @@ krb_mk_req(authent,service,instance,realm,checksum) * It returns the previous value of the default lifetime. */ -int -krb_set_lifetime(newval) -int newval; +int krb_set_lifetime(int newval) { int olife = lifetime; diff --git a/eBones/lib/libkrb/mk_safe.c b/eBones/lib/libkrb/mk_safe.c index 46a80f7..f4aab32 100644 --- a/eBones/lib/libkrb/mk_safe.c +++ b/eBones/lib/libkrb/mk_safe.c @@ -15,16 +15,19 @@ * Steve Miller Project Athena MIT/DEC * * from: mk_safe.c,v 4.12 89/03/22 14:50:49 jtkohl Exp $ - * $Id: mk_safe.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_safe.c,v 1.3 1995/07/18 16:39:17 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: mk_safe.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_safe.c,v 1.3 1995/07/18 16:39:17 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -80,17 +83,8 @@ static long msg_time_sec; * above using "key" */ -long krb_mk_safe(in,out,length,key,sender,receiver) - u_char *in; /* application data */ - u_char *out; /* - * put msg here, leave room for header! - * breaks if in and out (header stuff) - * overlap - */ - u_long length; /* of in data */ - C_Block *key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender address */ - struct sockaddr_in *receiver; /* receiver address */ +long krb_mk_safe(u_char *in, u_char *out, u_long length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver) { register u_char *p,*q; @@ -154,10 +148,10 @@ long krb_mk_safe(in,out,length,key,sender,receiver) cksum = 0; bzero(big_cksum, sizeof(big_cksum)); #else - cksum=quad_cksum(q,big_cksum,p-q,2,key); + cksum=quad_cksum((des_cblock *)q,big_cksum,p-q,2,(des_cblock *)key); #endif if (krb_debug) - printf("\ncksum = %u",cksum); + printf("\ncksum = %lu",cksum); /* stuff checksum */ bcopy((char *)big_cksum,(char *)p,sizeof(big_cksum)); diff --git a/eBones/lib/libkrb/month_sname.c b/eBones/lib/libkrb/month_sname.c index e7a63ec..3443e41 100644 --- a/eBones/lib/libkrb/month_sname.c +++ b/eBones/lib/libkrb/month_sname.c @@ -5,13 +5,15 @@ * . * * from: month_sname.c,v 4.4 88/11/15 16:39:32 jtkohl Exp $ - * $Id: month_sname.c,v 1.2 1994/07/19 19:26:00 g89r4222 Exp $ + * $Id: month_sname.c,v 1.3 1995/07/18 16:39:19 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: month_sname.c,v 1.2 1994/07/19 19:26:00 g89r4222 Exp $"; +"$Id: month_sname.c,v 1.3 1995/07/18 16:39:19 mark Exp $"; #endif /* lint */ +#endif /* @@ -20,8 +22,7 @@ static char *rcsid = * month. Returns 0 if the argument is out of range. */ -char *month_sname(n) - int n; +char *month_sname(int n) { static char *name[] = { "Jan","Feb","Mar","Apr","May","Jun", diff --git a/eBones/lib/libkrb/netread.c b/eBones/lib/libkrb/netread.c index eb86327..c773bc8 100644 --- a/eBones/lib/libkrb/netread.c +++ b/eBones/lib/libkrb/netread.c @@ -4,13 +4,19 @@ * . * * from: netread.c,v 4.1 88/11/15 16:47:21 jtkohl Exp $ - * $Id: netread.c,v 1.2 1994/07/19 19:26:03 g89r4222 Exp $ + * $Id: netread.c,v 1.3 1995/07/18 16:39:20 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: netread.c,v 1.2 1994/07/19 19:26:03 g89r4222 Exp $"; +"$Id: netread.c,v 1.3 1995/07/18 16:39:20 mark Exp $"; #endif lint +#endif + +#include +#include +#include /* * krb_net_read() reads from the file descriptor "fd" to the buffer @@ -22,11 +28,7 @@ static char rcsid[] = * XXX must not use non-blocking I/O */ -int -krb_net_read(fd, buf, len) -int fd; -register char *buf; -register int len; +int krb_net_read(int fd, char *buf, int len) { int cc, len2 = 0; diff --git a/eBones/lib/libkrb/netwrite.c b/eBones/lib/libkrb/netwrite.c index 5945ce0..7af91ff 100644 --- a/eBones/lib/libkrb/netwrite.c +++ b/eBones/lib/libkrb/netwrite.c @@ -4,13 +4,19 @@ * . * * from: netwrite.c,v 4.1 88/11/15 16:48:58 jtkohl Exp $"; - * $Id: netwrite.c,v 1.2 1994/07/19 19:26:04 g89r4222 Exp $ + * $Id: netwrite.c,v 1.3 1995/07/18 16:39:22 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: netwrite.c,v 1.2 1994/07/19 19:26:04 g89r4222 Exp $"; +"$Id: netwrite.c,v 1.3 1995/07/18 16:39:22 mark Exp $"; #endif lint +#endif + +#include +#include +#include /* * krb_net_write() writes "len" bytes from "buf" to the file @@ -21,11 +27,7 @@ static char rcsid[] = * XXX must not use non-blocking I/O */ -int -krb_net_write(fd, buf, len) -int fd; -register char *buf; -int len; +int krb_net_write(int fd, char *buf, int len) { int cc; register int wrlen = len; diff --git a/eBones/lib/libkrb/one.c b/eBones/lib/libkrb/one.c index c0e8bc6..ef02ae1 100644 --- a/eBones/lib/libkrb/one.c +++ b/eBones/lib/libkrb/one.c @@ -4,13 +4,15 @@ * . * * form: one.c,v 4.1 88/11/15 16:51:41 jtkohl Exp $ - * $Id: one.c,v 1.2 1994/07/19 19:26:05 g89r4222 Exp $ + * $Id: one.c,v 1.3 1995/07/18 16:39:24 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: one.c,v 1.2 1994/07/19 19:26:05 g89r4222 Exp $"; +"$Id: one.c,v 1.3 1995/07/18 16:39:24 mark Exp $"; #endif lint +#endif /* * definition of variable set to 1. diff --git a/eBones/lib/libkrb/pkt_cipher.c b/eBones/lib/libkrb/pkt_cipher.c index 6ef870c..9c32b72 100644 --- a/eBones/lib/libkrb/pkt_cipher.c +++ b/eBones/lib/libkrb/pkt_cipher.c @@ -5,13 +5,15 @@ * . * * from: pkt_cipher.c,v 4.8 89/01/13 17:46:14 steiner Exp $ - * $Id: pkt_cipher.c,v 1.2 1994/07/19 19:26:07 g89r4222 Exp $ + * $Id: pkt_cipher.c,v 1.3 1995/07/18 16:39:25 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: pkt_cipher.c,v 1.2 1994/07/19 19:26:07 g89r4222 Exp $"; +"$Id: pkt_cipher.c,v 1.3 1995/07/18 16:39:25 mark Exp $"; #endif /* lint */ +#endif #include #include diff --git a/eBones/lib/libkrb/pkt_clen.c b/eBones/lib/libkrb/pkt_clen.c index 23ad4c3..17d46c2 100644 --- a/eBones/lib/libkrb/pkt_clen.c +++ b/eBones/lib/libkrb/pkt_clen.c @@ -5,18 +5,20 @@ * . * * from: pkt_clen.c,v 4.7 88/11/15 16:56:36 jtkohl Exp $ - * $Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $ + * $Id: pkt_clen.c,v 1.3 1995/07/18 16:39:27 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $"; +"$Id: pkt_clen.c,v 1.3 1995/07/18 16:39:27 mark Exp $"; #endif /* lint */ +#endif #include #include +#include -extern int krb_debug; extern int swap_bytes; /* @@ -27,8 +29,7 @@ extern int swap_bytes; * ciphertext length out of the packet. */ -pkt_clen(pkt) - KTEXT pkt; +int pkt_clen(KTEXT pkt) { static unsigned short temp,temp2; int clen = 0; diff --git a/eBones/lib/libkrb/rd_err.c b/eBones/lib/libkrb/rd_err.c index e73c47b..8c5b8a2 100644 --- a/eBones/lib/libkrb/rd_err.c +++ b/eBones/lib/libkrb/rd_err.c @@ -13,16 +13,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_err.c,v 4.5 89/01/13 17:26:38 steiner Exp $ - * $Id: rd_err.c,v 1.2 1994/07/19 19:26:10 g89r4222 Exp $ + * $Id: rd_err.c,v 1.3 1995/07/18 16:39:29 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: rd_err.c,v 1.2 1994/07/19 19:26:10 g89r4222 Exp $"; +"$Id: rd_err.c,v 1.3 1995/07/18 16:39:29 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -47,12 +50,7 @@ static char rcsid[] = * The AUTH_MSG_APPL_ERR message format can be found in mk_err.c */ -int -krb_rd_err(in,in_length,code,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* of in msg */ - long *code; /* received error code */ - MSG_DAT *m_data; +int krb_rd_err(u_char *in, u_long in_length, long *code, MSG_DAT *m_data) { register u_char *p; int swap_bytes = 0; diff --git a/eBones/lib/libkrb/rd_priv.c b/eBones/lib/libkrb/rd_priv.c index 0e3d906..457352e 100644 --- a/eBones/lib/libkrb/rd_priv.c +++ b/eBones/lib/libkrb/rd_priv.c @@ -15,16 +15,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_priv.c,v 4.14 89/04/28 11:59:42 jtkohl Exp $ - * $Id: rd_priv.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: rd_priv.c,v 1.3 1995/07/18 16:39:31 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[]= -"$Id: rd_priv.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: rd_priv.c,v 1.3 1995/07/18 16:39:31 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -36,10 +39,6 @@ static char rcsid[]= #include #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ static u_long c_length; @@ -69,14 +68,9 @@ int private_msg_ver = KRB_PROT_VERSION; * information, MSG_DAT, is defined in "krb.h". */ -long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* length of "in" msg */ - Key_schedule schedule; /* precomputed key schedule */ - C_Block key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; - struct sockaddr_in *receiver; - MSG_DAT *m_data; /*various input/output data from msg */ +long krb_rd_priv(u_char *in, u_long in_length, des_key_schedule schedule, + des_cblock key, struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *m_data) { register u_char *p,*q; static u_long src_addr; /* Can't send structs since no @@ -109,7 +103,8 @@ long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) q = p; /* mark start of encrypted stuff */ #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)q,(C_Block *)q,(long)c_length,schedule,key,DECRYPT); + pcbc_encrypt((des_cblock *)q,(des_cblock *)q,(long)c_length,schedule, + (des_cblock *)key,DECRYPT); #endif /* safely get application data length */ @@ -176,7 +171,7 @@ long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) if (delta_t > CLOCK_SKEW) return RD_AP_TIME; if (krb_debug) - printf("\ndelta_t = %d",delta_t); + printf("\ndelta_t = %ld",delta_t); /* * caller must check timestamps for proper order and diff --git a/eBones/lib/libkrb/rd_req.c b/eBones/lib/libkrb/rd_req.c index 22b6540..b77ec48 100644 --- a/eBones/lib/libkrb/rd_req.c +++ b/eBones/lib/libkrb/rd_req.c @@ -5,22 +5,23 @@ * . * * from: der: rd_req.c,v 4.16 89/03/22 14:52:06 jtkohl Exp $ - * $Id: rd_req.c,v 1.2 1994/07/19 19:26:13 g89r4222 Exp $ + * $Id: rd_req.c,v 1.3 1995/07/18 16:39:33 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: rd_req.c,v 1.2 1994/07/19 19:26:13 g89r4222 Exp $"; +"$Id: rd_req.c,v 1.3 1995/07/18 16:39:33 mark Exp $"; #endif /* lint */ +#endif +#include #include #include #include #include #include -extern int krb_ap_req_debug; - static struct timeval t_local = { 0, 0 }; /* @@ -64,20 +65,17 @@ static char st_inst[INST_SZ]; /* server's instance */ * krb_rd_req(). */ -int -krb_set_key(key,cvt) - char *key; - int cvt; +int krb_set_key(char *key, int cvt) { #ifdef NOENCRYPTION bzero(ky, sizeof(ky)); return KSUCCESS; #else if (cvt) - string_to_key(key,ky); + string_to_key(key,(des_cblock *)ky); else bcopy(key,(char *)ky,8); - return(des_key_sched(ky,serv_key)); + return(des_key_sched((des_cblock *)ky,serv_key)); #endif } @@ -123,13 +121,8 @@ krb_set_key(key,cvt) * Mutual authentication is not implemented. */ -krb_rd_req(authent,service,instance,from_addr,ad,fn) - register KTEXT authent; /* The received message */ - char *service; /* Service name */ - char *instance; /* Service instance */ - long from_addr; /* Net address of originating host */ - AUTH_DAT *ad; /* Structure to be filled in */ - char *fn; /* Filename to get keys from */ +int krb_rd_req (KTEXT authent, char *service, char *instance, long from_addr, + AUTH_DAT *ad, char *fn) { static KTEXT_ST ticket; /* Temp storage for ticket */ static KTEXT tkt = &ticket; @@ -208,7 +201,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) #ifndef NOENCRYPTION if (read_service_key(service,instance,realm,s_kvno,fn,(char *)skey)) return(RD_AP_UNDEC); - if (status=krb_set_key((char *)skey,0)) return(status); + if ((status=krb_set_key((char *)skey,0))) return(status); #endif (void) strcpy(st_rlm,realm); (void) strcpy(st_nam,service); @@ -248,9 +241,10 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) bcopy(ptr + tkt->length, (char *)(req_id->dat),req_id->length); #ifndef NOENCRYPTION - key_sched(ad->session,seskey_sched); - pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat, - (long)req_id->length,seskey_sched,ad->session,DES_DECRYPT); + key_sched((des_cblock *)ad->session,seskey_sched); + pcbc_encrypt((des_cblock *)req_id->dat,(des_cblock *)req_id->dat, + (long)req_id->length,seskey_sched,(des_cblock *)ad->session, + DES_DECRYPT); #endif /* NOENCRYPTION */ #define check_ptr() if ((ptr - (char *) req_id->dat) > req_id->length) return(RD_AP_MODIFIED); diff --git a/eBones/lib/libkrb/rd_safe.c b/eBones/lib/libkrb/rd_safe.c index 3bfc490..48d43c5 100644 --- a/eBones/lib/libkrb/rd_safe.c +++ b/eBones/lib/libkrb/rd_safe.c @@ -13,16 +13,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_safe.c,v 4.12 89/01/23 15:16:16 steiner Exp $ - * $Id: rd_safe.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: rd_safe.c,v 1.3 1995/07/18 16:39:34 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: rd_safe.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: rd_safe.c,v 1.3 1995/07/18 16:39:34 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include +#include #include #include #include @@ -34,10 +37,6 @@ static char rcsid[] = #include #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ static C_Block calc_cksum[2]; @@ -63,13 +62,9 @@ static u_long delta_t; * information, MSG_DAT, is defined in "krb.h". */ -long krb_rd_safe(in,in_length,key,sender,receiver,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* length of "in" msg */ - C_Block *key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender's address */ - struct sockaddr_in *receiver; /* receiver's address -- me */ - MSG_DAT *m_data; /* where to put message information */ +long krb_rd_safe(u_char *in, u_long in_length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *m_data) { register u_char *p,*q; static u_long src_addr; /* Can't send structs since no @@ -167,11 +162,11 @@ krb_rd_safe protocol err sizeof(u_long) != sizeof(struct in_addr)"); #ifdef NOENCRYPTION bzero(calc_cksum, sizeof(calc_cksum)); #else - quad_cksum(q,calc_cksum,p-q,2,key); + quad_cksum((des_cblock *)q,calc_cksum,p-q,2,(des_cblock *)key); #endif if (krb_debug) - printf("\ncalc_cksum = %u, received cksum = %u", + printf("\ncalc_cksum = %lu, received cksum = %lu", (long) calc_cksum[0], (long) big_cksum[0]); if (bcmp((char *)big_cksum,(char *)calc_cksum,sizeof(big_cksum))) return(RD_AP_MODIFIED); diff --git a/eBones/lib/libkrb/read_service_key.c b/eBones/lib/libkrb/read_service_key.c index c68a8fc..aa577fd 100644 --- a/eBones/lib/libkrb/read_service_key.c +++ b/eBones/lib/libkrb/read_service_key.c @@ -5,17 +5,20 @@ * . * * from: _service_key.c,v 4.10 90/03/10 19:06:56 jon Exp $ - * $Id: read_service_key.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: read_service_key.c,v 1.3 1995/07/18 16:39:36 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: read_service_key.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: read_service_key.c,v 1.3 1995/07/18 16:39:36 mark Exp $"; #endif /* lint */ +#endif #include #include #include +#include /* * The private keys for servers on a given host are stored in a @@ -51,13 +54,8 @@ static char *rcsid = /*ARGSUSED */ -read_service_key(service,instance,realm,kvno,file,key) - char *service; /* Service Name */ - char *instance; /* Instance name or "*" */ - char *realm; /* Realm */ - int kvno; /* Key version number */ - char *file; /* Filename */ - char *key; /* Pointer to key to be filled in */ +int read_service_key(char *service, char *instance, char *realm, int kvno, + char *file, char *key) { char serv[SNAME_SZ]; char inst[INST_SZ]; diff --git a/eBones/lib/libkrb/recvauth.c b/eBones/lib/libkrb/recvauth.c index 2ab364f..8e9a6bb 100644 --- a/eBones/lib/libkrb/recvauth.c +++ b/eBones/lib/libkrb/recvauth.c @@ -4,21 +4,25 @@ * . * * from: recvauth.c,v 4.4 90/03/10 19:03:08 jon Exp $"; - * $Id: recvauth.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: recvauth.c,v 1.3 1995/07/18 16:39:38 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: recvauth.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: recvauth.c,v 1.3 1995/07/18 16:39:38 mark Exp $"; #endif lint +#endif -#include #include #include #include #include #include +#include +#include #include +#include #define KRB_SENDAUTH_VERS "AUTHV0.1" /* MUST be KRB_SENDAUTH_VLEN @@ -30,8 +34,6 @@ static char rcsid[] = * be sure to support old versions of krb_sendauth! */ -extern int errno; - /* * krb_recvauth() reads (and optionally responds to) a message sent * using krb_sendauth(). The "options" argument is a bit-field of @@ -118,24 +120,14 @@ extern int errno; #endif /* max */ int -krb_recvauth(options, fd, ticket, service, instance, faddr, laddr, kdata, - filename, schedule, version) -long options; /* bit-pattern of options */ -int fd; /* file descr. to read from */ -KTEXT ticket; /* storage for client's ticket */ -char *service; /* service expected */ -char *instance; /* inst expected (may be filled in) */ -struct sockaddr_in *faddr; /* address of foreign host on fd */ -struct sockaddr_in *laddr; /* local address */ -AUTH_DAT *kdata; /* kerberos data (returned) */ -char *filename; /* name of file with service keys */ -Key_schedule schedule; /* key schedule (return) */ -char *version; /* version string (filled in) */ +krb_recvauth(long options, int fd, KTEXT ticket, char *service, char *instance, + struct sockaddr_in *faddr, struct sockaddr_in *laddr, AUTH_DAT *kdata, + char *filename, des_key_schedule schedule, char *version) { int i, cc, old_vers = 0; char krb_vers[KRB_SENDAUTH_VLEN + 1]; /* + 1 for the null terminator */ - char *cp; + char *cp = NULL; int rem; long tkt_len, priv_len; u_long cksum; @@ -250,7 +242,7 @@ char *version; /* version string (filled in) */ cksum = kdata->checksum + 1; cksum = htonl(cksum); #ifndef NOENCRYPTION - key_sched(kdata->session,schedule); + key_sched((des_cblock *)kdata->session,schedule); #endif priv_len = krb_mk_priv((unsigned char *)&cksum, tmp_buf, diff --git a/eBones/lib/libkrb/save_credentials.c b/eBones/lib/libkrb/save_credentials.c index 129c912..bec225f 100644 --- a/eBones/lib/libkrb/save_credentials.c +++ b/eBones/lib/libkrb/save_credentials.c @@ -5,13 +5,15 @@ * . * * from: save_credentials.c,v 4.9 89/05/31 17:45:43 jtkohl Exp $ - * $Id: save_credentials.c,v 1.2 1994/07/19 19:26:19 g89r4222 Exp $ + * $Id: save_credentials.c,v 1.3 1995/07/18 16:39:40 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: save_credentials.c,v 1.2 1994/07/19 19:26:19 g89r4222 Exp $"; +"$Id: save_credentials.c,v 1.3 1995/07/18 16:39:40 mark Exp $"; #endif /* lint */ +#endif #include #include @@ -28,16 +30,8 @@ static char *rcsid = * by the tf_init() or tf_save_cred() routines. */ -save_credentials(service, instance, realm, session, lifetime, kvno, - ticket, issue_date) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT ticket; /* The ticket itself */ - long issue_date; /* The issue time */ +int save_credentials(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date) { int tf_status; /* return values of the tf_util calls */ diff --git a/eBones/lib/libkrb/send_to_kdc.c b/eBones/lib/libkrb/send_to_kdc.c index 43f04a2..1e1da44 100644 --- a/eBones/lib/libkrb/send_to_kdc.c +++ b/eBones/lib/libkrb/send_to_kdc.c @@ -4,18 +4,22 @@ * . * * from: send_to_kdc.c,v 4.20 90/01/02 13:40:37 jtkohl Exp $ - * $Id: send_to_kdc.c,v 1.3 1995/01/25 06:37:33 gibbs Exp $ + * $Id: send_to_kdc.c,v 1.3 1995/07/18 16:39:42 mark Exp $ */ +#if 0 #ifndef lint static char rcsid_send_to_kdc_c[] = "$Id: send_to_kdc.c,v 1.1 1994/03/21 17:35:39 piero Exp "; #endif /* lint */ +#endif #include #include #include +#include +#include #include #include #include @@ -24,16 +28,12 @@ static char rcsid_send_to_kdc_c[] = #endif /* lint */ #include #include +#include #include #include #define S_AD_SZ sizeof(struct sockaddr_in) -extern int errno; -extern int krb_debug; - -extern char *malloc(), *calloc(), *realloc(); - int krb_udp_port = 0; /* CLIENT_KRB_TIMEOUT indicates the time to wait before @@ -41,7 +41,6 @@ int krb_udp_port = 0; */ static struct timeval timeout = { CLIENT_KRB_TIMEOUT, 0}; static char *prog = "send_to_kdc"; -static send_recv(); /* * This file contains two routines, send_to_kdc() and send_recv(). @@ -49,6 +48,85 @@ static send_recv(); */ /* + * try to send out and receive message. + * return 1 on success, 0 on failure + */ + +static int send_recv(KTEXT pkt, KTEXT rpkt, int f, struct sockaddr_in *_to, + struct hostent *addrs) +{ + fd_set readfds; + register struct hostent *hp; + struct sockaddr_in from; + int sin_size; + int numsent; + + if (krb_debug) { + if (_to->sin_family == AF_INET) + printf("Sending message to %s...", + inet_ntoa(_to->sin_addr)); + else + printf("Sending message..."); + (void) fflush(stdout); + } + if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, + (struct sockaddr *)_to, + S_AD_SZ)) != pkt->length) { + if (krb_debug) + printf("sent only %d/%d\n",numsent, pkt->length); + return 0; + } + if (krb_debug) { + printf("Sent\nWaiting for reply..."); + (void) fflush(stdout); + } + FD_ZERO(&readfds); + FD_SET(f, &readfds); + errno = 0; + /* select - either recv is ready, or timeout */ + /* see if timeout or error or wrong descriptor */ + if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 + || !FD_ISSET(f, &readfds)) { + if (krb_debug) { + fprintf(stderr, "select failed: readfds=%lx", + (unsigned long)&readfds); + perror(""); + } + return 0; + } + sin_size = sizeof(from); + if (recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, + (struct sockaddr *)&from, &sin_size) + < 0) { + if (krb_debug) + perror("recvfrom"); + return 0; + } + if (krb_debug) { + printf("received packet from %s\n", inet_ntoa(from.sin_addr)); + fflush(stdout); + } + for (hp = addrs; hp->h_name != (char *)NULL; hp++) { + if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, + hp->h_length)) { + if (krb_debug) { + printf("Received it\n"); + (void) fflush(stdout); + } + return 1; + } + if (krb_debug) + fprintf(stderr, + "packet not from %lx\n", + (unsigned long)hp->h_addr); + } + if (krb_debug) + fprintf(stderr, "%s: received packet from wrong host! (%lx)\n", + "send_to_kdc(send_rcv)", (unsigned long)from.sin_addr.s_addr); + return 0; +} + +/* * send_to_kdc() sends a message to the Kerberos authentication * server(s) in the given realm and returns the reply message. * The "pkt" argument points to the message to be sent to Kerberos; @@ -75,10 +153,7 @@ static send_recv(); * after several retries */ -send_to_kdc(pkt,rpkt,realm) - KTEXT pkt; - KTEXT rpkt; - char *realm; +int send_to_kdc(KTEXT pkt, KTEXT rpkt, char *realm) { int i, f; int no_host; /* was a kerberos host found? */ @@ -230,86 +305,3 @@ rtn: } return(retval); } - -/* - * try to send out and receive message. - * return 1 on success, 0 on failure - */ - -static send_recv(pkt,rpkt,f,_to,addrs) - KTEXT pkt; - KTEXT rpkt; - int f; - struct sockaddr_in *_to; - struct hostent *addrs; -{ - fd_set readfds; - register struct hostent *hp; - struct sockaddr_in from; - int sin_size; - int numsent; - - if (krb_debug) { - if (_to->sin_family == AF_INET) - printf("Sending message to %s...", - inet_ntoa(_to->sin_addr)); - else - printf("Sending message..."); - (void) fflush(stdout); - } - if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, - (struct sockaddr *)_to, - S_AD_SZ)) != pkt->length) { - if (krb_debug) - printf("sent only %d/%d\n",numsent, pkt->length); - return 0; - } - if (krb_debug) { - printf("Sent\nWaiting for reply..."); - (void) fflush(stdout); - } - FD_ZERO(&readfds); - FD_SET(f, &readfds); - errno = 0; - /* select - either recv is ready, or timeout */ - /* see if timeout or error or wrong descriptor */ - if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 - || !FD_ISSET(f, &readfds)) { - if (krb_debug) { - fprintf(stderr, "select failed: readfds=%x", - readfds); - perror(""); - } - return 0; - } - sin_size = sizeof(from); - if (recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, - (struct sockaddr *)&from, &sin_size) - < 0) { - if (krb_debug) - perror("recvfrom"); - return 0; - } - if (krb_debug) { - printf("received packet from %s\n", inet_ntoa(from.sin_addr)); - fflush(stdout); - } - for (hp = addrs; hp->h_name != (char *)NULL; hp++) { - if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, - hp->h_length)) { - if (krb_debug) { - printf("Received it\n"); - (void) fflush(stdout); - } - return 1; - } - if (krb_debug) - fprintf(stderr, - "packet not from %x\n", - hp->h_addr); - } - if (krb_debug) - fprintf(stderr, "%s: received packet from wrong host! (%x)\n", - "send_to_kdc(send_rcv)", from.sin_addr.s_addr); - return 0; -} diff --git a/eBones/lib/libkrb/sendauth.c b/eBones/lib/libkrb/sendauth.c index 7d798bb..add71d9 100644 --- a/eBones/lib/libkrb/sendauth.c +++ b/eBones/lib/libkrb/sendauth.c @@ -4,13 +4,15 @@ * . * * from: sendauth.c,v 4.6 90/03/10 23:18:28 jon Exp $ - * $Id: sendauth.c,v 1.2 1994/07/19 19:26:23 g89r4222 Exp $ + * $Id: sendauth.c,v 1.3 1995/07/18 16:39:44 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: sendauth.c,v 1.2 1994/07/19 19:26:23 g89r4222 Exp $"; +"$Id: sendauth.c,v 1.3 1995/07/18 16:39:44 mark Exp $"; #endif lint +#endif #include #include @@ -26,10 +28,6 @@ static char rcsid[] = * and make appropriate changes in krb_recvauth.c */ -extern int errno; - -extern char *krb_get_phost(); - /* * This file contains two routines: krb_sendauth() and krb_sendsrv(). * @@ -109,21 +107,10 @@ extern char *krb_get_phost(); * will disappear when krb_sendauth() returns. */ -int -krb_sendauth(options, fd, ticket, service, inst, realm, checksum, - msg_data, cred, schedule, laddr, faddr, version) -long options; /* bit-pattern of options */ -int fd; /* file descriptor to write onto */ -KTEXT ticket; /* where to put ticket (return); or - * supplied in case of KOPT_DONT_MK_REQ */ -char *service, *inst, *realm; /* service name, instance, realm */ -u_long checksum; /* checksum to include in request */ -MSG_DAT *msg_data; /* mutual auth MSG_DAT (return) */ -CREDENTIALS *cred; /* credentials (return) */ -Key_schedule schedule; /* key schedule (return) */ -struct sockaddr_in *laddr; /* local address */ -struct sockaddr_in *faddr; /* address of foreign host on fd */ -char *version; /* version string */ +int krb_sendauth(long options, int fd, KTEXT ticket, char *service, char *inst, + char *realm, u_long checksum, MSG_DAT *msg_data, CREDENTIALS *cred, + des_key_schedule schedule, struct sockaddr_in *laddr, + struct sockaddr_in *faddr, char *version) { int rem, i, cc; char srv_inst[INST_SZ]; @@ -168,7 +155,7 @@ char *version; /* version string */ /* if mutual auth, get credentials so we have service session keys for decryption below */ if (options & KOPT_DO_MUTUAL) - if (cc = krb_get_cred(service, srv_inst, realm, cred)) + if ((cc = krb_get_cred(service, srv_inst, realm, cred))) return(cc); /* zero the buffer */ @@ -211,10 +198,10 @@ char *version; /* version string */ /* ...and decrypt it */ #ifndef NOENCRYPTION - key_sched(cred->session,schedule); + key_sched((des_cblock *)cred->session,schedule); #endif - if (cc = krb_rd_priv(priv_buf,(unsigned long) tkt_len, schedule, - cred->session, faddr, laddr, msg_data)) + if ((cc = krb_rd_priv(priv_buf,(unsigned long) tkt_len, schedule, + cred->session, faddr, laddr, msg_data))) return(cc); /* fetch the (modified) checksum */ @@ -234,10 +221,7 @@ char *version; /* version string */ * krb_sendsvc */ -int -krb_sendsvc(fd, service) -int fd; -char *service; +int krb_sendsvc(int fd, char *service) { /* write the service name length and then the service name to the fd */ diff --git a/eBones/lib/libkrb/stime.c b/eBones/lib/libkrb/stime.c index c040374..f70c33d 100644 --- a/eBones/lib/libkrb/stime.c +++ b/eBones/lib/libkrb/stime.c @@ -5,13 +5,15 @@ * . * * from: stime.c,v 4.5 88/11/15 16:58:05 jtkohl Exp $ - * $Id: stime.c,v 1.2 1994/07/19 19:26:25 g89r4222 Exp $ + * $Id: stime.c,v 1.3 1995/07/18 16:39:46 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: stime.c,v 1.2 1994/07/19 19:26:25 g89r4222 Exp $"; +"$Id: stime.c,v 1.3 1995/07/18 16:39:46 mark Exp $"; #endif /* lint */ +#endif #include #include /* for sprintf() */ diff --git a/eBones/lib/libkrb/tf_shm.c b/eBones/lib/libkrb/tf_shm.c index f2f97ab..ad6690a 100644 --- a/eBones/lib/libkrb/tf_shm.c +++ b/eBones/lib/libkrb/tf_shm.c @@ -7,13 +7,15 @@ * contributed by Dan Kolkowitz (kolk@jessica.stanford.edu). * * from: tf_shm.c,v 4.2 89/10/25 23:26:46 qjb Exp $ - * $Id: tf_shm.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: tf_shm.c,v 1.3 1995/07/18 16:39:48 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: tf_shm.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: tf_shm.c,v 1.3 1995/07/18 16:39:48 mark Exp $"; #endif lint +#endif #include #include @@ -26,9 +28,6 @@ static char rcsid[] = #define MAX_BUFF sizeof(des_cblock)*1000 /* room for 1k keys */ -extern int errno; -extern int krb_debug; - /* * krb_create_shmtkt: * @@ -36,9 +35,7 @@ extern int krb_debug; * in the specified filename. */ -int -krb_shm_create(file_name) -char *file_name; +int krb_shm_create(char *file_name) { int retval; int shmid; @@ -136,8 +133,7 @@ int krb_is_diskless() * file pointing to it. */ -int krb_shm_dest(file) -char *file; +int krb_shm_dest(char *file) { int shmid; FILE *sfile; @@ -169,6 +165,3 @@ char *file; } else return(RET_TKFIL); /* XXX */ } - - - diff --git a/eBones/lib/libkrb/tf_util.c b/eBones/lib/libkrb/tf_util.c index cb4908e..ef91658 100644 --- a/eBones/lib/libkrb/tf_util.c +++ b/eBones/lib/libkrb/tf_util.c @@ -4,15 +4,19 @@ * . * * from: tf_util.c,v 4.9 90/03/10 19:19:45 jon Exp $ - * $Id: tf_util.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: tf_util.c,v 1.3 1995/07/18 16:39:50 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: tf_util.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: tf_util.c,v 1.3 1995/07/18 16:39:50 mark Exp $"; #endif /* lint */ +#endif #include +#include +#include #include #include #include @@ -29,9 +33,6 @@ static char rcsid[] = #define TF_LCK_RETRY ((unsigned)2) /* seconds to sleep before * retry if ticket file is * locked */ -extern errno; -extern int krb_debug; - #ifdef TKT_SHMEM char *krb_shm_addr = 0; static char *tmp_shm_addr = 0; @@ -53,9 +54,9 @@ char *shmat(); * c. In tf_close, be sure it gets reinitialized to a negative * number. */ -static fd = -1; -static curpos; /* Position in tfbfr */ -static lastpos; /* End of tfbfr */ +static int fd = -1; +static int curpos; /* Position in tfbfr */ +static int lastpos; /* End of tfbfr */ static char tfbfr[BUFSIZ]; /* Buffer for ticket data */ static tf_gets(), tf_read(); @@ -122,8 +123,7 @@ static tf_gets(), tf_read(); * TKT_FIL_LCK - couldn't lock the file, even after a retry */ -tf_init(tf_name, rw) - char *tf_name; +int tf_init(char *tf_name, int rw) { int wflag; uid_t me, getuid(); @@ -259,8 +259,7 @@ tf_init(tf_name, rw) * was longer than ANAME_SZ, TKT_FIL_FMT is returned. */ -tf_get_pname(p) - char *p; +int tf_get_pname(char *p) { if (fd < 0) { if (krb_debug) @@ -282,8 +281,7 @@ tf_get_pname(p) * instance may be null. */ -tf_get_pinst(inst) - char *inst; +int tf_get_pinst(char *inst) { if (fd < 0) { if (krb_debug) @@ -296,6 +294,33 @@ tf_get_pinst(inst) } /* + * tf_close() closes the ticket file and sets "fd" to -1. If "fd" is + * not a valid file descriptor, it just returns. It also clears the + * buffer used to read tickets. + * + * The return value is not defined. + */ + +void tf_close() +{ + if (!(fd < 0)) { +#ifdef TKT_SHMEM + if (shmdt(krb_shm_addr)) { + /* what kind of error? */ + if (krb_debug) + fprintf(stderr, "shmdt 0x%x: errno %d",krb_shm_addr, errno); + } else { + krb_shm_addr = 0; + } +#endif TKT_SHMEM + (void) flock(fd, LOCK_UN); + (void) close(fd); + fd = -1; /* see declaration of fd above */ + } + bzero(tfbfr, sizeof(tfbfr)); +} + +/* * tf_get_cred() reads a CREDENTIALS record from a ticket file and fills * in the given structure "c". It should only be called after tf_init(), * tf_get_pname(), and tf_get_pinst() have been called. If all goes well, @@ -306,8 +331,7 @@ tf_get_pinst(inst) * EOF - end of file encountered */ -tf_get_cred(c) - CREDENTIALS *c; +int tf_get_cred(CREDENTIALS *c) { KTEXT ticket = &c->ticket_st; /* pointer to ticket */ int k_errno; @@ -364,33 +388,6 @@ tf_get_cred(c) } /* - * tf_close() closes the ticket file and sets "fd" to -1. If "fd" is - * not a valid file descriptor, it just returns. It also clears the - * buffer used to read tickets. - * - * The return value is not defined. - */ - -tf_close() -{ - if (!(fd < 0)) { -#ifdef TKT_SHMEM - if (shmdt(krb_shm_addr)) { - /* what kind of error? */ - if (krb_debug) - fprintf(stderr, "shmdt 0x%x: errno %d",krb_shm_addr, errno); - } else { - krb_shm_addr = 0; - } -#endif TKT_SHMEM - (void) flock(fd, LOCK_UN); - (void) close(fd); - fd = -1; /* see declaration of fd above */ - } - bzero(tfbfr, sizeof(tfbfr)); -} - -/* * tf_gets() is an internal routine. It takes a string "s" and a count * "n", and reads from the file until either it has read "n" characters, * or until it reads a null byte. When finished, what has been read exists @@ -408,9 +405,7 @@ tf_close() * file is seriously ill. */ -static -tf_gets(s, n) - register char *s; +static int tf_gets(char *s, int n) { register count; @@ -449,12 +444,9 @@ tf_gets(s, n) * 0 on end of file or read error */ -static -tf_read(s, n) - register char *s; - register n; +static int tf_read(char *s, int n) { - register count; + int count; for (count = n; count > 0; --count) { if (curpos >= sizeof(tfbfr)) { @@ -486,16 +478,8 @@ char *tkt_string(); * called previously, and KFAILURE for anything else that went wrong. */ -tf_save_cred(service, instance, realm, session, lifetime, kvno, - ticket, issue_date) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT ticket; /* The ticket itself */ - long issue_date; /* The issue time */ +int tf_save_cred(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date) { off_t lseek(); diff --git a/eBones/lib/libkrb/tkt_string.c b/eBones/lib/libkrb/tkt_string.c index ba22db8..bbbdbc5 100644 --- a/eBones/lib/libkrb/tkt_string.c +++ b/eBones/lib/libkrb/tkt_string.c @@ -5,22 +5,23 @@ * . * * from: tkt_string.c,v 4.6 89/01/05 12:31:51 raeburn Exp $ - * $Id: tkt_string.c,v 1.2 1994/07/19 19:26:29 g89r4222 Exp $ + * $Id: tkt_string.c,v 1.3 1995/07/18 16:39:52 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: tkt_string.c,v 1.2 1994/07/19 19:26:29 g89r4222 Exp $"; +"$Id: tkt_string.c,v 1.3 1995/07/18 16:39:52 mark Exp $"; #endif /* lint */ +#endif #include +#include #include #include #include #include -char *getenv(); - /* * This routine is used to generate the name of the file that holds * the user's cache of server tickets and associated session keys. @@ -43,14 +44,14 @@ char *tkt_string() uid_t getuid(); if (!*krb_ticket_string) { - if (env = getenv("KRBTKFILE")) { + if ((env = getenv("KRBTKFILE"))) { (void) strncpy(krb_ticket_string, env, sizeof(krb_ticket_string)-1); krb_ticket_string[sizeof(krb_ticket_string)-1] = '\0'; } else { /* 32 bits of signed integer will always fit in 11 characters (including the sign), so no need to worry about overflow */ - (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,getuid()); + (void) sprintf(krb_ticket_string, "%s%ld",TKT_ROOT,getuid()); } } return krb_ticket_string; @@ -67,9 +68,7 @@ char *tkt_string() * and return an undesired ticket file name until this routine is called. */ -void -krb_set_tkt_string(val) -char *val; +void krb_set_tkt_string(char *val) { (void) strncpy(krb_ticket_string, val, sizeof(krb_ticket_string)-1); diff --git a/eBones/lib/libkrb/util.c b/eBones/lib/libkrb/util.c index 8e48557..8dca743 100644 --- a/eBones/lib/libkrb/util.c +++ b/eBones/lib/libkrb/util.c @@ -6,13 +6,15 @@ * Miscellaneous debug printing utilities * * from: util.c,v 4.8 89/01/17 22:02:08 wesommer Exp $ - * $Id: util.c,v 1.2 1994/07/19 19:26:31 g89r4222 Exp $ + * $Id: util.c,v 1.3 1995/07/18 16:39:54 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: util.c,v 1.2 1994/07/19 19:26:31 g89r4222 Exp $"; +"$Id: util.c,v 1.3 1995/07/18 16:39:54 mark Exp $"; #endif lint +#endif #include #include @@ -28,14 +30,13 @@ static char rcsid[] = * pname, pinst, prealm, netaddr, flags, cksum, timestamp, session */ -ad_print(x) -AUTH_DAT *x; +void ad_print(AUTH_DAT *x) { struct in_addr in; /* Print the contents of an auth_dat struct. */ in.s_addr = x->address; - printf("\n%s %s %s %s flags %u cksum 0x%X\n\ttkt_tm 0x%X sess_key", + printf("\n%s %s %s %s flags %u cksum 0x%lX\n\ttkt_tm 0x%lX sess_key", x->pname, x->pinst, x->prealm, inet_ntoa(in), x->k_flags, x->checksum, x->time_sec); @@ -43,7 +44,7 @@ AUTH_DAT *x; #ifdef NOENCRYPTION placebo_cblock_print(x->session); #else - des_cblock_print_file(x->session,stdout); + des_cblock_print_file((des_cblock *)x->session,stdout); #endif /* skip reply for now */ } diff --git a/eBones/libexec/kpropd/Makefile b/eBones/libexec/kpropd/Makefile index 74d774f..8cc6673 100644 --- a/eBones/libexec/kpropd/Makefile +++ b/eBones/libexec/kpropd/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id$ +# $Id: Makefile,v 1.1.1.1 1995/08/03 07:37:19 mark Exp $ PROG= kpropd CFLAGS+=-I${.CURDIR}/../include -I${.CURDIR}/../kprop diff --git a/eBones/libexec/kpropd/kpropd.c b/eBones/libexec/kpropd/kpropd.c index db99ae0..037d913 100644 --- a/eBones/libexec/kpropd/kpropd.c +++ b/eBones/libexec/kpropd/kpropd.c @@ -10,8 +10,8 @@ * adapted from the MIT distribution to work properly in a 4.4BSD * environment. * - * $Revision: 4.5 $ $Date: 92/10/23 15:45:46 $ $State: Exp $ - * $Source$ + * $Revision: 1.1.1.1 $ $Date: 1995/08/03 07:37:19 $ $State: Exp $ + * $Source: /usr/cvs/src/eBones/kpropd/kpropd.c,v $ * * Log: kpropd.c,v * Revision 4.5 92/10/23 15:45:46 tytso Make it possible @@ -38,7 +38,7 @@ #ifndef lint static char rcsid_kpropd_c[] = -"$Header: /afs/net.mit.edu/project/krb4/src/slave/RCS/kpropd.c,v 4.5 92/10/23 15:45:46 tytso Exp $"; +"$Header: /usr/cvs/src/eBones/kpropd/kpropd.c,v 1.1.1.1 1995/08/03 07:37:19 mark Exp $"; #endif /* lint */ #include diff --git a/eBones/libexec/registerd/Makefile b/eBones/libexec/registerd/Makefile index bc91577..5f12e59 100644 --- a/eBones/libexec/registerd/Makefile +++ b/eBones/libexec/registerd/Makefile @@ -6,7 +6,7 @@ # # @(#)Makefile 8.1 (Berkeley) 6/1/93 # -# $Id: Makefile,v 1.3 1994/07/20 09:20:51 g89r4222 Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:41:24 mark Exp $ PROG= registerd SRCS= registerd.c diff --git a/eBones/libexec/registerd/registerd.c b/eBones/libexec/registerd/registerd.c index 65a8a49..b5c7434 100644 --- a/eBones/libexec/registerd/registerd.c +++ b/eBones/libexec/registerd/registerd.c @@ -49,7 +49,8 @@ static char sccsid[] = "@(#)registerd.c 8.1 (Berkeley) 6/1/93"; #include #include #include -#include +#include +#include #include #include #include diff --git a/eBones/libkadm/Makefile b/eBones/libkadm/Makefile index f587d5c..4642530 100644 --- a/eBones/libkadm/Makefile +++ b/eBones/libkadm/Makefile @@ -1,9 +1,9 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:40:20 mark Exp $ LIB= kadm SRCS= kadm_err.c kadm_stream.c kadm_supp.c kadm_cli_wrap.c -CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../include -I${KRBOBJDIR} -DPOSIX +CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../include -I${KRBOBJDIR} -DPOSIX -Wall CLEANFILES+= kadm_err.c kadm_err.h kadm_err.c kadm_err.h: kadm_err.et diff --git a/eBones/libkadm/kadm.h b/eBones/libkadm/kadm.h index 965b530..eea05df 100644 --- a/eBones/libkadm/kadm.h +++ b/eBones/libkadm/kadm.h @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/libkadm/kadm.h,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/libkadm/kadm.h,v $ + * $Author: mark $ * Header: /afs/athena.mit.edu/astaff/project/kerberos/src/include/RCS/kadm.h,v 4.2 89/09/26 09:15:20 jtkohl Exp * * Copyright 1988 by the Massachusetts Institute of Technology. @@ -25,6 +25,7 @@ #define MAXHOSTNAMELEN 64 #endif +#include #include #include #include @@ -121,20 +122,27 @@ MODACL #define MOD_ENT 4 #define GET_ENT 5 -extern long kdb_get_master_key(); /* XXX should be in krb_db.h */ -extern long kdb_verify_master_key(); /* XXX ditto */ - -extern long krb_mk_priv(), krb_rd_priv(); /* XXX should be in krb.h */ -extern void krb_set_tkt_string(); /* XXX ditto */ - -extern unsigned long quad_cksum(); /* XXX should be in des.h */ - /* XXX This doesn't belong here!!! */ -char *malloc(), *realloc(); #ifdef POSIX typedef void sigtype; #else typedef int sigtype; #endif +int vals_to_stream(Kadm_vals *dt_in, u_char **dt_out); +int stream_to_vals(u_char *dt_in, Kadm_vals *dt_out, int maxlen); + +int build_field_header(u_char *cont, u_char **st); +int check_field_header(u_char *st, u_char *cont, int maxlen); + +int stv_string(u_char *st, char *dat, int loc, int stlen, int maxlen); +int stv_short(u_char *st, u_short *dat, int loc, int maxlen); +int stv_long(u_char *st, u_long *dat, int loc, int maxlen); +int stv_char(u_char *st, u_char *dat, int loc, int maxlen); + +int vts_string(char *dat, u_char **st, int loc); +int vts_short(u_short dat, u_char **st, int loc); +int vts_long(u_long dat, u_char **st, int loc); +int vts_char(u_char dat, u_char **st, int loc); + #endif KADM_DEFS diff --git a/eBones/libkadm/kadm_cli_wrap.c b/eBones/libkadm/kadm_cli_wrap.c index 7e1cfa9..3522e74 100644 --- a/eBones/libkadm/kadm_cli_wrap.c +++ b/eBones/libkadm/kadm_cli_wrap.c @@ -7,20 +7,22 @@ * Kerberos administration server client-side routines */ -#ifndef lint #if 0 +#ifndef lint static char rcsid_kadm_cli_wrap_c[] = "from: Id: kadm_cli_wrap.c,v 4.6 89/12/30 20:09:45 qjb Exp"; -#endif static const char rcsid[] = - "$Id: kadm_cli_wrap.c,v 1.1 1995/01/20 02:02:51 wollman Exp $"; + "$Id: kadm_cli_wrap.c,v 1.1 1995/07/18 16:40:23 mark Exp $"; #endif lint +#endif /* * kadm_cli_wrap.c the client side wrapping of the calls to the admin server */ #include +#include +#include #include #include #include @@ -29,6 +31,12 @@ static const char rcsid[] = #include #include +int kadm_cli_out(u_char *dat, int dat_len, u_char **ret_dat, int *ret_siz); +int kadm_cli_send(u_char *st_dat, int st_siz, u_char **ret_dat, int *ret_siz); +int kadm_cli_keyd(des_cblock *s_k, des_key_schedule s_s); +int kadm_cli_conn(void); +void kadm_cli_disconn(void); + #ifndef NULL #define NULL 0 #endif @@ -42,8 +50,7 @@ static Kadm_Client client_parm; static des_cblock sess_key; /* to be filled in by kadm_cli_keyd */ static Key_schedule sess_sched; -static -clear_secrets() +static void clear_secrets() { bzero((char *)sess_key, sizeof(sess_key)); bzero((char *)sess_sched, sizeof(sess_sched)); @@ -58,10 +65,7 @@ clear_secrets() * data about the connection between the server and client, the services * used, the locations and other fun things */ -kadm_init_link(n, i, r) -char n[]; -char i[]; -char r[]; +int kadm_init_link(char n[], char i[], char r[]) { struct servent *sep; /* service we will talk to */ struct hostent *hop; /* host we will talk to */ @@ -100,8 +104,7 @@ char r[]; * key. Returns no actual data from the master server, since this is called * by a user */ -kadm_change_pw(newkey) -des_cblock newkey; /* The DES form of the users key */ +int kadm_change_pw(des_cblock newkey) { int stsize, retc; /* stream size and return code */ u_char *send_st; /* send stream */ @@ -145,8 +148,7 @@ des_cblock newkey; /* The DES form of the users key */ * entry, so if you leave certain fields blank you will be able to determine * the default values they are set to */ -kadm_add(vals) -Kadm_vals *vals; +int kadm_add(Kadm_vals *vals) { u_char *st, *st2; /* st will hold the stream of values */ int st_len; /* st2 the final stream with opcode */ @@ -182,9 +184,7 @@ Kadm_vals *vals; * Modifies all entries corresponding to the first values so they match the * second values. returns the values for the changed entries in vals2 */ -kadm_mod(vals1, vals2) -Kadm_vals *vals1; -Kadm_vals *vals2; +int kadm_mod(Kadm_vals *vals1, Kadm_vals *vals2) { u_char *st, *st2; /* st will hold the stream of values */ int st_len, nlen; /* st2 the final stream with opcode */ @@ -228,10 +228,7 @@ Kadm_vals *vals2; * this data for each matching recipient, after a count of how many such * matches there were */ -kadm_get(vals, fl) -Kadm_vals *vals; -u_char fl[4]; - +int kadm_get(Kadm_vals *vals, u_char fl[4]) { int loop; /* for copying the fields data */ u_char *st, *st2; /* st will hold the stream of values */ @@ -279,11 +276,7 @@ u_char fl[4]; * connection to the admin server. If the connection is succesfully open * then it sends the data and waits for a reply. */ -kadm_cli_send(st_dat, st_siz, ret_dat, ret_siz) -u_char *st_dat; /* the actual data */ -int st_siz; /* length of said data */ -u_char **ret_dat; /* to give return info */ -int *ret_siz; /* length of returned info */ +int kadm_cli_send(u_char *st_dat, int st_siz, u_char **ret_dat, int *ret_siz) { int act_len, retdat; /* current offset into packet, return * data */ @@ -299,7 +292,7 @@ int *ret_siz; /* length of returned info */ (void) strncpy((char *)act_st, KADM_VERSTR, KADM_VERSIZE); act_len = KADM_VERSIZE; - if ((retdat = kadm_cli_keyd(sess_key, sess_sched)) != KADM_SUCCESS) { + if ((retdat = kadm_cli_keyd(&sess_key, sess_sched)) != KADM_SUCCESS) { free((char *)act_st); return retdat; /* couldnt get key working */ } @@ -318,11 +311,11 @@ int *ret_siz; /* length of returned info */ #ifdef NOENCRYPTION cksum = 0; #else - cksum = quad_cksum(priv_pak, (u_long *)0, (long)priv_len, 0, - sess_key); + cksum = quad_cksum((des_cblock *)priv_pak, (des_cblock *)0, + (long)priv_len, 0, &sess_key); #endif - if (retdat = krb_mk_req(&authent, client_parm.sname, client_parm.sinst, - client_parm.krbrlm, (long)cksum)) { + if ((retdat = krb_mk_req(&authent, client_parm.sname, client_parm.sinst, + client_parm.krbrlm, (long)cksum))) { /* authenticator? */ RET_N_FREE(retdat + krb_err_base); } @@ -359,9 +352,9 @@ int *ret_siz; /* length of returned info */ RET_N_FREE2(retdat); } /* need to decode the ret_dat */ - if (retdat = krb_rd_priv(*ret_dat, (u_long)*ret_siz, sess_sched, + if ((retdat = krb_rd_priv(*ret_dat, (u_long)*ret_siz, sess_sched, sess_key, &client_parm.admin_addr, - &client_parm.my_addr, &mdat)) + &client_parm.my_addr, &mdat))) RET_N_FREE2(retdat+krb_err_base); if (mdat.app_length < KADM_VERSIZE + 4) /* too short! */ @@ -386,23 +379,21 @@ int *ret_siz; /* length of returned info */ } /* takes in the sess_key and key_schedule and sets them appropriately */ -kadm_cli_keyd(s_k, s_s) -des_cblock s_k; /* session key */ -des_key_schedule s_s; /* session key schedule */ +int kadm_cli_keyd(des_cblock *s_k, des_key_schedule s_s) { CREDENTIALS cred; /* to get key data */ int stat; /* want .sname and .sinst here.... */ - if (stat = krb_get_cred(client_parm.sname, client_parm.sinst, - client_parm.krbrlm, &cred)) + if ((stat = krb_get_cred(client_parm.sname, client_parm.sinst, + client_parm.krbrlm, &cred))) return stat + krb_err_base; bcopy((char *) cred.session, (char *) s_k, sizeof(des_cblock)); bzero((char *) cred.session, sizeof(des_cblock)); #ifdef NOENCRYPTION bzero(s_s, sizeof(des_key_schedule)); #else - if (stat = key_sched(s_k,s_s)) + if ((stat = key_sched(s_k,s_s))) return(stat+krb_err_base); #endif return KADM_SUCCESS; @@ -410,7 +401,7 @@ des_key_schedule s_s; /* session key schedule */ static sigtype (*opipe)(); -kadm_cli_conn() +int kadm_cli_conn() { /* this connects and sets my_addr */ int on = 1; @@ -444,20 +435,15 @@ kadm_cli_conn() return KADM_SUCCESS; } -kadm_cli_disconn() +void kadm_cli_disconn() { (void) close(client_parm.admin_fd); (void) signal(SIGPIPE, opipe); return; } -kadm_cli_out(dat, dat_len, ret_dat, ret_siz) -u_char *dat; -int dat_len; -u_char **ret_dat; -int *ret_siz; +int kadm_cli_out(u_char *dat, int dat_len, u_char **ret_dat, int *ret_siz) { - extern int errno; u_short dlen; int retval; @@ -474,8 +460,8 @@ int *ret_siz; if (krb_net_write(client_parm.admin_fd, (char *) dat, dat_len) < 0) return (errno); /* XXX */ - if (retval = krb_net_read(client_parm.admin_fd, (char *) &dlen, - sizeof(u_short)) != sizeof(u_short)) { + if ((retval = krb_net_read(client_parm.admin_fd, (char *) &dlen, + sizeof(u_short))) != sizeof(u_short)) { if (retval < 0) return(errno); /* XXX */ else @@ -487,8 +473,8 @@ int *ret_siz; if (!*ret_dat) return(KADM_NOMEM); - if (retval = krb_net_read(client_parm.admin_fd, (char *) *ret_dat, - (int) dlen) != dlen) { + if ((retval = krb_net_read(client_parm.admin_fd, (char *) *ret_dat, + (int) dlen)) != dlen) { if (retval < 0) return(errno); /* XXX */ else diff --git a/eBones/libkadm/kadm_err.et b/eBones/libkadm/kadm_err.et index 9a04851..e45a9c2 100644 --- a/eBones/libkadm/kadm_err.et +++ b/eBones/libkadm/kadm_err.et @@ -1,6 +1,6 @@ -# $Source: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_err.et,v $ -# $Author: jtkohl $ -# $Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_err.et,v 4.0 89/01/24 15:16:10 jtkohl Exp $ +# $Source: /usr/cvs/src/eBones/libkadm/kadm_err.et,v $ +# $Author: mark $ +# $Header: /usr/cvs/src/eBones/libkadm/kadm_err.et,v 1.1 1995/07/18 16:40:25 mark Exp $ # Copyright 1988 by the Massachusetts Institute of Technology. # # For copying and distribution information, please see the file @@ -12,7 +12,7 @@ # KADM_SUCCESS, as all success codes should be, is zero -ec KADM_RCSID, "$Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_err.et,v 4.0 89/01/24 15:16:10 jtkohl Exp $" +ec KADM_RCSID, "$Header: /usr/cvs/src/eBones/libkadm/kadm_err.et,v 1.1 1995/07/18 16:40:25 mark Exp $" # /* Building and unbuilding the packet errors */ ec KADM_NO_REALM, "Cannot fetch local realm" ec KADM_NO_CRED, "Unable to fetch credentials" diff --git a/eBones/libkadm/kadm_stream.c b/eBones/libkadm/kadm_stream.c index 6ceb02e..02b8263 100644 --- a/eBones/libkadm/kadm_stream.c +++ b/eBones/libkadm/kadm_stream.c @@ -7,14 +7,14 @@ * Stream conversion functions for Kerberos administration server */ -#ifndef lint #if 0 +#ifndef lint static char rcsid_kadm_stream_c[] = "Header: /afs/athena.mit.edu/astaff/project/kerberos/src/lib/kadm/RCS/kadm_stream.c,v 4.2 89/09/26 09:20:48 jtkohl Exp "; -#endif static const char rcsid[] = - "$Id: kadm_stream.c,v 1.1 1995/01/20 02:02:53 wollman Exp $"; + "$Id: kadm_stream.c,v 1.1 1995/07/18 16:40:27 mark Exp $"; #endif lint +#endif /* kadm_stream.c @@ -28,6 +28,7 @@ static const char rcsid[] = fatal: prints out a kadm fatal error message, exits */ +#include #include "kadm.h" #define min(a,b) (((a) < (b)) ? (a) : (b)) @@ -39,9 +40,7 @@ vals_to_stream this function creates a byte-stream representation of the kadm_vals structure */ -vals_to_stream(dt_in, dt_out) -Kadm_vals *dt_in; -u_char **dt_out; +int vals_to_stream(Kadm_vals *dt_in, u_char **dt_out) { int vsloop, stsize; /* loop counter, stream size */ @@ -75,29 +74,21 @@ u_char **dt_out; return(stsize); } -build_field_header(cont, st) -u_char *cont; /* container for fields data */ -u_char **st; /* stream */ +int build_field_header(u_char *cont, u_char **st) { *st = (u_char *) malloc (4); bcopy((char *) cont, (char *) *st, 4); return 4; /* return pointer to current stream location */ } -vts_string(dat, st, loc) -char *dat; /* a string to put on the stream */ -u_char **st; /* base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_string(char *dat, u_char **st, int loc) { *st = (u_char *) realloc ((char *)*st, (unsigned) (loc + strlen(dat) + 1)); bcopy(dat, (char *)(*st + loc), strlen(dat)+1); return strlen(dat)+1; } -vts_short(dat, st, loc) -u_short dat; /* the attributes field */ -u_char **st; /* a base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_short(u_short dat, u_char **st, int loc) { u_short temp; /* to hold the net order short */ @@ -107,10 +98,7 @@ int loc; /* offset into the stream for current data */ return sizeof(u_short); } -vts_long(dat, st, loc) -u_long dat; /* the attributes field */ -u_char **st; /* a base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_long(u_long dat, u_char **st, int loc) { u_long temp; /* to hold the net order short */ @@ -121,10 +109,7 @@ int loc; /* offset into the stream for current data */ } -vts_char(dat, st, loc) -u_char dat; /* the attributes field */ -u_char **st; /* a base pointer to the stream */ -int loc; /* offset into the stream for current data */ +int vts_char(u_char dat, u_char **st, int loc) { *st = (u_char *) realloc ((char *)*st, (unsigned)(loc + sizeof(u_char))); (*st)[loc] = (u_char) dat; @@ -138,10 +123,7 @@ stream_to_vals this decodes a byte stream represntation of a vals struct into kadm_vals */ -stream_to_vals(dt_in, dt_out, maxlen) -u_char *dt_in; -Kadm_vals *dt_out; -int maxlen; /* max length to use */ +int stream_to_vals(u_char *dt_in, Kadm_vals *dt_out, int maxlen) { register int vsloop, stsize; /* loop counter, stream size */ register int status; @@ -200,10 +182,7 @@ int maxlen; /* max length to use */ return stsize; } -check_field_header(st, cont, maxlen) -u_char *st; /* stream */ -u_char *cont; /* container for fields data */ -int maxlen; +int check_field_header(u_char *st, u_char *cont, int maxlen) { if (4 > maxlen) return(-1); @@ -211,12 +190,7 @@ int maxlen; return 4; /* return pointer to current stream location */ } -stv_string(st, dat, loc, stlen, maxlen) -register u_char *st; /* base pointer to the stream */ -char *dat; /* a string to read from the stream */ -register int loc; /* offset into the stream for current data */ -int stlen; /* max length of string to copy in */ -int maxlen; /* max length of input stream */ +int stv_string(u_char *st, char *dat, int loc, int stlen, int maxlen) { int maxcount; /* max count of chars to copy */ @@ -229,11 +203,7 @@ int maxlen; /* max length of input stream */ return strlen(dat)+1; } -stv_short(st, dat, loc, maxlen) -u_char *st; /* a base pointer to the stream */ -u_short *dat; /* the attributes field */ -int loc; /* offset into the stream for current data */ -int maxlen; +int stv_short(u_char *st, u_short *dat, int loc, int maxlen) { u_short temp; /* to hold the net order short */ @@ -244,11 +214,7 @@ int maxlen; return sizeof(u_short); } -stv_long(st, dat, loc, maxlen) -u_char *st; /* a base pointer to the stream */ -u_long *dat; /* the attributes field */ -int loc; /* offset into the stream for current data */ -int maxlen; /* maximum length of st */ +int stv_long(u_char *st, u_long *dat, int loc, int maxlen) { u_long temp; /* to hold the net order short */ @@ -259,15 +225,10 @@ int maxlen; /* maximum length of st */ return sizeof(u_long); } -stv_char(st, dat, loc, maxlen) -u_char *st; /* a base pointer to the stream */ -u_char *dat; /* the attributes field */ -int loc; /* offset into the stream for current data */ -int maxlen; +int stv_char(u_char *st, u_char *dat, int loc, int maxlen) { if (loc + 1 > maxlen) return(-1); *dat = *(st + loc); return 1; } - diff --git a/eBones/libkadm/kadm_supp.c b/eBones/libkadm/kadm_supp.c index 8b18621..deaf63b 100644 --- a/eBones/libkadm/kadm_supp.c +++ b/eBones/libkadm/kadm_supp.c @@ -7,14 +7,14 @@ * Support functions for Kerberos administration server & clients */ -#ifndef lint #if 0 +#ifndef lint static char rcsid_kadm_supp_c[] = "Header: /afs/athena.mit.edu/astaff/project/kerberos/src/lib/kadm/RCS/kadm_supp.c,v 4.1 89/09/26 09:21:07 jtkohl Exp "; -#endif static const char rcsid[] = - "$Id: kadm_supp.c,v 1.1 1995/01/20 02:02:54 wollman Exp $"; + "$Id: kadm_supp.c,v 1.1 1995/07/18 16:40:28 mark Exp $"; #endif lint +#endif /* kadm_supp.c @@ -26,6 +26,8 @@ static const char rcsid[] = structure */ +#include +#include #include "kadm.h" #include "krb_db.h" @@ -33,19 +35,17 @@ static const char rcsid[] = prin_vals: recieves : a vals structure */ -prin_vals(vals) -Kadm_vals *vals; +void prin_vals(Kadm_vals *vals) { printf("Info in Database for %s.%s:\n", vals->name, vals->instance); printf(" Max Life: %d Exp Date: %s\n",vals->max_life, asctime(localtime((long *)&vals->exp_date))); - printf(" Attribs: %.2x key: %u %u\n",vals->attributes, + printf(" Attribs: %.2x key: %lu %lu\n",vals->attributes, vals->key_low, vals->key_high); } #ifdef notdef -nierror(s) -int s; +int nierror(int s) { extern char *error_message(); printf("Kerberos admin server loses..... %s\n",error_message(s)); @@ -57,10 +57,7 @@ int s; it copies the fields in Principal specified by fields into Kadm_vals, i.e from old to new */ -kadm_prin_to_vals(fields, new, old) -u_char fields[FLDSZ]; -Kadm_vals *new; -Principal *old; +void kadm_prin_to_vals(u_char fields[], Kadm_vals *new, Principal *old) { bzero((char *)new, sizeof(*new)); if (IS_FIELD(KADM_NAME,fields)) { @@ -90,10 +87,7 @@ Principal *old; } } -kadm_vals_to_prin(fields, new, old) -u_char fields[FLDSZ]; -Principal *new; -Kadm_vals *old; +void kadm_vals_to_prin(u_char fields[], Principal *new, Kadm_vals *old) { bzero((char *)new, sizeof(*new)); diff --git a/eBones/make_keypair/make_keypair.c b/eBones/make_keypair/make_keypair.c index c9883ed..5cc1777 100644 --- a/eBones/make_keypair/make_keypair.c +++ b/eBones/make_keypair/make_keypair.c @@ -46,12 +46,11 @@ static char sccsid[] = "@(#)make_keypair.c 8.1 (Berkeley) 6/1/93"; #include #include #include -#include +#include #include #include "pathnames.h" #include "register_proto.h" -extern void random_key(), herror(); void make_key(), usage(); char * progname; diff --git a/eBones/passwd/kpasswd.c b/eBones/passwd/kpasswd.c index 2425bed..56e76a3 100644 --- a/eBones/passwd/kpasswd.c +++ b/eBones/passwd/kpasswd.c @@ -13,7 +13,7 @@ static char rcsid_kpasswd_c[] = "BonesHeader: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kpasswd.c,v 4.3 89/09/26 09:33:02 jtkohl Exp "; #endif static const char rcsid[] = - "$Id: kpasswd.c,v 1.1 1995/01/20 22:14:14 wollman Exp $"; + "$Id: kpasswd.c,v 1.1 1995/07/18 16:41:20 mark Exp $"; #endif lint /* diff --git a/eBones/patchlevel.h b/eBones/patchlevel.h index 836f08e..87e5061 100644 --- a/eBones/patchlevel.h +++ b/eBones/patchlevel.h @@ -1,5 +1,5 @@ /*- - * $Id: patchlevel.h,v 1.2 1994/07/19 19:21:10 g89r4222 Exp $ + * $Id: patchlevel.h,v 1.3 1995/07/18 16:34:26 mark Exp $ */ #define PATCHLEVEL 9 diff --git a/eBones/register/Makefile b/eBones/register/Makefile index 3ab09c3..909569bb 100644 --- a/eBones/register/Makefile +++ b/eBones/register/Makefile @@ -1,5 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/1/93 -# $Id: Makefile,v 1.4 1994/07/20 09:21:07 g89r4222 Exp $ +# $Id: Makefile,v 1.5 1995/07/18 16:41:22 mark Exp $ PROG= register SRCS= register.c diff --git a/eBones/register/register.c b/eBones/register/register.c index d20f848..3f3cbbf 100644 --- a/eBones/register/register.c +++ b/eBones/register/register.c @@ -52,13 +52,13 @@ static char sccsid[] = "@(#)register.c 8.1 (Berkeley) 6/1/93"; #include #include #include -#include +#include #include #include "pathnames.h" #include "register_proto.h" -#define SERVICE "krbupdate" /* service to add to KDC's database */ -#define PROTO "tcp" +#define SERVICE "krbupdate" /* service to add to KDC's database */ +#define PROTOCOL "tcp" char realm[REALM_SZ]; char krbhst[MAX_HSTNM]; @@ -90,7 +90,7 @@ main(argc, argv) exit(1); } - if ((se = getservbyname(SERVICE, PROTO)) == NULL) { + if ((se = getservbyname(SERVICE, PROTOCOL)) == NULL) { fprintf(stderr, "couldn't find entry for service %s\n", SERVICE); exit(1); diff --git a/eBones/registerd/Makefile b/eBones/registerd/Makefile index bc91577..5f12e59 100644 --- a/eBones/registerd/Makefile +++ b/eBones/registerd/Makefile @@ -6,7 +6,7 @@ # # @(#)Makefile 8.1 (Berkeley) 6/1/93 # -# $Id: Makefile,v 1.3 1994/07/20 09:20:51 g89r4222 Exp $ +# $Id: Makefile,v 1.4 1995/07/18 16:41:24 mark Exp $ PROG= registerd SRCS= registerd.c diff --git a/eBones/registerd/registerd.c b/eBones/registerd/registerd.c index 65a8a49..b5c7434 100644 --- a/eBones/registerd/registerd.c +++ b/eBones/registerd/registerd.c @@ -49,7 +49,8 @@ static char sccsid[] = "@(#)registerd.c 8.1 (Berkeley) 6/1/93"; #include #include #include -#include +#include +#include #include #include #include diff --git a/eBones/usr.bin/kadmin/Makefile b/eBones/usr.bin/kadmin/Makefile index a22c9e2..d7cf0a3 100644 --- a/eBones/usr.bin/kadmin/Makefile +++ b/eBones/usr.bin/kadmin/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1 1995/01/20 02:47:48 wollman Exp $ +# $Id: Makefile,v 1.1 1995/07/18 16:36:53 mark Exp $ BINDIR= /usr/bin PROG= kadmin diff --git a/eBones/usr.bin/kadmin/kadmin.c b/eBones/usr.bin/kadmin/kadmin.c index cbf4d6f..56f03d0 100644 --- a/eBones/usr.bin/kadmin/kadmin.c +++ b/eBones/usr.bin/kadmin/kadmin.c @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kadmin/kadmin.c,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/kadmin/kadmin.c,v $ + * $Author: mark $ * * Copyright 1988 by the Massachusetts Institute of Technology. * diff --git a/eBones/usr.bin/kadmin/kadmin_cmds.ct b/eBones/usr.bin/kadmin/kadmin_cmds.ct index 92d31fd..141ac15 100644 --- a/eBones/usr.bin/kadmin/kadmin_cmds.ct +++ b/eBones/usr.bin/kadmin/kadmin_cmds.ct @@ -1,12 +1,12 @@ -# $Source: /mit/kerberos/src/kadmin/RCS/kadmin_cmds.ct,v $ -# $Author: jtkohl $ -# $Header: /mit/kerberos/src/kadmin/RCS/kadmin_cmds.ct,v 4.1 89/07/25 17:02:28 jtkohl Exp $ +# $Source: /usr/cvs/src/eBones/kadmin/kadmin_cmds.ct,v $ +# $Author: mark $ +# $Header: /usr/cvs/src/eBones/kadmin/kadmin_cmds.ct,v 1.1 1995/07/18 16:36:56 mark Exp $ # # Copyright 1988 by the Massachusetts Institute of Technology. -# +# # For copying and distribution information, please see the file # . -# +# # Command table for Kerberos administration tool # command_table admin_cmds; diff --git a/eBones/usr.bin/kdestroy/Makefile b/eBones/usr.bin/kdestroy/Makefile index 5947028..2a79774 100644 --- a/eBones/usr.bin/kdestroy/Makefile +++ b/eBones/usr.bin/kdestroy/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:15 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:42 mark Exp $ PROG= kdestroy CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -DBSD42 diff --git a/eBones/usr.bin/kdestroy/kdestroy.c b/eBones/usr.bin/kdestroy/kdestroy.c index 8a7cbb7..c64a731 100644 --- a/eBones/usr.bin/kdestroy/kdestroy.c +++ b/eBones/usr.bin/kdestroy/kdestroy.c @@ -10,12 +10,12 @@ * -f[orce] - no message printed at all * * from: kdestroy.c,v 4.5 88/03/18 15:16:02 steiner Exp $ - * $Id: kdestroy.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ + * $Id: kdestroy.c,v 1.3 1995/07/18 16:37:44 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdestroy.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $"; +"$Id: kdestroy.c,v 1.3 1995/07/18 16:37:44 mark Exp $"; #endif lint #include diff --git a/eBones/usr.bin/kinit/Makefile b/eBones/usr.bin/kinit/Makefile index e616f42..24f1a95 100644 --- a/eBones/usr.bin/kinit/Makefile +++ b/eBones/usr.bin/kinit/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:31 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:53 mark Exp $ PROG= kinit CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -DBSD42 diff --git a/eBones/usr.bin/kinit/kinit.c b/eBones/usr.bin/kinit/kinit.c index 9f531d1..6cde305 100644 --- a/eBones/usr.bin/kinit/kinit.c +++ b/eBones/usr.bin/kinit/kinit.c @@ -15,12 +15,12 @@ * -l[ifetime] * * from: kinit.c,v 4.12 90/03/20 16:11:15 jon Exp $ - * $Id: kinit.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $ + * $Id: kinit.c,v 1.4 1995/08/03 17:16:00 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kinit.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $"; +"$Id: kinit.c,v 1.4 1995/08/03 17:16:00 mark Exp $"; #endif lint #include @@ -35,7 +35,7 @@ static char rcsid[] = #define LEN 64 /* just guessing */ #endif PC -#if defined(BSD42) || defined(__FreeBSD__) +#if defined(BSD42) || defined(__FreeBSD__) || defined(__NetBSD__) #include #include #if defined(ultrix) || defined(sun) diff --git a/eBones/usr.bin/klist/Makefile b/eBones/usr.bin/klist/Makefile index aa0d720..b5ec669 100644 --- a/eBones/usr.bin/klist/Makefile +++ b/eBones/usr.bin/klist/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:37 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:57 mark Exp $ PROG= klist CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/usr.bin/klist/klist.c b/eBones/usr.bin/klist/klist.c index bfc3aa0..29e6453 100644 --- a/eBones/usr.bin/klist/klist.c +++ b/eBones/usr.bin/klist/klist.c @@ -7,12 +7,12 @@ * Written by Bill Sommerfeld, MIT Project Athena. * * from: klist.c,v 4.15 89/08/30 11:19:16 jtkohl Exp $ - * $Id: klist.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $ + * $Id: klist.c,v 1.3 1995/07/18 16:37:59 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: klist.c,v 1.1.1.1 1994/09/30 14:49:58 csgr Exp $"; +"$Id: klist.c,v 1.3 1995/07/18 16:37:59 mark Exp $"; #endif lint #include diff --git a/eBones/usr.bin/ksrvtgt/Makefile b/eBones/usr.bin/ksrvtgt/Makefile index 5e8944d..1c6b0dc 100644 --- a/eBones/usr.bin/ksrvtgt/Makefile +++ b/eBones/usr.bin/ksrvtgt/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:26:54 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:40:05 mark Exp $ PROG= ksrvtgt CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/usr.bin/ksrvtgt/ksrvtgt.c b/eBones/usr.bin/ksrvtgt/ksrvtgt.c index 79acf3e..c51457c 100644 --- a/eBones/usr.bin/ksrvtgt/ksrvtgt.c +++ b/eBones/usr.bin/ksrvtgt/ksrvtgt.c @@ -7,12 +7,12 @@ * The lifetime is the shortest allowed [1 five-minute interval] * * from: ksrvtgt.c,v 4.3 89/07/28 10:17:28 jtkohl Exp $ - * $Id: ksrvtgt.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: ksrvtgt.c,v 1.3 1995/07/18 16:40:07 mark Exp $ */ #ifndef lint const char rcsid[] = -"$Id: ksrvtgt.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: ksrvtgt.c,v 1.3 1995/07/18 16:40:07 mark Exp $"; #endif /* lint */ #include @@ -49,7 +49,7 @@ main(argc,argv) (void) strcpy(srvtab, KEYFILE); if (realm[0] == 0) - if (krb_get_lrealm(realm) != KSUCCESS) + if (krb_get_lrealm(realm, 1) != KSUCCESS) (void) strcpy(realm, KRB_REALM); code = krb_get_svc_in_tkt(argv[1], argv[2], realm, diff --git a/eBones/usr.bin/passwd/kpasswd.c b/eBones/usr.bin/passwd/kpasswd.c index 2425bed..56e76a3 100644 --- a/eBones/usr.bin/passwd/kpasswd.c +++ b/eBones/usr.bin/passwd/kpasswd.c @@ -13,7 +13,7 @@ static char rcsid_kpasswd_c[] = "BonesHeader: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kpasswd.c,v 4.3 89/09/26 09:33:02 jtkohl Exp "; #endif static const char rcsid[] = - "$Id: kpasswd.c,v 1.1 1995/01/20 22:14:14 wollman Exp $"; + "$Id: kpasswd.c,v 1.1 1995/07/18 16:41:20 mark Exp $"; #endif lint /* diff --git a/eBones/usr.bin/register/Makefile b/eBones/usr.bin/register/Makefile index 3ab09c3..909569bb 100644 --- a/eBones/usr.bin/register/Makefile +++ b/eBones/usr.bin/register/Makefile @@ -1,5 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/1/93 -# $Id: Makefile,v 1.4 1994/07/20 09:21:07 g89r4222 Exp $ +# $Id: Makefile,v 1.5 1995/07/18 16:41:22 mark Exp $ PROG= register SRCS= register.c diff --git a/eBones/usr.bin/register/register.c b/eBones/usr.bin/register/register.c index d20f848..3f3cbbf 100644 --- a/eBones/usr.bin/register/register.c +++ b/eBones/usr.bin/register/register.c @@ -52,13 +52,13 @@ static char sccsid[] = "@(#)register.c 8.1 (Berkeley) 6/1/93"; #include #include #include -#include +#include #include #include "pathnames.h" #include "register_proto.h" -#define SERVICE "krbupdate" /* service to add to KDC's database */ -#define PROTO "tcp" +#define SERVICE "krbupdate" /* service to add to KDC's database */ +#define PROTOCOL "tcp" char realm[REALM_SZ]; char krbhst[MAX_HSTNM]; @@ -90,7 +90,7 @@ main(argc, argv) exit(1); } - if ((se = getservbyname(SERVICE, PROTO)) == NULL) { + if ((se = getservbyname(SERVICE, PROTOCOL)) == NULL) { fprintf(stderr, "couldn't find entry for service %s\n", SERVICE); exit(1); diff --git a/eBones/usr.sbin/ext_srvtab/Makefile b/eBones/usr.sbin/ext_srvtab/Makefile index f30bbbb..b0a2a01 100644 --- a/eBones/usr.sbin/ext_srvtab/Makefile +++ b/eBones/usr.sbin/ext_srvtab/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:22:34 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:35:54 mark Exp $ PROG= ext_srvtab CFLAGS+=-DKERBEROS -I${.CURDIR}/../include diff --git a/eBones/usr.sbin/ext_srvtab/ext_srvtab.c b/eBones/usr.sbin/ext_srvtab/ext_srvtab.c index 093dfe2..6b655c7 100644 --- a/eBones/usr.sbin/ext_srvtab/ext_srvtab.c +++ b/eBones/usr.sbin/ext_srvtab/ext_srvtab.c @@ -2,12 +2,12 @@ * Copyright 1987, 1988 by the Massachusetts Institute of Technology. * * from: ext_srvtab.c,v 4.1 89/07/18 16:49:30 jtkohl Exp $ - * $Id: ext_srvtab.c,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $ + * $Id: ext_srvtab.c,v 1.3 1995/07/18 16:35:55 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: ext_srvtab.c,v 1.1.1.1 1994/09/30 14:49:53 csgr Exp $"; +"$Id: ext_srvtab.c,v 1.3 1995/07/18 16:35:55 mark Exp $"; #endif lint #include diff --git a/eBones/usr.sbin/kadmin/Makefile b/eBones/usr.sbin/kadmin/Makefile index 77069be..620ab81 100644 --- a/eBones/usr.sbin/kadmin/Makefile +++ b/eBones/usr.sbin/kadmin/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:36:59 mark Exp $ PROG= kadmind SRCS= admin_server.c kadm_funcs.c kadm_ser_wrap.c kadm_server.c diff --git a/eBones/usr.sbin/kadmin/kadm_funcs.c b/eBones/usr.sbin/kadmin/kadm_funcs.c index 9f06e30..4ed2365 100644 --- a/eBones/usr.sbin/kadmin/kadm_funcs.c +++ b/eBones/usr.sbin/kadmin/kadm_funcs.c @@ -13,7 +13,7 @@ static char rcsid_kadm_funcs_c[] = "Id: kadm_funcs.c,v 4.3 90/03/20 01:39:51 jon Exp "; #endif static const char rcsid[] = - "$Id: kadm_funcs.c,v 1.1 1995/01/20 03:12:55 wollman Exp $"; + "$Id: kadm_funcs.c,v 1.1 1995/07/18 16:37:02 mark Exp $"; #endif lint /* diff --git a/eBones/usr.sbin/kadmin/kadm_server.h b/eBones/usr.sbin/kadmin/kadm_server.h index 33b1904..2d6f8bf 100644 --- a/eBones/usr.sbin/kadmin/kadm_server.h +++ b/eBones/usr.sbin/kadmin/kadm_server.h @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kadmind/kadm_server.h,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/kadmind/kadm_server.h,v $ + * $Author: mark $ * Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_server.h,v 4.1 89/12/21 17:46:51 jtkohl Exp * * Copyright 1988 by the Massachusetts Institute of Technology. @@ -24,7 +24,7 @@ #include #include -#include +#include typedef struct { struct sockaddr_in admin_addr; diff --git a/eBones/usr.sbin/kadmind/Makefile b/eBones/usr.sbin/kadmind/Makefile index 77069be..620ab81 100644 --- a/eBones/usr.sbin/kadmind/Makefile +++ b/eBones/usr.sbin/kadmind/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:36:59 mark Exp $ PROG= kadmind SRCS= admin_server.c kadm_funcs.c kadm_ser_wrap.c kadm_server.c diff --git a/eBones/usr.sbin/kadmind/kadm_funcs.c b/eBones/usr.sbin/kadmind/kadm_funcs.c index 9f06e30..4ed2365 100644 --- a/eBones/usr.sbin/kadmind/kadm_funcs.c +++ b/eBones/usr.sbin/kadmind/kadm_funcs.c @@ -13,7 +13,7 @@ static char rcsid_kadm_funcs_c[] = "Id: kadm_funcs.c,v 4.3 90/03/20 01:39:51 jon Exp "; #endif static const char rcsid[] = - "$Id: kadm_funcs.c,v 1.1 1995/01/20 03:12:55 wollman Exp $"; + "$Id: kadm_funcs.c,v 1.1 1995/07/18 16:37:02 mark Exp $"; #endif lint /* diff --git a/eBones/usr.sbin/kadmind/kadm_server.h b/eBones/usr.sbin/kadmind/kadm_server.h index 33b1904..2d6f8bf 100644 --- a/eBones/usr.sbin/kadmind/kadm_server.h +++ b/eBones/usr.sbin/kadmind/kadm_server.h @@ -1,6 +1,6 @@ /* - * $Source: /home/ncvs/src/eBones/kadmind/kadm_server.h,v $ - * $Author: wollman $ + * $Source: /usr/cvs/src/eBones/kadmind/kadm_server.h,v $ + * $Author: mark $ * Header: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadm_server.h,v 4.1 89/12/21 17:46:51 jtkohl Exp * * Copyright 1988 by the Massachusetts Institute of Technology. @@ -24,7 +24,7 @@ #include #include -#include +#include typedef struct { struct sockaddr_in admin_addr; diff --git a/eBones/usr.sbin/kdb_destroy/Makefile b/eBones/usr.sbin/kdb_destroy/Makefile index a48805b..2e8fcb9 100644 --- a/eBones/usr.sbin/kdb_destroy/Makefile +++ b/eBones/usr.sbin/kdb_destroy/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:23:46 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:22 mark Exp $ PROG= kdb_destroy CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/usr.sbin/kdb_destroy/kdb_destroy.c b/eBones/usr.sbin/kdb_destroy/kdb_destroy.c index ce59cc9..b669de2 100644 --- a/eBones/usr.sbin/kdb_destroy/kdb_destroy.c +++ b/eBones/usr.sbin/kdb_destroy/kdb_destroy.c @@ -4,12 +4,12 @@ * . * * from: kdb_destroy.c,v 4.0 89/01/24 21:49:02 jtkohl Exp $ - * $Id: kdb_destroy.c,v 1.3 1995/08/02 23:08:14 pst Exp $ + * $Id: kdb_destroy.c,v 1.5 1995/08/04 06:35:45 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_destroy.c,v 1.3 1995/08/02 23:08:14 pst Exp $"; +"$Id: kdb_destroy.c,v 1.5 1995/08/04 06:35:45 mark Exp $"; #endif lint #include @@ -17,10 +17,11 @@ static char rcsid[] = #include "krb.h" #include "krb_db.h" -#ifdef dbm_pagfno +#if defined(__FreeBSD__) || defined(__NetBSD__) #define DB #endif + main() { char answer[10]; /* user input */ diff --git a/eBones/usr.sbin/kdb_edit/Makefile b/eBones/usr.sbin/kdb_edit/Makefile index 65a5e5a..792e7c5 100644 --- a/eBones/usr.sbin/kdb_edit/Makefile +++ b/eBones/usr.sbin/kdb_edit/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.2 (Berkeley) 2/14/91 -# $Id: Makefile,v 1.2 1994/07/19 19:23:53 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:25 mark Exp $ PROG= kdb_edit CFLAGS+=-DKERBEROS -DDEBUG -I. -I${.CURDIR}/../include diff --git a/eBones/usr.sbin/kdb_edit/kdb_edit.c b/eBones/usr.sbin/kdb_edit/kdb_edit.c index 00c2308..61cf71a 100644 --- a/eBones/usr.sbin/kdb_edit/kdb_edit.c +++ b/eBones/usr.sbin/kdb_edit/kdb_edit.c @@ -8,7 +8,7 @@ * i.e., users or services. * * from: kdb_edit.c,v 4.2 90/01/09 16:05:09 raeburn Exp $ - * $Id: kdb_edit.c,v 1.2 1995/05/30 06:40:41 rgrimes Exp $ + * $Id: kdb_edit.c,v 1.5 1995/08/03 17:15:54 mark Exp $ */ /* @@ -17,7 +17,7 @@ #ifndef lint static char rcsid[] = -"$Id: kdb_edit.c,v 1.2 1995/05/30 06:40:41 rgrimes Exp $"; +"$Id: kdb_edit.c,v 1.5 1995/08/03 17:15:54 mark Exp $"; #endif lint #include diff --git a/eBones/usr.sbin/kdb_edit/maketime.c b/eBones/usr.sbin/kdb_edit/maketime.c index 057ecc3..ed485af 100644 --- a/eBones/usr.sbin/kdb_edit/maketime.c +++ b/eBones/usr.sbin/kdb_edit/maketime.c @@ -6,7 +6,7 @@ * Convert a struct tm * to a UNIX time. * * from: maketime.c,v 4.2 90/01/09 15:54:51 raeburn Exp $ - * $Id: maketime.c,v 1.2 1994/07/19 19:23:56 g89r4222 Exp $ + * $Id: maketime.c,v 1.3 1995/07/18 16:37:29 mark Exp $ */ #ifndef lint diff --git a/eBones/usr.sbin/kdb_edit/time.h b/eBones/usr.sbin/kdb_edit/time.h index ed128d8..ae84e2e 100644 --- a/eBones/usr.sbin/kdb_edit/time.h +++ b/eBones/usr.sbin/kdb_edit/time.h @@ -6,7 +6,7 @@ /* * from: time.h,v 1.1 82/05/06 11:34:29 wft Exp $ - * $Id: time.h,v 1.2 1994/07/19 19:23:58 g89r4222 Exp $ + * $Id: time.h,v 1.3 1995/07/18 16:37:31 mark Exp $ */ struct tm { /* See defines below for allowable ranges */ diff --git a/eBones/usr.sbin/kdb_init/Makefile b/eBones/usr.sbin/kdb_init/Makefile index ce51a9f..7738312 100644 --- a/eBones/usr.sbin/kdb_init/Makefile +++ b/eBones/usr.sbin/kdb_init/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.2 1994/07/19 19:24:03 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:34 mark Exp $ PROG= kdb_init CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/usr.sbin/kdb_init/kdb_init.c b/eBones/usr.sbin/kdb_init/kdb_init.c index 7a8e32f..d48ee096 100644 --- a/eBones/usr.sbin/kdb_init/kdb_init.c +++ b/eBones/usr.sbin/kdb_init/kdb_init.c @@ -7,12 +7,12 @@ * already exists. * * from: kdb_init.c,v 4.0 89/01/24 21:50:45 jtkohl Exp $ - * $Id: kdb_init.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $ + * $Id: kdb_init.c,v 1.4 1995/07/18 16:37:35 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_init.c,v 1.1.1.1 1994/09/30 14:49:56 csgr Exp $"; +"$Id: kdb_init.c,v 1.4 1995/07/18 16:37:35 mark Exp $"; #endif lint #include @@ -119,9 +119,6 @@ add_principal(name, instance, aap_op) Principal principal; char datestring[50]; char pw_str[255]; - void read_pw_string(); - void string_to_key(); - void random_key(); struct tm *tm, *localtime(); C_Block new_key; diff --git a/eBones/usr.sbin/kdb_util/Makefile b/eBones/usr.sbin/kdb_util/Makefile index b3513d6..bffeb51 100644 --- a/eBones/usr.sbin/kdb_util/Makefile +++ b/eBones/usr.sbin/kdb_util/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.2 (Berkeley) 2/14/91 -# $Id: Makefile,v 1.2 1994/07/19 19:24:09 g89r4222 Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:38 mark Exp $ PROG= kdb_util CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../kdb_edit \ diff --git a/eBones/usr.sbin/kdb_util/kdb_util.c b/eBones/usr.sbin/kdb_util/kdb_util.c index 97f7a65e..140e211 100644 --- a/eBones/usr.sbin/kdb_util/kdb_util.c +++ b/eBones/usr.sbin/kdb_util/kdb_util.c @@ -12,12 +12,12 @@ * Written July 9, 1987 by Jeffrey I. Schiller * * from: kdb_util.c,v 4.4 90/01/09 15:57:20 raeburn Exp $ - * $Id: kdb_util.c,v 1.2 1995/05/30 06:40:44 rgrimes Exp $ + * $Id: kdb_util.c,v 1.5 1995/08/03 17:15:57 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kdb_util.c,v 1.2 1995/05/30 06:40:44 rgrimes Exp $"; +"$Id: kdb_util.c,v 1.5 1995/08/03 17:15:57 mark Exp $"; #endif lint #include diff --git a/eBones/usr.sbin/kerberos/Makefile b/eBones/usr.sbin/kerberos/Makefile index 44853ef..bd3d89f 100644 --- a/eBones/usr.sbin/kerberos/Makefile +++ b/eBones/usr.sbin/kerberos/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:37:47 mark Exp $ PROG= kerberos SRCS= kerberos.c cr_err_reply.c diff --git a/eBones/usr.sbin/kerberos/cr_err_reply.c b/eBones/usr.sbin/kerberos/cr_err_reply.c index c5178fe..924a98f 100644 --- a/eBones/usr.sbin/kerberos/cr_err_reply.c +++ b/eBones/usr.sbin/kerberos/cr_err_reply.c @@ -5,12 +5,12 @@ * . * * from: cr_err_reply.c,v 4.10 89/01/10 11:34:42 steiner Exp $ - * $Id: cr_err_reply.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ + * $Id: cr_err_reply.c,v 1.2 1995/07/18 16:37:49 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: cr_err_reply.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $"; +"$Id: cr_err_reply.c,v 1.2 1995/07/18 16:37:49 mark Exp $"; #endif /* lint */ #include diff --git a/eBones/usr.sbin/kerberos/kerberos.c b/eBones/usr.sbin/kerberos/kerberos.c index a7f391c..d0ce795 100644 --- a/eBones/usr.sbin/kerberos/kerberos.c +++ b/eBones/usr.sbin/kerberos/kerberos.c @@ -5,12 +5,12 @@ * . * * from: kerberos.c,v 4.19 89/11/01 17:18:07 qjb Exp $ - * $Id: kerberos.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $ + * $Id: kerberos.c,v 1.4 1995/07/18 16:37:51 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kerberos.c,v 1.1.1.1 1994/09/30 14:49:57 csgr Exp $"; +"$Id: kerberos.c,v 1.4 1995/07/18 16:37:51 mark Exp $"; #endif lint #include diff --git a/eBones/usr.sbin/kprop/Makefile b/eBones/usr.sbin/kprop/Makefile index 962813e..fa70067 100644 --- a/eBones/usr.sbin/kprop/Makefile +++ b/eBones/usr.sbin/kprop/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id$ +# $Id: Makefile,v 1.1.1.1 1995/08/03 07:36:18 mark Exp $ PROG= kprop CFLAGS+=-I${.CURDIR}/../include diff --git a/eBones/usr.sbin/kprop/kprop.c b/eBones/usr.sbin/kprop/kprop.c index 91fb08f..cde1cce 100644 --- a/eBones/usr.sbin/kprop/kprop.c +++ b/eBones/usr.sbin/kprop/kprop.c @@ -5,14 +5,36 @@ * For copying and distribution information, * please see the file . * - * $Revision: 4.7 $ - * $Date: 92/11/10 23:01:06 $ + * $Revision: 1.1.1.1 $ + * $Date: 1995/08/03 07:36:18 $ * $State: Exp $ - * $Source: /afs/net.mit.edu/project/krb4/src/slave/RCS/kprop.c,v $ - * $Author: tytso $ + * $Source: /usr/cvs/src/eBones/kprop/kprop.c,v $ + * $Author: mark $ * $Locker: $ * - * $Log: kprop.c,v $ + * $Log: kprop.c,v $ + * Revision 1.1.1.1 1995/08/03 07:36:18 mark + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * + * Revision 1.1.1.1 1995/08/02 22:11:44 pst + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * * Revision 4.7 92/11/10 23:01:06 tytso * Removed incompatible #include * @@ -50,7 +72,7 @@ #ifndef lint static char rcsid_kprop_c[] = -"$Id: kprop.c,v 4.7 92/11/10 23:01:06 tytso Exp $"; +"$Id: kprop.c,v 1.1.1.1 1995/08/03 07:36:18 mark Exp $"; #endif lint #include diff --git a/eBones/usr.sbin/kprop/kprop.h b/eBones/usr.sbin/kprop/kprop.h index 2f34e36..5197276 100644 --- a/eBones/usr.sbin/kprop/kprop.h +++ b/eBones/usr.sbin/kprop/kprop.h @@ -4,14 +4,36 @@ * For copying and distribution information, * please see the file . * - * $Revision: 4.1 $ - * $Date: 92/10/23 15:45:13 $ + * $Revision: 1.1.1.1 $ + * $Date: 1995/08/03 07:36:18 $ * $State: Exp $ - * $Source: /afs/net.mit.edu/project/krb4/src/slave/RCS/kprop.h,v $ - * $Author: tytso $ + * $Source: /usr/cvs/src/eBones/kprop/kprop.h,v $ + * $Author: mark $ * $Locker: $ * - * $Log: kprop.h,v $ + * $Log: kprop.h,v $ + * Revision 1.1.1.1 1995/08/03 07:36:18 mark + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * + * Revision 1.1.1.1 1995/08/02 22:11:44 pst + * Import an updated revision of the MIT kprop program for distributing + * kerberos databases to slave servers. + * + * NOTE: This method was abandoned by MIT long ago, this code is close to + * garbage, but it is slightly more secure than using rdist. + * There is no documentation available on how to use it, and + * it should -not- be built by default. + * + * Obtained from: MIT Project Athena + * * Revision 4.1 92/10/23 15:45:13 tytso * Change the location of KPROP_KDBUTIL to be /kerberos/bin/kdb_util. * diff --git a/eBones/usr.sbin/ksrvutil/Makefile b/eBones/usr.sbin/ksrvutil/Makefile index bdff452..1fcaf0c 100644 --- a/eBones/usr.sbin/ksrvutil/Makefile +++ b/eBones/usr.sbin/ksrvutil/Makefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: Makefile,v 1.1 1995/07/18 16:40:09 mark Exp $ PROG= ksrvutil SRCS= ksrvutil.c diff --git a/eBones/usr.sbin/ksrvutil/ksrvutil.c b/eBones/usr.sbin/ksrvutil/ksrvutil.c index d1e9474..6d81e72 100644 --- a/eBones/usr.sbin/ksrvutil/ksrvutil.c +++ b/eBones/usr.sbin/ksrvutil/ksrvutil.c @@ -13,7 +13,7 @@ static char rcsid_ksrvutil_c[] = "BonesHeader: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/ksrvutil.c,v 4.1 89/09/26 09:33:49 jtkohl Exp "; #endif static const char rcsid[] = - "$Id: ksrvutil.c,v 1.2 1995/01/23 22:54:08 wollman Exp $"; + "$Id: ksrvutil.c,v 1.1 1995/07/18 16:40:11 mark Exp $"; #endif lint /* diff --git a/eBones/usr.sbin/kstash/Makefile b/eBones/usr.sbin/kstash/Makefile index d096b9c..b194a2c 100644 --- a/eBones/usr.sbin/kstash/Makefile +++ b/eBones/usr.sbin/kstash/Makefile @@ -1,5 +1,5 @@ # From: @(#)Makefile 5.2 (Berkeley) 3/5/91 -# $Id: Makefile,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ +# $Id: Makefile,v 1.3 1995/07/18 16:40:14 mark Exp $ PROG= kstash CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include diff --git a/eBones/usr.sbin/kstash/kstash.c b/eBones/usr.sbin/kstash/kstash.c index d8afe20..d5a59bf 100644 --- a/eBones/usr.sbin/kstash/kstash.c +++ b/eBones/usr.sbin/kstash/kstash.c @@ -5,12 +5,12 @@ * . * * from: kstash.c,v 4.0 89/01/23 09:45:43 jtkohl Exp $ - * $Id: kstash.c,v 1.1.1.1 1994/09/30 14:50:05 csgr Exp $ + * $Id: kstash.c,v 1.3 1995/07/18 16:40:16 mark Exp $ */ #ifndef lint static char rcsid[] = -"$Id: kstash.c,v 1.1.1.1 1994/09/30 14:50:05 csgr Exp $"; +"$Id: kstash.c,v 1.3 1995/07/18 16:40:16 mark Exp $"; #endif lint #include diff --git a/eBones/usr.sbin/make_keypair/make_keypair.c b/eBones/usr.sbin/make_keypair/make_keypair.c index c9883ed..5cc1777 100644 --- a/eBones/usr.sbin/make_keypair/make_keypair.c +++ b/eBones/usr.sbin/make_keypair/make_keypair.c @@ -46,12 +46,11 @@ static char sccsid[] = "@(#)make_keypair.c 8.1 (Berkeley) 6/1/93"; #include #include #include -#include +#include #include #include "pathnames.h" #include "register_proto.h" -extern void random_key(), herror(); void make_key(), usage(); char * progname; -- cgit v1.1