1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

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
This commit is contained in:
Mark Murray 1995-08-25 22:52:32 +00:00
parent d1171f6899
commit b1ebdd50cb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10277
280 changed files with 2037 additions and 2551 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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}/..

View File

@ -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

View File

@ -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

View File

@ -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 <bsd.lib.mk>

View File

@ -6,25 +6,29 @@
* <mit-copyright.h>.
*
* 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 <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <ctype.h>
#include "krb.h"
#include <unistd.h>
#include <krb.h>
__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;

View File

@ -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

View File

@ -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

View File

@ -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 <stdio.h>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,7 +4,7 @@
* <Copyright.MIT>.
*
* 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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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? */

View File

@ -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 $
*
*/

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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 */

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <kerberosIV/des.h>
#include <stdio.h>
#include <des.h>
#include <netinet/in.h>
/* 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

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <krb_conf.h>

View File

@ -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

View File

@ -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.
*

View File

@ -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
# <mit-copyright.h>.
#
#
# Command table for Kerberos administration tool
#
command_table admin_cmds;

View File

@ -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

View File

@ -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
/*

View File

@ -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 <sys/types.h>
#include <kerberosIV/krb.h>
#include <kerberosIV/des.h>
#include <des.h>
typedef struct {
struct sockaddr_in admin_addr;

View File

@ -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 <bsd.lib.mk>

View File

@ -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 <stdio.h>
#include <sys/types.h>
@ -25,8 +27,6 @@ static char rcsid[] =
#include <krb.h>
#include <krb_db.h>
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;
}

View File

@ -4,19 +4,27 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/uio.h>
@ -27,17 +35,17 @@ static char rcsid[] =
#include <strings.h>
#include <des.h>
#include <sys/file.h>
#ifdef NDBM
#ifdef NDBM_
#include <ndbm.h>
#else /*NDBM*/
#else /*NDBM_*/
#include <dbm.h>
#endif /*NDBM*/
#endif /*NDBM_*/
/* before krb_db.h */
#include <krb.h>
#include <krb_db.h>
#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(&timestamp, 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;

View File

@ -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 <des.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/file.h>
#include <krb.h>
#include <krb_db.h>
#include <kdc.h>
#include <stdio.h>
#include <sys/file.h>
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
}

View File

@ -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 @@
* <mit-copyright.h>.
*/
#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 <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/uio.h>
@ -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

View File

@ -3,14 +3,16 @@
* For copying and distribution information, please see the file
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <sys/types.h>
@ -20,15 +22,11 @@ static char rcsid[] =
#include <krb_db.h>
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);
}

View File

@ -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

View File

@ -4,12 +4,12 @@
* <Copyright.MIT>.
*
* 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 <strings.h>
@ -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 */

View File

@ -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

View File

@ -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 <stdio.h>

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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 <stdio.h>
@ -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;

View File

@ -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 \

View File

@ -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 <stdio.h>

View File

@ -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

View File

@ -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 <stdio.h>

View File

@ -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

View File

@ -5,12 +5,12 @@
* <Copyright.MIT>.
*
* 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 <sys/types.h>

View File

@ -5,12 +5,12 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>

View File

@ -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

View File

@ -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 <stdio.h>
@ -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 <strings.h>
#include <sys/param.h>
#if defined(ultrix) || defined(sun)

View File

@ -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

View File

@ -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 <stdio.h>

View File

@ -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

View File

@ -5,14 +5,36 @@
* For copying and distribution information,
* please see the file <mit-copyright.h>.
*
* $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 <stdio.h>

View File

@ -4,14 +4,36 @@
* For copying and distribution information,
* please see the file <mit-copyright.h>.
*
* $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.
*

View File

@ -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

View File

@ -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 <ctype.h>

View File

@ -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 \

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <prot.h>

View File

@ -5,14 +5,17 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <krb.h>
#include <prot.h>
#include <strings.h>

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <des.h>
@ -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);

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <prot.h>

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <des.h>
@ -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;
}

View File

@ -4,13 +4,15 @@
* <Copyright.MIT>.
*
* 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. */

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <des.h>
@ -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 */

View File

@ -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 <sys/param.h>
#include <sys/types.h>
#include <kerberosIV/des.h>
#include <kerberosIV/krb.h>
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 <krb.h>
#include <des.h>
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);

View File

@ -5,15 +5,20 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <krb.h>
#include <sys/file.h>
#include <sys/types.h>
@ -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;

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <prot.h>
@ -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;

View File

@ -4,13 +4,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
@ -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 */

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <des.h>
@ -25,8 +27,6 @@ static char rcsid[] =
#include <sys/time.h>
#include <sys/types.h>
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);

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <krb.h>
@ -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];

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <krb.h>
@ -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 */

View File

@ -4,20 +4,22 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <prot.h>
#include <des.h>
#include "conf.h"
#ifndef NULL
#define NULL 0
#endif
#include <stdio.h>
/*
* 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 <des.h>
#include "conf.h"
#include <stdio.h>
#ifdef BSDUNIX
#include <strings.h>
#include <sys/ioctl.h>
#include <signal.h>
#include <setjmp.h>
#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 @@ placebo_read_password(k,prompt,verify)
* 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);
}

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <krb.h>
@ -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];

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <krb.h>
@ -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 */

View File

@ -4,19 +4,21 @@
* <Copyright.MIT>.
*
* 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 <stdio.h>
#include <string.h>
#include <ctype.h>
#include <netdb.h>
char *index();
#include <krb.h>
/*
* 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;

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
@ -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;

View File

@ -5,13 +5,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <prot.h>
@ -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 +

View File

@ -4,13 +4,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <prot.h>
@ -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;

View File

@ -4,13 +4,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <strings.h>
@ -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;

View File

@ -4,13 +4,15 @@
* <Copyright.MIT>.
*
* 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 <krb.h>
#include <strings.h>
@ -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));
}

View File

@ -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 <strings.h>
#include <stdio.h>
@ -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;

Some files were not shown because too many files have changed in this diff Show More