diff -uNr netkit-rsh-0.17//rexecd/rexecd.c netkit-rsh-0.17-jjo//rexecd/rexecd.c
--- netkit-rsh-0.17//rexecd/rexecd.c	2000-07-23 00:16:22.000000000 -0400
+++ netkit-rsh-0.17-jjo//rexecd/rexecd.c	2011-04-04 20:38:22.000000000 -0400
@@ -223,7 +223,7 @@
 static void
 doit(struct sockaddr_in *fromp)
 {
-	char cmdbuf[ARG_MAX+1];
+	char cmdbuf[sysconf(_SC_ARG_MAX)+1];
 	char user[16], pass[16];
 	struct passwd *pwd;
 	int s = -1;
diff -uNr netkit-rsh-0.17//rshd/rshd.c netkit-rsh-0.17-jjo//rshd/rshd.c
--- netkit-rsh-0.17//rshd/rshd.c	2000-07-23 00:16:24.000000000 -0400
+++ netkit-rsh-0.17-jjo//rshd/rshd.c	2011-04-04 20:36:36.000000000 -0400
@@ -331,7 +331,7 @@
 static void
 doit(struct sockaddr_in *fromp)
 {
-	char cmdbuf[ARG_MAX+1];
+	char cmdbuf[sysconf(_SC_ARG_MAX)+1];
 	const char *theshell, *shellname;
 	char locuser[16], remuser[16];
 	struct passwd *pwd;
