Package: krb4
Version: 1.2.2-10
Author: Guillem Jover <guillem@debian.org>
Status: not-sent
Dedscription:
 Ported to the Hurd.
 Needs to be put on debian/patches/036_hurd.

diff -Naur krb4-1.2.2.orig/appl/bsd/login_access.c krb4-1.2.2/appl/bsd/login_access.c
--- krb4-1.2.2.orig/appl/bsd/login_access.c	2001-06-04 16:08:39.000000000 +0200
+++ krb4-1.2.2/appl/bsd/login_access.c	2004-06-14 21:01:05.000000000 +0200
@@ -165,11 +165,11 @@
 
 static char *myhostname(void)
 {
-    static char name[MAXHOSTNAMELEN + 1] = "";
+    static char name[MaxHostNameLen + 1] = "";
 
     if (name[0] == 0) {
 	gethostname(name, sizeof(name));
-	name[MAXHOSTNAMELEN] = 0;
+	name[MaxHostNameLen] = 0;
     }
     return (name);
 }
diff -Naur krb4-1.2.2.orig/appl/bsd/rshd.c krb4-1.2.2/appl/bsd/rshd.c
--- krb4-1.2.2.orig/appl/bsd/rshd.c	2001-09-17 06:42:47.000000000 +0200
+++ krb4-1.2.2/appl/bsd/rshd.c	2004-06-14 21:01:05.000000000 +0200
@@ -199,7 +199,7 @@
     const char *errorhost = "";
     char *errorstr;
     char *cp, sig, buf[DES_RW_MAXWRITE];
-    char cmdbuf[NCARGS+1], locuser[16], remuser[16];
+    char cmdbuf[NCARGS], locuser[16], remuser[16];
     char remotehost[2 * MaxHostNameLen + 1];
     uid_t uid;
     char shell_path[MAXPATHLEN];
diff -Naur krb4-1.2.2.orig/lib/kafs/kafs.h krb4-1.2.2/lib/kafs/kafs.h
--- krb4-1.2.2.orig/lib/kafs/kafs.h	2001-09-10 18:05:31.000000000 +0200
+++ krb4-1.2.2/lib/kafs/kafs.h	2004-06-14 21:01:05.000000000 +0200
@@ -49,6 +49,11 @@
 #define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
 #endif /* _VICEIOCTL */
 
+#ifdef __GNU__
+#define _IOT_ViceIoctl	/* Hurd ioctl type field. */ \
+	_IOT (_IOTS (caddr_t), 2, _IOTS (short), 2, 0, 0)
+#endif
+
 #define VIOCSETAL		_VICEIOCTL(1)
 #define VIOCGETAL		_VICEIOCTL(2)
 #define VIOCSETTOK		_VICEIOCTL(3)
diff -Naur krb4-1.2.2.orig/lib/roken/getaddrinfo_hostspec.c krb4-1.2.2/lib/roken/getaddrinfo_hostspec.c
--- krb4-1.2.2.orig/lib/roken/getaddrinfo_hostspec.c	2000-07-15 14:50:32.000000000 +0200
+++ krb4-1.2.2/lib/roken/getaddrinfo_hostspec.c	2004-06-14 20:55:15.000000000 +0200
@@ -48,9 +48,9 @@
 {
     const char *p;
     char portstr[NI_MAXSERV];
-    char host[MAXHOSTNAMELEN];
+    char *host;
     struct addrinfo hints;
-    int hostspec_len;
+    int hostspec_len, res;
 
     struct hst {
 	const char *prefix;
@@ -91,8 +91,16 @@
     }
     snprintf (portstr, sizeof(portstr), "%u", port);
     
-    snprintf (host, sizeof(host), "%.*s", hostspec_len, hostspec);
-    return getaddrinfo (host, portstr, &hints, ai);
+    host = malloc(hostspec_len);
+    if (host == NULL) {
+	res = EAI_MEMORY;
+    } else {
+	snprintf (host, hostspec_len, "%.*s", hostspec_len, hostspec);
+	res = getaddrinfo (host, portstr, &hints, ai);
+	free (host);
+    }
+    
+    return res;
 }
 
 int
