#include "afs/stds.h"
#include "afs/pthread_glock.h"
#include "des/des.h"
+#include "des/des_prototypes.h"
#include "rx/rxkad.h"
#include "rx/rx.h"
#include "afs/cellconfig.h"
#include <netdb.h>
#endif
#include <string.h>
+#include <stdio.h>
#include <des.h>
+#include <des_prototypes.h>
#include <rx/rxkad.h>
#include <rx/rx.h>
#include "cellconfig.h"
/* return a null security object if nothing else can be done */
static afs_int32
-QuickAuth(astr, aindex)
- struct rx_securityClass **astr;
- afs_int32 *aindex;
+QuickAuth(struct rx_securityClass **astr, afs_int32 *aindex)
{
register struct rx_securityClass *tc;
tc = rxnull_NewClientSecurityObject();
#if !defined(UKERNEL)
/* Return an appropriate security class and index */
afs_int32
-afsconf_ServerAuth(adir, astr, aindex)
- register struct afsconf_dir *adir;
- struct rx_securityClass **astr;
- afs_int32 *aindex;
+afsconf_ServerAuth(register struct afsconf_dir *adir,
+ struct rx_securityClass **astr,
+ afs_int32 *aindex)
{
register struct rx_securityClass *tclass;
#endif /* !defined(UKERNEL) */
static afs_int32
-GenericAuth(adir, astr, aindex, enclevel)
- struct afsconf_dir *adir;
- struct rx_securityClass **astr;
- afs_int32 *aindex;
- rxkad_level enclevel;
+GenericAuth(struct afsconf_dir *adir,
+ struct rx_securityClass **astr,
+ afs_int32 *aindex,
+ rxkad_level enclevel)
{
char tbuffer[256];
struct ktc_encryptionKey key, session;
* tells rxkad to encrypt the data, too.
*/
afs_int32
-afsconf_ClientAuthSecure(adir, astr, aindex)
- struct afsconf_dir *adir;
- struct rx_securityClass **astr;
- afs_int32 *aindex;
+afsconf_ClientAuthSecure(struct afsconf_dir *adir,
+ struct rx_securityClass **astr,
+ afs_int32 *aindex)
{
afs_int32 rc;
#include <unistd.h>
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <afs/stds.h>
#include <afs/pthread_glock.h>
#include <sys/types.h>
/* the following routines aren't static anymore on behalf of the kerberos IV
* compatibility library built in subtree krb.
*/
-int afs_tf_init(), afs_tf_get_pname(), afs_tf_get_pinst(), afs_tf_get_cred();
-int afs_tf_save_cred(), afs_tf_close(), afs_tf_create();
-int afs_tf_dest_tkt();
-static void ktc_LocalCell();
+int afs_tf_init(char *, int);
+int afs_tf_get_pname(char *);
+int afs_tf_get_pinst(char *);
+int afs_tf_get_cred(struct ktc_principal *, struct ktc_token *);
+int afs_tf_save_cred(struct ktc_principal *, struct ktc_token *,
+ struct ktc_principal *);
+int afs_tf_close(void);
+int afs_tf_create(char *, char *);
+int afs_tf_dest_tkt(void);
+static void ktc_LocalCell(void);
#endif /* AFS_KERBEROS_ENV */
#ifdef AFS_DUX40_ENV
* now. */
static int
-NewSetToken(aserver, atoken, aclient, flags)
- struct ktc_principal *aserver;
- struct ktc_principal *aclient;
- struct ktc_token *atoken;
- afs_int32 flags;
+NewSetToken(struct ktc_principal *aserver,
+ struct ktc_token *atoken,
+ struct ktc_principal *aclient,
+ afs_int32 flags)
{
TRY_KERNEL(KTC_SETTOKEN_OP, aserver, aclient, atoken,
sizeof(struct ktc_token));
(3*sizeof(afs_int32)+MAXKTCTICKETLEN+sizeof(struct ClearToken)+MAXKTCREALMLEN)
static int
-OldSetToken(aserver, atoken, aclient, flags)
- struct ktc_principal *aserver, *aclient;
- struct ktc_token *atoken;
- afs_int32 flags;
+OldSetToken(struct ktc_principal *aserver, struct ktc_token *atoken,
+ struct ktc_principal *aclient, afs_int32 flags)
{
struct ViceIoctl iob;
char tbuffer[MAXPIOCTLTOKENLEN];
/* get token, given server we need and token buffer. aclient will eventually
* be set to our identity to the server.
*/
-ktc_GetToken(aserver, atoken, atokenLen, aclient)
- struct ktc_principal *aserver, *aclient;
- int atokenLen;
- struct ktc_token *atoken;
+int
+ktc_GetToken(struct ktc_principal *aserver, struct ktc_token *atoken,
+ int atokenLen, struct ktc_principal *aclient)
{
struct ViceIoctl iob;
char tbuffer[MAXPIOCTLTOKENLEN];
afs_int32 temp;
int maxLen; /* biggest ticket we can copy */
int tktLen; /* server ticket length */
+#ifdef AFS_KERBEROS_ENV
char found = 0;
+#endif
LOCK_GLOBAL_MUTEX;
#ifndef NO_AFS_CLIENT
found = 1;
} else {
char tmpstring[MAXHOSTCHARS];
- afs_tf_get_pname(&tmpstring);
- afs_tf_get_pinst(&tmpstring);
+ afs_tf_get_pname(tmpstring);
+ afs_tf_get_pinst(tmpstring);
found = 1;
}
}
* NOT IMPLEMENTED YET!
*/
#ifndef NO_AFS_CLIENT
-ktc_ForgetToken(aserver)
- struct ktc_principal *aserver;
+int
+ktc_ForgetToken(struct ktc_principal *aserver)
{
int rc;
/* ktc_OldPioctl - returns a boolean true if the kernel supports only the old
* pioctl interface for delivering AFS tickets to the cache manager. */
-ktc_OldPioctl()
+int
+ktc_OldPioctl(void)
{
int rc;
LOCK_GLOBAL_MUTEX;
* c. In tf_close, be sure it gets reinitialized to a negative
* number.
*/
-static fd = -1;
-static curpos; /* Position in tfbfr */
-static lastpos; /* End of tfbfr */
+static int fd = -1;
+static int curpos; /* Position in tfbfr */
+static int lastpos; /* End of tfbfr */
static char tfbfr[BUFSIZ]; /* Buffer for ticket data */
-static tf_gets(), tf_read();
+static int tf_gets(char *, int);
+static int tf_read(char *, int);
/*
* This file contains routines for manipulating the ticket cache file.
* TKT_FIL_LCK - couldn't lock the file, even after a retry
*/
-afs_tf_init(tf_name, rw)
- char *tf_name;
+int
+afs_tf_init(char *tf_name, int rw)
{
int wflag;
int me;
* was longer than MAXKTCNAMELEN, TKT_FIL_FMT is returned.
*/
-afs_tf_get_pname(p)
- char *p;
+int
+afs_tf_get_pname(char *p)
{
if (fd < 0) {
return TKT_FIL_INI;
* instance may be null.
*/
-afs_tf_get_pinst(inst)
- char *inst;
+int
+afs_tf_get_pinst(char *inst)
{
if (fd < 0) {
return TKT_FIL_INI;
* EOF - end of file encountered
*/
-afs_tf_get_cred(principal, token)
- struct ktc_principal *principal;
- struct ktc_token *token;
+int
+afs_tf_get_cred(struct ktc_principal *principal, struct ktc_token *token)
{
int k_errno;
int kvno, lifetime;
* The return value is not defined.
*/
-afs_tf_close()
+int
+afs_tf_close(void)
{
if (!(fd < 0)) {
#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)
fd = -1; /* see declaration of fd above */
}
memset(tfbfr, 0, sizeof(tfbfr));
+ return 0;
}
/*
* file is seriously ill.
*/
-static
-tf_gets(s, n)
- register char *s;
+static int
+tf_gets(register char *s, int n)
{
- register count;
+ register int count;
if (fd < 0) {
return TKT_FIL_INI;
* 0 on end of file or read error
*/
-static
-tf_read(s, n)
- register char *s;
- register n;
+static int
+tf_read(register char *s, register int n)
{
- register count;
+ register int count;
for (count = n; count > 0; --count) {
if (curpos >= sizeof(tfbfr)) {
return n;
}
-char *tkt_string();
-
/*
* afs_tf_save_cred() appends an incoming ticket to the end of the ticket
* file. You must call afs_tf_init() before calling afs_tf_save_cred().
* called previously, and KFAILURE for anything else that went wrong.
*/
-afs_tf_save_cred(aserver, atoken, aclient)
- struct ktc_principal *aserver;
- struct ktc_principal *aclient;
- struct ktc_token *atoken; /* Token */
+int
+afs_tf_save_cred(struct ktc_principal *aserver,
+ struct ktc_token *atoken,
+ struct ktc_principal *aclient)
{
char realm[MAXKTCREALMLEN + 1];
char junk[MAXKTCNAMELEN];
* <mit-copyright.h>.
*/
-char *getenv();
-
/*
* This routine is used to generate the name of the file that holds
* the user's cache of server tickets and associated session keys.
LOCK_GLOBAL_MUTEX;
if (!*krb_ticket_string) {
- if (env = getenv("KRBTKFILE")) {
+ if ((env = getenv("KRBTKFILE"))) {
(void)strncpy(krb_ticket_string, env,
sizeof(krb_ticket_string) - 1);
krb_ticket_string[sizeof(krb_ticket_string) - 1] = '\0';
* success, or KFAILURE if something goes wrong.
*/
-afs_tf_create(pname, pinst)
- char *pname;
- char *pinst;
+int
+afs_tf_create(char *pname, char *pinst)
{
int tktfile;
int me, metoo;
* failure.
*/
-afs_tf_dest_tkt()
+int
+afs_tf_dest_tkt(void)
{
char *file = ktc_tkt_string();
int i, fd;
}
static afs_uint32
-curpag()
+curpag(void)
{
#if defined(AFS_AIX51_ENV)
afs_int32 pag;
#endif
}
-
-ktc_newpag()
+int
+ktc_newpag(void)
{
extern char **environ;
if (pag == -1) {
sprintf(fname, "%s%d", prefix, getuid());
} else {
- sprintf(fname, "%sp%ld", prefix, pag);
+ sprintf(fname, "%sp%ld", prefix, (long int) pag);
}
ktc_set_tkt_string(fname);
numenv++;
newenv = (char **)malloc((numenv + 2) * sizeof(char *));
- for (senv = environ, denv = newenv; *senv; *senv++) {
+ for (senv = environ, denv = newenv; *senv; senv++) {
if (strncmp(*senv, "KRBTKFILE=", 10) != 0)
*denv++ = *senv;
}
*++denv = 0;
environ = newenv;
UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
/*
* find out what the local cell is.
*/
static void
-ktc_LocalCell()
+ktc_LocalCell(void)
{
int code;
struct afsconf_dir *conf;
#include "keys.h"
#include "afs/audit.h"
-afs_int32 afsconf_SuperUser();
-
#if !defined(UKERNEL)
int
-afsconf_CheckAuth(adir, acall)
- register struct rx_call *acall;
- register struct afsconf_dir *adir;
+afsconf_CheckAuth(register struct afsconf_dir *adir,
+ register struct rx_call *acall)
{
LOCK_GLOBAL_MUTEX;
return ((afsconf_SuperUser(adir, acall, NULL) == 0) ? 10029 : 0);
#endif /* !defined(UKERNEL) */
static int
-GetNoAuthFlag(adir)
- struct afsconf_dir *adir;
+GetNoAuthFlag(struct afsconf_dir *adir)
{
if (access(AFSDIR_SERVER_NOAUTH_FILEPATH, 0) == 0) {
osi_audit(NoAuthEvent, 0, AUD_END); /* some random server is running noauth */
int
-afsconf_GetNoAuthFlag(adir)
- struct afsconf_dir *adir;
+afsconf_GetNoAuthFlag(struct afsconf_dir *adir)
{
int rc;
}
void
-afsconf_SetNoAuthFlag(adir, aflag)
- struct afsconf_dir *adir;
- int aflag;
+afsconf_SetNoAuthFlag(struct afsconf_dir *adir, int aflag)
{
register afs_int32 code;
/* deletes a user from the UserList file */
int
-afsconf_DeleteUser(adir, auser)
- struct afsconf_dir *adir;
- register char *auser;
+afsconf_DeleteUser(struct afsconf_dir *adir, register char *auser)
{
char tbuffer[1024];
char nbuffer[1024];
/* returns nth super user from the UserList file */
int
-afsconf_GetNthUser(adir, an, abuffer, abufferLen)
- struct afsconf_dir *adir;
- afs_int32 an;
- char *abuffer;
- afs_int32 abufferLen;
+afsconf_GetNthUser(struct afsconf_dir *adir, afs_int32 an, char *abuffer,
+ afs_int32 abufferLen)
{
char tbuffer[256];
register FILE *tf;
/* returns true iff user is in the UserList file */
static int
-FindUser(adir, auser)
- struct afsconf_dir *adir;
- register char *auser;
+FindUser(struct afsconf_dir *adir, register char *auser)
{
char tbuffer[256];
register bufio_p bp;
/* add a user to the user list, checking for duplicates */
int
-afsconf_AddUser(adir, aname)
- struct afsconf_dir *adir;
- char *aname;
+afsconf_AddUser(struct afsconf_dir *adir, char *aname)
{
FILE *tf;
register afs_int32 code;
otherwise returns NULL. The resulting string should be immediately
copied to other storage prior to release of mutex. */
static char *
-CompFindUser(adir, name, sep, inst, realm)
- struct afsconf_dir *adir;
- char *name;
- char *sep;
- char *inst;
- char *realm;
+CompFindUser(struct afsconf_dir *adir, char *name, char *sep, char *inst,
+ char *realm)
{
static char fullname[MAXKTCNAMELEN + MAXKTCNAMELEN + MAXKTCREALMLEN + 3];
if a pointer is passed.
*/
afs_int32
-afsconf_SuperUser(adir, acall, namep)
- struct afsconf_dir *adir;
- struct rx_call *acall;
- char *namep;
+afsconf_SuperUser(struct afsconf_dir *adir, struct rx_call *acall, char *namep)
{
register struct rx_connection *tconn;
register afs_int32 code;
tmp = tcell_l;
while (*tmp) {
*tmp = tolower(*tmp);
- *tmp++;
+ tmp++;
}
/* determine local cell name. It's static, so will only get