+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
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)
#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
#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
{
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);
}
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;
#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;
if (status) return status;
}
+#ifdef KRB5_KRB4_COMPAT
status = krb5_compat_recvauth(bsd_context, &auth_context, &netf,
"KCMDV0.1",
NULL, /* Specify daemon principal */
&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) {
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();
return status;
}
+#endif /* KRB5_KRB4_COMPAT */
/* Must be V5 */