From 96d4fa20ba03220f81ecb70a63022fc3da5ff530 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 17 Mar 1995 20:58:31 +0000 Subject: [PATCH] Makefile.in, configure.in: Use the libdes425 library so that the DES code doesn't get dragged in twice. krlogind.c: Include so that Linux can get the FD_SET macros. kcmd.c (kcmd): Close the credentials cache when you're done with it. krlogind.c (doit): Always initialize the Krb5 error table. krlogind.c (main, doit): Minor type fixes to gethostbyname(), accept(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5151 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 16 ++++++++++++++++ src/appl/bsd/Makefile.in | 4 ++-- src/appl/bsd/configure.in | 2 +- src/appl/bsd/kcmd.c | 1 + src/appl/bsd/krlogind.c | 11 ++++++----- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 4fe21ef4a..a4d3899cb 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,19 @@ +Tue Mar 14 16:08:08 1995 + + * Makefile.in, configure.in: Use the libdes425 library so that the + DES code doesn't get dragged in twice. + + * krlogind.c: Include so that Linux can get the + FD_SET macros. + + * kcmd.c (kcmd): Close the credentials cache when you're done with + it. + + * krlogind.c (doit): Always initialize the Krb5 error table. + + * krlogind.c (main, doit): Minor type fixes to gethostbyname(), + accept(). + Fri Mar 10 18:32:22 1995 Theodore Y. Ts'o * kcmd.c (kcmd): Initialize ret_cred to zero so that in case of an diff --git a/src/appl/bsd/Makefile.in b/src/appl/bsd/Makefile.in index f2d5890c0..54abb2cee 100644 --- a/src/appl/bsd/Makefile.in +++ b/src/appl/bsd/Makefile.in @@ -52,14 +52,14 @@ install:: $(INSTALL_DATA) $(srcdir)/rlogin.M ${DESTDIR}$(CLIENT_MANDIR)/rlogin.1 krshd: krshd.o kcmd.o logutil.o forward.o $(SETENVOBJ) $(LIBOBJS) $(DEPKLIB) - $(CC) $(CFLAGS) -o krshd krshd.o kcmd.o logutil.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KLIB) $(K4LIB) $(LIBS) + $(CC) $(CFLAGS) -o krshd krshd.o kcmd.o logutil.o forward.o $(SETENVOBJ) $(LIBOBJS) $(K4LIB) $(KLIB) $(LIBS) install:: $(INSTALL_PROGRAM) krshd $(DESTDIR)$(SERVER_BINDIR)/krshd $(INSTALL_DATA) $(srcdir)/krshd.M ${DESTDIR}$(SERVER_MANDIR)/krshd.8 krlogind: krlogind.o logutil.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(DEPKLIB) - $(CC) $(CFLAGS) -o krlogind krlogind.o logutil.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KLIB) $(K4LIB) $(LIBS) + $(CC) $(CFLAGS) -o krlogind krlogind.o logutil.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(K4LIB) $(KLIB) $(LIBS) install:: $(INSTALL_PROGRAM) krlogind $(DESTDIR)$(SERVER_BINDIR)/krlogind diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index 9b711342f..ea5f95b75 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -57,7 +57,7 @@ PATH=$save_path dnl AC_ARG_WITH([krb4],[include Kerberos V4 support], ADD_DEF(-DKRB5_KRB4_COMPAT) -K4LIB='$(KRB4)/lib/libkrb.a $(KRB4)/lib/libdes.a', +K4LIB='$(KRB4)/lib/libkrb.a $(KRB4)/lib/libdes425.a', echo "warning: no krb4 backwards compatibility support" K4LIB=) AC_SUBST(K4LIB) diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c index c2989ae4d..5bda9ff35 100644 --- a/src/appl/bsd/kcmd.c +++ b/src/appl/bsd/kcmd.c @@ -291,6 +291,7 @@ kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm, /* Get ticket from credentials cache or kdc */ status = krb5_get_credentials(bsd_context, 0, cc, get_cred, &ret_cred); + (void) krb5_cc_close(bsd_context, cc); krb5_free_creds(bsd_context, get_cred); if (status) goto bad2; diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index 71e4753f4..1f9dac7be 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -118,6 +118,7 @@ char copyright[] = #include #include #include +#include #include #include #include @@ -427,7 +428,7 @@ main(argc, argv) exit(2); } - if ((fd = accept(s, &from, &fromlen)) < 0) { + if ((fd = accept(s, (struct sockaddr *) &from, &fromlen)) < 0) { fprintf(stderr, "Error in accept: %s\n", strerror(errno)); exit(2); } @@ -499,7 +500,7 @@ void doit(f, fromp) #endif fromp->sin_port = ntohs((u_short)fromp->sin_port); - hp = gethostbyaddr(&fromp->sin_addr, sizeof (struct in_addr), + hp = gethostbyaddr((char *) &fromp->sin_addr, sizeof (struct in_addr), fromp->sin_family); if (hp == 0) { /* @@ -515,10 +516,10 @@ void doit(f, fromp) fatal(f, "Permission denied - Malformed from address\n"); #ifdef KERBEROS + krb5_init_context(&bsd_context); + krb5_init_ets(bsd_context); if (must_pass_k5 || must_pass_one) { - /* Init error messages and setup des buffers */ - krb5_init_context(&bsd_context); - krb5_init_ets(bsd_context); + /* setup des buffers */ desinbuf.data = des_inbuf; desoutbuf.data = des_outbuf; /* Set up des buffers */ } -- 2.26.2