#include <afs/cmd.h>
#include <afs/com_err.h>
#include <afs/afsutil.h>
+#include <des.h>
+#include <des_prototypes.h>
#include "kauth.h"
#include "kautils.h"
#include "kaport.h"
+#include "kkids.h"
#define CMD_PARSER_AMBIG_FIX 1 /* allow ambiguous aliases */
static int finished;
static int zero_argc;
static char **zero_argv;
-afs_uint32 ka_islocked();
+afs_uint32 ka_islocked(char *, char *, afs_uint32 *);
afs_int32
DefaultCell(void)
}
ucstring(realm, realm, sizeof(realm));
} else {
- if (code = DefaultCell())
+ if ((code = DefaultCell()))
return code;
ucstring(realm, cell, sizeof(realm));
}
return 0;
}
-static
+static int
GetTicket(struct cmd_syndesc *as, void *arock)
{
int code;
return KABADCMD;
}
if (server.cell[0] == 0) {
- if (code = DefaultCell())
+ if ((code = DefaultCell()))
return code;
strcpy(server.cell, cell);
} else {
return code;
}
-static
+static int
GetPassword(struct cmd_syndesc *as, void *arock)
{
int code;
static int
MyBeforeProc(struct cmd_syndesc *as, void *arock)
{
- extern struct passwd *getpwuid();
struct ktc_encryptionKey key;
struct ktc_principal auth_server, auth_token, client;
char realm[MAXKTCREALMLEN];
/* These are some helpful command that deal with the cache managers tokens. */
-static
+static int
ForgetTicket(struct cmd_syndesc *as, void *arock)
{
afs_int32 code;
return 0;
}
-static
+static int
ListTickets(struct cmd_syndesc *as, void *arock)
{
afs_int32 code = 0;
return code;
}
if (server.cell[0] == 0) {
- if (code = DefaultCell())
+ if ((code = DefaultCell()))
return code;
strcpy(server.cell, cell);
} else {
strcpy(whoami, "kas");
- if (code = cmd_Dispatch(cmd_argc, cmd_argv)) {
+ if ((code = cmd_Dispatch(cmd_argc, cmd_argv))) {
return code;
}
if ((field) && strcmp (field, strings)) return KABADPROTOCOL;\
strings += len+1
+#define chknostr() \
+ len = strlen(strings); \
+ if (len > MAXKTCNAMELEN) return KABADPROTOCOL; \
+ strings += len+1
+
if (caller) {
chkstr(caller->name);
chkstr(caller->instance);
chkstr(caller->cell);
} else {
- chkstr(0);
- chkstr(0);
- chkstr(0);
+ chknostr();
+ chknostr();
+ chknostr();
}
if (server) {
chkstr(server->name);
chkstr(server->instance);
} else {
- chkstr(0);
- chkstr(0);
+ chknostr();
+ chknostr();
}
if (oanswer->SeqLen -
ubik_Call(KAA_Authenticate, conn, 0, name, instance, start, end,
&arequest, &oanswer, 0, 0);
if (code == RXGEN_OPCODE) {
- extern int KAA_Authenticate_old();
oanswer.MaxSeqLen = sizeof(answer_old);
oanswer.SeqBody = (char *)&answer_old;
version = 0;
ubik_Call(KAT_GetTicket, conn, 0, auth_token->kvno, auth_domain,
&aticket, name, instance, &atimes, &oanswer);
if (code == RXGEN_OPCODE) {
- extern int KAT_GetTicket_old();
oanswer.SeqLen = 0; /* this may be set by first call */
oanswer.MaxSeqLen = sizeof(answer_old);
oanswer.SeqBody = (char *)&answer_old;
#include "afs/kautils.h"
#include "afs/pthread_glock.h"
#include "des/des.h"
+#include <des_prototypes.h>
#else /* defined(UKERNEL) */
#include <afs/stds.h>
/* This performs the backslash quoting defined by AC_ParseLoginName. */
static char
-map_char(str, ip)
- char *str;
- int *ip;
+map_char(char *str, int *ip)
{
char c = str[*ip];
if (c == '\\') {
#endif
#include <string.h>
#include <rx/rxkad.h>
+#define UBIK_INTERNALS
+#include <ubik.h>
#include "ubik_int.h"
#include "kauth.h"
#include "kaserver.h"
int
kaux_islocked(afs_int32 to, u_int attempts, u_int locktime)
{
- extern int ubeacon_Debug(), ubeacon_AmSyncSite();
unsigned int nfailures, myshare;
afs_uint32 lasttime;
struct ubik_debug beaconinfo;
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _KAUTH_KADATABASE_H
+#define _KAUTH_KADATABASE_H
+extern int kawrite(struct ubik_trans *, afs_int32, char *, afs_int32);
+extern int karead(struct ubik_trans *, afs_int32, char *, afs_int32);
+extern int update_admin_count(struct ubik_trans *, int);
+
+extern int ka_LookupKvno(struct ubik_trans *, char *, char *, afs_int32,
+ struct ktc_encryptionKey *);
+
+extern afs_int32 AllocBlock(struct ubik_trans *, struct kaentry *);
+extern afs_int32 FreeBlock(struct ubik_trans *, afs_int32);
+
+extern afs_int32 FindBlock(struct ubik_trans *, char *, char *, afs_int32 *,
+ struct kaentry *);
+extern afs_int32 ThreadBlock(struct ubik_trans *, afs_int32, struct kaentry *);
+
+extern afs_int32 UnthreadBlock(struct ubik_trans *, struct kaentry *);
+
+extern afs_int32 NextBlock(struct ubik_trans *, afs_int32, struct kaentry *,
+ afs_int32 *);
+
+extern afs_int32 ka_DelKey(struct ubik_trans *tt, afs_int32 tentryaddr,
+ struct kaentry *tentry);
+
+extern afs_int32 ka_LookupKvno(struct ubik_trans *tt, char *name,
+ char *inst, afs_int32 kvno,
+ struct ktc_encryptionKey *key);
+extern afs_int32 ka_LookupKey(struct ubik_trans *, char *, char *,
+ afs_int32 *, struct ktc_encryptionKey *);
+
+#endif
DBM *kalog_db;
-kalog_Init()
+void
+kalog_Init(void)
{
OpenLog(AFSDIR_SERVER_KALOGDB_FILEPATH); /* set up logging */
SetupLogSignals();
}
/* log a ticket usage */
-kalog_log(principal, instance, sprincipal, sinstance, realm, hostaddr, type)
- char *principal, *instance, *sprincipal, *sinstance, *realm;
- int hostaddr, type;
+void
+kalog_log(char *principal, char *instance, char *sprincipal,
+ char *sinstance, char *realm, int hostaddr, int type)
{
char keybuf[512]; /* not random! 63 . 63 , 63 . 63 max key */
datum key, data;
#else
#define KALOG(a,b,c,d,e,f,g) ka_log(a,b,c,d,e,f,g)
#endif
+
+extern void kalog_log(char *, char *, char *, char *, char *, int, int);
+extern void kalog_Init(void);
#include "kauth_internal.h"
#include "afs/audit.h"
+#include "kadatabase.h"
+#include "kaprocs.h"
+
extern struct ubik_dbase *KA_dbase;
struct kaheader cheader;
Date cheaderReadTime; /* time cheader last read in */
extern struct afsconf_dir *KA_conf; /* for getting cell info */
-afs_int32 kamCreateUser(struct rx_call *call, char *aname, char *ainstance,
- EncryptionKey ainitpw);
-afs_int32 ChangePassWord(struct rx_call *call, char *aname, char *ainstance,
- ka_CBS *arequest, ka_BBS *oanswer);
-afs_int32 kamSetPassword(struct rx_call *call, char *aname, char *ainstance,
- afs_int32 akvno, EncryptionKey apassword);
-afs_int32 kamSetFields(struct rx_call *call, char *aname, char *ainstance,
- afs_int32 aflags, Date aexpiration,
- afs_int32 alifetime, afs_int32 amaxAssociates,
- afs_uint32 misc_auth_bytes, afs_int32 spare2);
-afs_int32 kamDeleteUser(struct rx_call *call, char *aname, char *ainstance);
-afs_int32 kamGetEntry(struct rx_call *call, char *aname, char *ainstance,
- afs_int32 aversion, kaentryinfo *aentry);
-afs_int32 kamListEntry(struct rx_call *call, afs_int32 previous_index,
- afs_int32 *index, afs_int32 *count, kaident *name);
-afs_int32 kamGetStats(struct rx_call *call, afs_int32 version,
- afs_int32 *admin_accounts, kasstats *statics,
- kadstats *dynamics);
-afs_int32 kamGetPassword(struct rx_call *call, char *name,
- EncryptionKey *password);
-afs_int32 kamGetRandomKey(struct rx_call *call, EncryptionKey *key);
-afs_int32 kamDebug(struct rx_call *call, afs_int32 version,
- int checkDB, struct ka_debugInfo *info);
+
char lrealm[MAXKTCREALMLEN];
static afs_int32 autoCPWUpdates;
static afs_int32 set_password(struct ubik_trans *tt, char *name,
- char *instance, EncryptionKey *password,
+ char *instance,
+ struct ktc_encryptionKey *password,
afs_int32 kvno, afs_int32 caller);
-
-extern afs_int32 InitAuthServ(struct ubik_trans **tt, int lock,
- int *this_op);
static afs_int32 impose_reuse_limits(EncryptionKey *password,
struct kaentry *tentry);
static int create_user(struct ubik_trans *tt, char *name, char *instance,
- EncryptionKey *key, afs_int32 caller,
+ struct ktc_encryptionKey *key, afs_int32 caller,
afs_int32 flags);
/* This routine is called whenever an RPC interface needs the time. It uses
parameter passes some information about the command line arguments. */
afs_int32
-init_kaprocs(char *lclpath, int initFlags)
+init_kaprocs(const char *lclpath, int initFlags)
{
int code;
struct ubik_trans *tt;
static int
create_user(struct ubik_trans *tt, char *name, char *instance,
- EncryptionKey *key, afs_int32 caller, afs_int32 flags)
+ struct ktc_encryptionKey *key, afs_int32 caller,
+ afs_int32 flags)
{
register int code;
afs_int32 to;
static afs_int32
set_password(struct ubik_trans *tt, char *name, char *instance,
- EncryptionKey *password, afs_int32 kvno, afs_int32 caller)
+ struct ktc_encryptionKey *password, afs_int32 kvno, afs_int32 caller)
{
afs_int32 code;
afs_int32 to; /* offset of block */
tentry.change_password_time = htonl(now);
- if (code = kawrite(tt, to, &tentry, sizeof(tentry)))
+ if ((code = kawrite(tt, to, (char *) &tentry, sizeof(tentry))))
return (KAIO);
return (0);
}
tentry.modification_time = htonl(now);
tentry.modification_id = htonl(caller);
- code = kawrite(tt, tentry_offset, &tentry, sizeof(tentry));
+ code = kawrite(tt, tentry_offset, (char *) &tentry, sizeof(tentry));
if (code)
goto abort;
--- /dev/null
+extern afs_int32 init_kaprocs(const char *, int);
+extern afs_int32 InitAuthServ(struct ubik_trans **, int, int *);
+extern afs_int32 kamCreateUser(struct rx_call *, char *, char *,
+ EncryptionKey);
+extern afs_int32 ChangePassWord(struct rx_call *, char *, char *, ka_CBS *,
+ ka_BBS *);
+extern afs_int32 kamSetPassword(struct rx_call *, char *, char *, afs_int32,
+ EncryptionKey apassword);
+extern afs_int32 kamSetFields(struct rx_call *, char *, char *, afs_int32,
+ Date, afs_int32, afs_int32, afs_uint32,
+ afs_int32 spare2);
+extern afs_int32 kamDeleteUser(struct rx_call *, char *, char *);
+extern afs_int32 kamGetEntry(struct rx_call *, char *, char *, afs_int32,
+ kaentryinfo *);
+extern afs_int32 kamListEntry(struct rx_call *, afs_int32, afs_int32 *,
+ afs_int32 *, kaident *);
+extern afs_int32 kamGetStats(struct rx_call *, afs_int32, afs_int32 *,
+ kasstats *, kadstats *);
+extern afs_int32 kamGetPassword(struct rx_call *, char *, EncryptionKey *);
+extern afs_int32 kamGetRandomKey(struct rx_call *, EncryptionKey *);
+extern afs_int32 kamDebug(struct rx_call *, afs_int32, int,
+ struct ka_debugInfo *);
+
#include <lock.h>
#include <afs/afsutil.h>
#include <afs/com_err.h>
+#include <afs/audit.h>
#include <ubik.h>
#include <sys/stat.h>
#include "kauth.h"
#include "kautils.h"
#include "kaserver.h"
-
+#include "kadatabase.h"
+#include "kaprocs.h"
struct kadstats dynamic_statistics;
struct ubik_dbase *KA_dbase;
/* check whether caller is authorized to manage RX statistics */
int
-KA_rxstat_userok(call)
- struct rx_call *call;
+KA_rxstat_userok(struct rx_call *call)
{
return afsconf_SuperUser(KA_conf, call, NULL);
}
}
static void
-initialize_dstats()
+initialize_dstats(void)
{
memset(&dynamic_statistics, 0, sizeof(dynamic_statistics));
dynamic_statistics.start_time = time(0);
}
static int
-convert_cell_to_ubik(cellinfo, myHost, serverList)
- struct afsconf_cell *cellinfo;
- afs_int32 *myHost;
- afs_int32 *serverList;
+convert_cell_to_ubik(struct afsconf_cell *cellinfo, afs_int32 *myHost,
+ afs_int32 *serverList)
{
int i;
char hostname[64];
}
static afs_int32
-kvno_admin_key(rock, kvno, key)
- char *rock;
- afs_int32 kvno;
- struct ktc_encryptionKey *key;
+kvno_admin_key(void *rock, afs_int32 kvno, struct ktc_encryptionKey *key)
{
return ka_LookupKvno(0, KA_ADMIN_NAME, KA_ADMIN_INST, kvno, key);
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char *argv[];
+int
+main(int argc, char *argv[])
{
afs_int32 code;
char *whoami = argv[0];
struct rx_securityClass *sca[1];
struct rx_securityClass *scm[3];
- extern int afsconf_ClientAuthSecure();
- extern int afsconf_ServerAuth();
- extern int afsconf_CheckAuth();
-
extern int rx_stackSize;
- extern int KAA_ExecuteRequest();
- extern int KAT_ExecuteRequest();
- extern int KAM_ExecuteRequest();
- extern int RXSTATS_ExecuteRequest();
+ extern int KAA_ExecuteRequest(struct rx_call *);
+ extern int KAT_ExecuteRequest(struct rx_call *);
+ extern int KAM_ExecuteRequest(struct rx_call *);
+ extern int RXSTATS_ExecuteRequest(struct rx_call *);
#ifdef AFS_AIX32_ENV
/*
goto usage;
}
}
- if (code = ka_CellConfig(cellservdb))
+ if ((code = ka_CellConfig(cellservdb)))
goto abort;
cell = ka_LocalCell();
KA_conf = afsconf_Open(cellservdb);
afsconf_GetExtendedCellInfo(KA_conf, cell, AFSCONF_KAUTHSERVICE,
&cellinfo, &clones);
if (servers) {
- if (code = ubik_ParseServerList(argc, argv, &myHost, serverList)) {
+ if ((code = ubik_ParseServerList(argc, argv, &myHost, serverList))) {
afs_com_err(whoami, code, "Couldn't parse server list");
exit(1);
}
if (init_kaprocs(lclpath, initFlags))
return -1;
- if (code = init_krb_udp()) {
+ if ((code = init_krb_udp())) {
ViceLog(0,
("Failed to initialize UDP interface; code = %d.\n", code));
ViceLog(0, ("Running without UDP access.\n"));
#include <rx/xdr.h>
#include <rx/rx.h>
#include <des.h>
+#include <des_prototypes.h>
#include "kauth.h"
#include "kautils.h"
#include <winsock2.h>
#include <afs/fs_utils.h>
#else
+#include <unistd.h>
#include <netinet/in.h>
#include <afs/venus.h>
#endif
#include <stdlib.h>
#include <string.h>
+#include "kkids.h"
+
#define MAXNAME 100
#define MAXSIZE 2048
struct ViceIoctl blob;
struct AclEntry *te;
char space[2046];
- int secure = 1;
afs_int32 code;
struct Acl *ta;
/* quickly and painlessly
*/
int
-terminate_child(char *pw)
+terminate_child(void)
{
int rc;
rc = 0;
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _KAUTH_KKIDS_H
+#define _KAUTH_KKIDS_H
+
+extern int init_child(char *);
+extern int password_bad(char *);
+extern int give_to_child(char *);
+extern int terminate_child(void);
+#endif
afs_com_err(rn, code, "Can't get local cell name!");
KLOGEXIT(code);
}
- if (code = ka_CellToRealm(lcell, lrealm, 0))
+ if ((code = ka_CellToRealm(lcell, lrealm, 0)))
goto nocell;
strcpy(instance, "");
if (!foundExplicitCell)
strcpy(realm, lcell);
- if (code = ka_CellToRealm(realm, realm, &local)) {
+ if ((code = ka_CellToRealm(realm, realm, &local))) {
if (!Silent)
afs_com_err(rn, code, "Can't convert cell to realm");
KLOGEXIT(code);
};
-static
-SetSysname(ahost, auid, sysname)
- afs_int32 ahost;
- afs_int32 auid;
- char *sysname;
+static int
+SetSysname(afs_int32 ahost, afs_int32 auid, char *sysname)
{
afs_int32 code;
afs_int32 pheader[6];
}
-static
-GetTokens(ahost, auid)
- afs_int32 ahost;
- afs_int32 auid;
+static int
+GetTokens(afs_int32 ahost, afs_int32 auid)
{
struct ViceIoctl iob;
afs_int32 pheader[6];
}
-static
-NFSUnlog(ahost, auid)
- afs_int32 ahost;
- afs_int32 auid;
+static int
+NFSUnlog(afs_int32 ahost, afs_int32 auid)
{
afs_int32 code;
afs_int32 pheader[6];
}
/* Copy the AFS service token into the kernel for a particular host and user */
-static
-NFSCopyToken(ahost, auid)
- afs_int32 ahost;
- afs_int32 auid;
+static int
+NFSCopyToken(afs_int32 ahost, afs_int32 auid)
{
struct ktc_principal client, server;
struct ktc_token theTicket;
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc, char **argv)
{
register struct cmd_syndesc *ts;
register afs_int32 code;
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <afs/cmd.h>
+#include <des.h>
+#include <des_prototypes.h>
#include "kauth.h"
#include "kautils.h"
+#include "kkids.h"
+
#ifndef AFS_NT40_ENV
#include <unistd.h>
#endif
static int zero_argc;
static char **zero_argv;
-extern int init_child(char *myname);
-extern int give_to_child(char *pw);
-extern int terminate_child(char *pw);
#ifdef AFS_NT40_ENV
struct passwd {
return code;
}
+#if 0
static int
password_ok(char *newpw, int *insist)
{
}
return 1; /* lie about it */
}
+#endif
static char rn[] = "kpasswd"; /* Routine name */
static int Pipe = 0; /* reading from a pipe */
conn = 0;
}
rx_Finalize();
- terminate_child(NULL);
+ terminate_child();
exit(code);
no_change: /* yuck, yuck, yuck */
memset(npasswd, 0, sizeof(npasswd));
printf("Password for '%s' in cell '%s' unchanged.\n\n", pw->pw_name,
cell);
- terminate_child(NULL);
+ terminate_child();
exit(code ? code : 1);
}
#include "AFS_component_version_number.c"
/* returns 0 if the password is long enough, otherwise non-zero */
+int
main(int argc, char *argv[])
{
char oldpassword[512];
#endif /* AFSLITTLE_ENDIAN */
afs_int32
-krb_write_ticket_file(realm)
- char *realm;
+krb_write_ticket_file(char *realm)
{
char ticket_file[AFSDIR_PATH_MAX];
int fd;
/* Use the KRBTKFILE environment variable if it exists, otherwise fall
* back upon /tmp/tkt(uid}.
*/
- if (tf_name = (char *)getenv("KRBTKFILE"))
+ if ((tf_name = (char *)getenv("KRBTKFILE")))
(void)sprintf(ticket_file, "%s", tf_name);
else
(void)sprintf(ticket_file, "%s/tkt%d", gettmpdir(), getuid());
#include <rx/rx.h>
#include <rx/rxkad.h>
#include <afs/auth.h>
+#include <des.h>
+#include <des_prototypes.h>
#include <ubik.h>
#include "kauth.h"
#include "kaport.h"
#include "afs/audit.h"
#include "kalog.h"
+#include "kadatabase.h"
/* my kerberos error codes */
#define KERB_ERR_BAD_MSG_TYPE 99
static afs_int32
-create_cipher(cipher, cipherLen, sessionKey, sname, sinst, start, end, kvno,
- ticket, ticketLen, key)
- char *cipher;
- int *cipherLen;
- struct ktc_encryptionKey *sessionKey;
- char *sname;
- char *sinst;
- Date start, end;
- afs_int32 kvno;
- char *ticket;
- int ticketLen;
- struct ktc_encryptionKey *key;
+create_cipher(char *cipher, int *cipherLen,
+ struct ktc_encryptionKey *sessionKey, char *sname,
+ char *sinst, Date start, Date end, afs_int32 kvno,
+ char *ticket, int ticketLen, struct ktc_encryptionKey *key)
{
char *answer;
int slen;
printf("\n");
}
- if (code = des_key_sched(key, schedule))
+ if ((code = des_key_sched(key, schedule)))
printf("In KAAuthenticate: key_sched returned %d\n", code);
des_pcbc_encrypt(cipher, cipher, len, schedule, key, ENCRYPT);
*cipherLen = round_up_to_ebs(len);
}
static afs_int32
-create_reply(ans, name, inst, startTime, endTime, kvno, cipher, cipherLen)
- struct packet *ans;
- char *name;
- char *inst;
- Date startTime, endTime;
- afs_int32 kvno;
- char *cipher;
- int cipherLen;
+create_reply(struct packet *ans, char *name, char *inst, Date startTime,
+ Date endTime, afs_int32 kvno, char *cipher, int cipherLen)
{
char *answer = ans->data;
int slen;
}
static afs_int32
-check_auth(pkt, auth, authLen, key, name, inst, cell)
- struct packet *pkt;
- char *auth;
- int authLen;
- struct ktc_encryptionKey *key;
- char *name;
- char *inst;
- char *cell;
+check_auth(struct packet *pkt, char *auth, int authLen,
+ struct ktc_encryptionKey *key, char *name, char *inst,
+ char *cell)
{
char *packet;
des_key_schedule schedule;
}
afs_int32
-UDP_Authenticate(ksoc, client, name, inst, startTime, endTime, sname, sinst)
- int ksoc;
- struct sockaddr_in *client;
- char *name;
- char *inst;
- Date startTime;
- Date endTime;
- char *sname;
- char *sinst;
+UDP_Authenticate(int ksoc, struct sockaddr_in *client, char *name,
+ char *inst, Date startTime, Date endTime, char *sname,
+ char *sinst)
{
struct ubik_trans *tt;
afs_int32 to; /* offset of block */
COUNT_REQ(UAuthenticate);
if (!name_instance_legal(name, inst))
return KERB_ERR_NAME_EXP; /* KABADNAME */
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
return code;
code = FindBlock(tt, name, inst, &to, &tentry);
}
afs_int32
-UDP_GetTicket(ksoc, pkt, kvno, authDomain, ticket, ticketLen, auth, authLen)
- int ksoc;
- struct packet *pkt;
- afs_int32 kvno;
- char *authDomain;
- char *ticket;
- int ticketLen;
- char *auth;
- int authLen;
+UDP_GetTicket(int ksoc, struct packet *pkt, afs_int32 kvno,
+ char *authDomain, char *ticket, int ticketLen, char *auth,
+ int authLen)
{
afs_int32 code;
struct ktc_encryptionKey tgskey;
COUNT_REQ(UGetTicket);
- if (code = InitAuthServ(&tt, LOCKREAD, this_op))
+ if ((code = InitAuthServ(&tt, LOCKREAD, this_op)))
goto fail;
code =
ka_LookupKvno(tt, KA_TGS_NAME,
}
static int
-err_packet(ksoc, pkt, code, reason)
- int ksoc;
- struct packet *pkt;
- afs_int32 code;
- char *reason;
+err_packet(int ksoc, struct packet *pkt, afs_int32 code, char *reason)
{
struct packet ans;
char *answer = ans.data;
}
int
-process_udp_auth(ksoc, pkt)
- int ksoc;
- struct packet *pkt;
+process_udp_auth(int ksoc, struct packet *pkt)
{
char *packet = pkt->rest;
char name[MAXKTCNAMELEN];
}
int
-process_udp_appl(ksoc, pkt)
- int ksoc;
- struct packet *pkt;
+process_udp_appl(int ksoc, struct packet *pkt)
{
char *packet = pkt->rest;
afs_int32 kvno;
}
void
-process_udp_request(ksoc, pkt)
- int ksoc;
- struct packet *pkt;
+process_udp_request(int ksoc, struct packet *pkt)
{
char *packet = pkt->data;
unsigned char version, auth_msg_type;
#include "AFS_component_version_number.c"
-main()
+int
+main(int, char **)
#else
afs_int32
-init_krb_udp()
+init_krb_udp(void)
#endif
{
struct sockaddr_in taddr;
#include <signal.h>
#include <setjmp.h>
#else
-char *strcpy();
-int strcmp();
+#include <string.h>
#endif
#if defined(AFS_AIX_ENV)
#include <signal.h>
/*** Routines ****************************************************** */
int
-des_read_password(k, prompt, verify)
- C_Block *k;
- char *prompt;
- int verify;
+des_read_password(C_Block *k, char *prompt, int verify)
{
int ok;
char key_string[BUFSIZ];
*/
static int
-good_gets(s, max)
- char *s;
- int max;
+good_gets(char *s, int max)
{
int l; /* length of string read */
if (!fgets(s, max, stdin)) {
#endif
int
-read_pw_string(s, max, prompt, verify)
- char *s;
- int max;
- char *prompt;
- int verify;
+read_pw_string(char *s, int max, char *prompt, int verify)
{
int ok = 0;
int len; /* password length */
* this can be static since we should never have more than
* one set saved....
*/
-static int (*old_sigfunc[NSIG]) ();
+static int (*old_sigfunc[NSIG]) (int);
static
-push_signals()
+push_signals(void)
{
register i;
for (i = 0; i < NSIG; i++)
}
static
-pop_signals()
+pop_signals(void)
{
register i;
for (i = 0; i < NSIG; i++)
}
static void
-sig_restore(sig, code, scp)
- int sig, code;
- struct sigcontext *scp;
+sig_restore(int sig, int code, struct sigcontext *scp)
{
longjmp(env, 1);
}
#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV)
static int
-catch()
+catch(void)
{
++intrupt;
}
#include <time.h>
#include <ubik.h>
#include <afs/cmd.h>
+#include <des.h>
+#include <des_prototypes.h>
#include <afs/com_err.h>
#include <winsock2.h>
#else
#include <netinet/in.h>
+#include <unistd.h>
#endif
#include <string.h>
#include <afs/cellconfig.h>
#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && (!defined(AFS_XBSD_ENV) || defined(AFS_FBSD_ENV))
/* handle smoothly the case where no AFS system calls exists (yet) */
- old = (int (*)())signal(SIGSYS, SIG_IGN);
+ old = signal(SIGSYS, SIG_IGN);
#endif
#ifdef AFS_DECOSF_ENV
(void)signal(SIGTRAP, SIG_IGN);