* g_svc_in_tkt.c (krb_svc_init, krb_svc_init_preauth): Declare as
returning int.
* gethostname.c: Include unistd.h for gethostname() prototype.
* getst.c: Include unistd.h for read() prototype.
* in_tkt.c (in_tkt): Cast arguments to debugging printf to int
from uid_t to match format statement.
* kname_parse.c: Declare k_isname() and k_isinst() as returning
int. Cleanup assigments in conditionals.
* kuserok.c (kuserok): Cleanup assignment in conditional.
* log.c (krb_set_logfile): Declare function as void.
* klog.c (kset_logfile): Likewise.
* pkt_clen.c (pkt_clen): Declare as returning int.
* kntoln.c (krb_kntoln): Likewise.
* fgetst.c (fgetst): Likewise.
* rd_req.c: Declare local variable only if KRB_CRYPT_DEBUG defined.
* recvauth.c: Include stdlib.h and unistd.h for read() and atoi()
prototypes.
* send_to_kdc.c: Include unistd.h for close() prototype.
* sendauth.c (krb_sendauth): Clean up assignment in conditional.
* tkt_string.c (tkt_string): Likewise
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13256
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-06-01 Ezra Peisach <epeisach@mit.edu>
+
+ * g_krbrlm.c: Remove unused static variable krb_conf.
+
+ * g_svc_in_tkt.c (krb_svc_init, krb_svc_init_preauth): Declare as
+ returning int.
+
+ * gethostname.c: Include unistd.h for gethostname() prototype.
+
+ * getst.c: Include unistd.h for read() prototype.
+
+ * in_tkt.c (in_tkt): Cast arguments to debugging printf to int
+ from uid_t to match format statement.
+
+ * kname_parse.c: Declare k_isname() and k_isinst() as returning
+ int. Cleanup assigments in conditionals.
+
+ * kuserok.c (kuserok): Cleanup assignment in conditional.
+
+ * log.c (krb_set_logfile): Declare function as void.
+ * klog.c (kset_logfile): Likewise.
+
+ * pkt_clen.c (pkt_clen): Declare as returning int.
+ * kntoln.c (krb_kntoln): Likewise.
+ * fgetst.c (fgetst): Likewise.
+
+ * rd_req.c: Declare local variable only if KRB_CRYPT_DEBUG defined.
+
+ * recvauth.c: Include stdlib.h and unistd.h for read() and atoi()
+ prototypes.
+
+ * send_to_kdc.c: Include unistd.h for close() prototype.
+
+ * sendauth.c (krb_sendauth): Clean up assignment in conditional.
+
+ * tkt_string.c (tkt_string): Likewise
+
2001-04-13 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (EHDRDIR): Install into kerberosIV subdirectory.
* returns the number of characters read, including the null terminator.
*/
+int
fgetst(f, s, n)
FILE *f;
register char *s;
int n;
{
- register count = n;
+ register int count = n;
int ch; /* NOT char; otherwise you don't see EOF */
while ((ch = getc(f)) != EOF && ch && --count) {
* krb_get_krbhst(). This will also look in KRB_FB_CONF is
* ATHENA_CONF_FALLBACK is defined.
*/
-static char *krb_conf = KRB_CONF;
-
-
KRB5_DLLIMP int KRB5_CALLCONV
krb_get_lrealm(r,n)
char *r;
return 0;
}
+int
krb_get_svc_in_tkt_preauth(user, instance, realm, service, sinstance, life, srvtab)
char *user, *instance, *realm, *service, *sinstance;
int life;
/* DEC's dss-kerberos adds krb_svc_init; simple enough */
+int
krb_svc_init(user,instance,realm,lifetime,srvtab_file,tkt_file)
char *user;
char *instance;
}
+int
krb_svc_init_preauth(user,instance,realm,lifetime,srvtab_file,tkt_file)
char *user;
char *instance;
if (err) return err;
if (!*name) return KNAME_FMT; /* null names are not OK */
if (!*realm) {
- if (err = krb_get_lrealm (realm, 1))
+ if ((err = krb_get_lrealm (realm, 1)))
return err;
if (!*realm) return KNAME_FMT; /* FIXME -- should give better error */
}
#include "mit-copyright.h"
#define DEFINE_SOCKADDR
#include "krb.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifndef GETHOSTNAME
#define GETHOSTNAME gethostname /* A rather simple default */
* interface is identical to BSD gethostname(2).)
*/
+int
k_gethostname(name, namelen)
char *name;
int namelen;
#include "mit-copyright.h"
#include "krb.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
/*
* getst() takes a file descriptor, a string and a count. It reads
* the null terminator.
*/
+int
getst(fd, s, n)
int fd;
register char *s;
return(KFAILURE);
} else
if (krb_debug)
- printf("swapped UID's %d and %d\n",metoo,me);
+ printf("swapped UID's %d and %d\n",(int) metoo, (int) me);
}
/* Set umask to ensure that we have write access on the created
ticket file. */
return(KFAILURE);
} else
if (krb_debug)
- printf("swapped UID's %d and %d\n",me,metoo);
+ printf("swapped UID's %d and %d\n", (int) me, (int) metoo);
}
if (tktfile < 0) {
if (krb_debug)
#include <klog.h>
static char *log_name = KRBLOG;
-static int is_open;
static char logtxt[1000];
/*
* the logfile defaults to KRBLOG, defined in "krb.h".
*/
+void
kset_logfile(filename)
char *filename;
{
log_name = filename;
- is_open = 0;
}
return KNAME_FMT;
(void) strcpy(buf, fullname);
- while (c = *rnext++) {
+ while ((c = *rnext++)) {
if (backslash) {
*wnext++ = c;
backslash = 0;
* Kerberos name; returns 0 if it's not.
*/
+int
k_isname(s)
char *s;
{
return 0;
if (strlen(s) > ANAME_SZ - 1)
return 0;
- while(c = *s++) {
+ while((c = *s++)) {
if (backslash) {
backslash = 0;
continue;
* We now allow periods in instance names -- they are unambiguous.
*/
+int
k_isinst(s)
char *s;
{
if (strlen(s) > INST_SZ - 1)
return 0;
- while(c = *s++) {
+ while((c = *s++)) {
if (backslash) {
backslash = 0;
continue;
* Kerberos realm; returns 0 if it's not.
*/
+int
k_isrealm(s)
char *s;
{
return 0;
if (strlen(s) > REALM_SZ - 1)
return 0;
- while(c = *s++) {
+ while((c = *s++)) {
if (backslash) {
backslash = 0;
continue;
* things will happen. */
#define MAX_USERNAME 10
+int
krb_kntoln(ad,lname)
AUTH_DAT *ad;
char *lname;
linebuf[BUFSIZ-1] = '\0';
newline = NULL;
/* nuke the newline if it exists */
- if (newline = strchr(linebuf, '\n'))
+ if ((newline = strchr(linebuf, '\n')))
*newline = '\0';
/* Default the fields (default realm is filled in later) */
#include <klog.h>
static char *log_name = KRBLOG;
+#if 0
static is_open;
+#endif
/*
* This file contains three logging routines: set_logfile()
* the logfile defaults to KRBLOG, defined in "krb.h".
*/
+void
krb_set_logfile(filename)
char *filename;
{
log_name = filename;
+#if 0
is_open = 0;
+#endif
}
#if 0
* ciphertext length out of the packet.
*/
+int
pkt_clen(pkt)
KTEXT pkt;
{
register unsigned char *ptr; /* For stepping through */
unsigned KRB4_32 t_local; /* Local time on our side of the protocol */
KRB4_32 delta_t; /* Time in authenticator minus local time */
+#ifdef KRB_CRYPT_DEBUG
KRB4_32 tkt_age; /* Age of ticket */
+#endif
int le; /* is little endian? */
int mutual; /* Mutual authentication requested? */
int t; /* msg type */
/* Now check for expiration of ticket */
ret = RD_AP_NYV;
- tkt_age = t_local - ad->time_sec;
#ifdef KRB_CRYPT_DEBUG
+ tkt_age = t_local - ad->time_sec;
if (krb_ap_req_debug)
log("Time: %d Issue Date: %d Diff: %d Life %x",
time_secs, ad->time_sec, tkt_age, ad->life);
#include <errno.h>
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#define KRB_SENDAUTH_VERS "AUTHV0.1" /* MUST be KRB_SENDAUTH_VLEN
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#define S_AD_SZ sizeof(struct sockaddr_in)
* after several retries
*/
+int
send_to_kdc(pkt,rpkt,realm)
KTEXT pkt;
KTEXT rpkt;
char *scol;
int krb_udp_port = 0;
int krbsec_udp_port = 0;
- int default_port;
/*
* If "realm" is non-null, use that, otherwise get the
/* The first time, decide what port to use for the KDC. */
if (cached_krb_udp_port == 0) {
register struct servent FAR *sp;
- if (sp = getservbyname("kerberos","udp"))
+ sp = getservbyname("kerberos","udp");
+ if (sp)
cached_krb_udp_port = sp->s_port;
else
cached_krb_udp_port = htons(KERBEROS_PORT); /* kerberos/udp */
if (cached_krbsec_udp_port == 0 &&
cached_krb_udp_port != htons(KERBEROS_PORT)) {
register struct servent FAR *sp;
- if (sp = getservbyname("kerberos-sec","udp"))
+ sp = getservbyname("kerberos-sec","udp");
+ if (sp)
cached_krbsec_udp_port = sp->s_port;
else
cached_krbsec_udp_port = htons(KERBEROS_PORT); /* kerberos/udp */
/* End of kludge (FIXME) for FTP Software WinSock stack. */
no_host = 1;
- default_port = 0;
/* get an initial allocation */
n_hosts = 0;
for (i = 1; krb_get_krbhst(krbhst, lrealm, i) == KSUCCESS; ++i) {
} else {
krb_udp_port = cached_krb_udp_port;
krbsec_udp_port = cached_krbsec_udp_port;
- default_port = 1;
}
farkedhost = gethostbyname(krbhst);
#ifdef DEBUG
if (options & KOPT_DO_MUTUAL) {
/* get credentials so we have service session
key for decryption below */
- if (cc = krb_get_cred(service, srv_inst, realm, cred))
+ cc = krb_get_cred(service, srv_inst, realm, cred);
+ if (cc)
return(cc);
/* Get the reply out of the socket. */
uid_t getuid();
if (!*krb_ticket_string) {
- if (env = getenv("KRBTKFILE")) {
+ env = getenv("KRBTKFILE");
+ if (env) {
(void) strncpy(krb_ticket_string, env,
sizeof(krb_ticket_string)-1);
krb_ticket_string[sizeof(krb_ticket_string)-1] = '\0';
} else {
/* 32 bits of signed integer will always fit in 11 characters
(including the sign), so no need to worry about overflow */
- (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,getuid());
+ (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,(int) getuid());
}
}
return krb_ticket_string;