From 9ba343c2a86a16b52c464d3821d410fc9513c413 Mon Sep 17 00:00:00 2001 From: Aldas Nabazas Date: Sat, 8 Aug 2009 16:53:01 +0100 Subject: [PATCH] netkit-rsh: compile with glibc >= 2.9 --- network/netkit-rsh/glibc.patch | 90 ++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 network/netkit-rsh/glibc.patch diff --git a/network/netkit-rsh/glibc.patch b/network/netkit-rsh/glibc.patch new file mode 100644 index 000000000..719e856ce --- /dev/null +++ b/network/netkit-rsh/glibc.patch @@ -0,0 +1,90 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../netkit-rsh/glibc.patch +# Copyright (C) 2009 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +diff -Naur ./rexecd/rexecd.c ../copy/rexecd/rexecd.c +--- ./rexecd/rexecd.c 2000-07-23 06:16:22.000000000 +0200 ++++ ../copy/rexecd/rexecd.c 2008-06-13 21:33:11.000000000 +0200 +@@ -223,7 +223,8 @@ + static void + doit(struct sockaddr_in *fromp) + { +- char cmdbuf[ARG_MAX+1]; ++ char *cmdbuf; ++ long cmdbuflen; + char user[16], pass[16]; + struct passwd *pwd; + int s = -1; +@@ -242,6 +243,18 @@ + #endif + #endif /* USE_PAM */ + ++ cmdbuflen = sysconf (_SC_ARG_MAX); ++ if (!(cmdbuflen > 0)) { ++ syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed"); ++ fatal ("sysconf (_SC_ARG_MAX) failed\n"); ++ } ++ ++ cmdbuf = malloc (++cmdbuflen); ++ if (cmdbuf == NULL) { ++ syslog (LOG_ERR, "Could not allocate space for cmdbuf"); ++ fatal ("Could not allocate space for cmdbuf\n"); ++ } ++ + signal(SIGINT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); + signal(SIGTERM, SIG_DFL); +@@ -291,7 +304,7 @@ + + getstr(user, sizeof(user), "username too long\n"); + getstr(pass, sizeof(pass), "password too long\n"); +- getstr(cmdbuf, sizeof(cmdbuf), "command too long\n"); ++ getstr(cmdbuf, cmdbuflen, "command too long\n"); + #ifdef USE_PAM + #define PAM_BAIL if (pam_error != PAM_SUCCESS) { \ + pam_end(pamh, pam_error); exit(1); \ +diff -Naur ./rshd/rshd.c ../copy/rshd/rshd.c +--- ./rshd/rshd.c 2008-06-13 21:40:15.000000000 +0200 ++++ ../copy/rshd/rshd.c 2008-06-13 21:45:04.000000000 +0200 +@@ -337,7 +337,8 @@ + static void + doit(struct sockaddr_in *fromp) + { +- char cmdbuf[ARG_MAX+1]; ++ char *cmdbuf; ++ long cmdbuflen; + const char *theshell, *shellname; + char locuser[16], remuser[16]; + struct passwd *pwd; +@@ -346,6 +347,18 @@ + u_short port; + int pv[2], pid, ifd; + ++ cmdbuflen = sysconf (_SC_ARG_MAX); ++ if (!(cmdbuflen > 0)) { ++ syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed"); ++ exit (1); ++ } ++ ++ cmdbuf = malloc (++cmdbuflen); ++ if (cmdbuf == NULL) { ++ syslog (LOG_ERR, "Could not allocate space for cmdbuf"); ++ exit (1); ++ } ++ + signal(SIGINT, SIG_DFL); + signal(SIGQUIT, SIG_DFL); + signal(SIGTERM, SIG_DFL); +