summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>1999-08-02 20:16:07 +0000
committerKen Raeburn <raeburn@mit.edu>1999-08-02 20:16:07 +0000
commit45770d93d709fbeae92fc1ddb62e6da683280eeb (patch)
tree1631f7203a4d03b01d6a97bb91f189ef2270e4a6 /src
parent7716394fbdb4a4dec93525bbbad30aa0e150760c (diff)
downloadkrb5-45770d93d709fbeae92fc1ddb62e6da683280eeb.tar.gz
krb5-45770d93d709fbeae92fc1ddb62e6da683280eeb.tar.xz
krb5-45770d93d709fbeae92fc1ddb62e6da683280eeb.zip
Patches from Brad Thompson for building without krb4 compatibility
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11612 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/appl/bsd/ChangeLog12
-rw-r--r--src/appl/bsd/kcmd.c2
-rw-r--r--src/appl/bsd/krshd.c22
3 files changed, 32 insertions, 4 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog
index b0c1d4b2f..1a941cd53 100644
--- a/src/appl/bsd/ChangeLog
+++ b/src/appl/bsd/ChangeLog
@@ -1,3 +1,15 @@
+1999-08-02 Ken Raeburn <raeburn@mit.edu>
+ and Brad Thompson <yak@mit.edu>
+
+ Patches from Brad Thompson for building without krb4
+ compatibility:
+ * krshd.c: Include sys/socket.h and netdb.h if KRB5_KRB4_COMPAT
+ isn't defined.
+ (doit): Cast pointer argument to getsockname.
+ (recvauth): Do krb4 stuff only if KRB5_KRB4_COMPAT is defined;
+ otherwise, skip it and call krb5_recvauth.
+ * kcmd.c (do_lencheck): Define even if !KRB5_KRB4_COMPAT.
+
1999-07-26 Ken Raeburn <raeburn@mit.edu>
* login.c (main): Fix typo in computing strncpy length for shell
diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c
index 701606548..6b0eafcde 100644
--- a/src/appl/bsd/kcmd.c
+++ b/src/appl/bsd/kcmd.c
@@ -130,8 +130,8 @@ static int v5_des_read(), v5_des_write();
static int v4_des_read(), v4_des_write();
static C_Block v4_session;
static int right_justify;
-static int do_lencheck;
#endif
+static int do_lencheck;
kcmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, service, realm,
cred, seqno, server_seqno, laddr, faddr, authopts, anyport, suppress_err)
diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c
index a29d17a07..2a1391704 100644
--- a/src/appl/bsd/krshd.c
+++ b/src/appl/bsd/krshd.c
@@ -89,7 +89,7 @@ char copyright[] =
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/param.h>
-#ifndef KERBEROS
+#if !defined(KERBEROS) || !defined(KRB5_KRB4_COMPAT)
/* Ultrix doesn't protect it vs multiple inclusion, and krb.h includes it */
#include <sys/socket.h>
#endif
@@ -120,7 +120,7 @@ char copyright[] =
#endif
#include <signal.h>
-#ifndef KERBEROS
+#if !defined(KERBEROS) || !defined(KRB5_KRB4_COMPAT)
/* Ultrix doesn't protect it vs multiple inclusion, and krb.h includes it */
#include <netdb.h>
#endif
@@ -639,7 +639,7 @@ void doit(f, fromp)
{
int sin_len = sizeof (struct sockaddr_in);
- if (getsockname(f, &localaddr, &sin_len) < 0) {
+ if (getsockname(f, (struct sockaddr*)&localaddr, &sin_len) < 0) {
perror("getsockname");
exit(1);
}
@@ -1771,8 +1771,10 @@ recvauth(netf, peersin, valid_checksum)
char krb_vers[KRB_SENDAUTH_VLEN + 1];
int len;
krb5_data inbuf;
+#ifdef KRB5_KRB4_COMPAT
char v4_instance[INST_SZ]; /* V4 Instance */
char v4_version[9];
+#endif
krb5_authenticator *authenticator;
krb5_ticket *ticket;
krb5_rcache rcache;
@@ -1792,7 +1794,9 @@ recvauth(netf, peersin, valid_checksum)
#define SIZEOF_INADDR sizeof(struct in_addr)
#endif
+#ifdef KRB5_KRB4_COMPAT
strcpy(v4_instance, "*");
+#endif
if (status = krb5_auth_con_init(bsd_context, &auth_context))
return status;
@@ -1821,6 +1825,7 @@ recvauth(netf, peersin, valid_checksum)
if (status) return status;
}
+#ifdef KRB5_KRB4_COMPAT
status = krb5_compat_recvauth(bsd_context, &auth_context, &netf,
"KCMDV0.1",
NULL, /* Specify daemon principal */
@@ -1836,6 +1841,15 @@ recvauth(netf, peersin, valid_checksum)
&ticket, /* return ticket */
&auth_sys, /* which authentication system*/
&v4_kdata, 0, v4_version);
+#else
+ status = krb5_recvauth(bsd_context, &auth_context, &netf,
+ "KCMDV0.1",
+ NULL, /* daemon principal */
+ 0, /* no flags */
+ keytab, /* normally NULL to use v5srvtab */
+ &ticket); /* return ticket */
+ auth_sys = KRB5_RECVAUTH_V5;
+#endif
if (status) {
if (auth_sys == KRB5_RECVAUTH_V5) {
@@ -1852,6 +1866,7 @@ recvauth(netf, peersin, valid_checksum)
getstr(netf, locuser, sizeof(locuser), "locuser");
getstr(netf, cmdbuf, sizeof(cmdbuf), "command");
+#ifdef KRB5_KRB4_COMPAT
if (auth_sys == KRB5_RECVAUTH_V4) {
rcmd_stream_init_normal();
@@ -1870,6 +1885,7 @@ recvauth(netf, peersin, valid_checksum)
return status;
}
+#endif /* KRB5_KRB4_COMPAT */
/* Must be V5 */