1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../netkit-rsh/glibc.patch
5 # Copyright (C) 2009 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff -Naur ./rexecd/rexecd.c ../copy/rexecd/rexecd.c
18 --- ./rexecd/rexecd.c 2000-07-23 06:16:22.000000000 +0200
19 +++ ../copy/rexecd/rexecd.c 2008-06-13 21:33:11.000000000 +0200
22 doit(struct sockaddr_in *fromp)
24 - char cmdbuf[ARG_MAX+1];
27 char user[16], pass[16];
34 + cmdbuflen = sysconf (_SC_ARG_MAX);
35 + if (!(cmdbuflen > 0)) {
36 + syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed");
37 + fatal ("sysconf (_SC_ARG_MAX) failed\n");
40 + cmdbuf = malloc (++cmdbuflen);
41 + if (cmdbuf == NULL) {
42 + syslog (LOG_ERR, "Could not allocate space for cmdbuf");
43 + fatal ("Could not allocate space for cmdbuf\n");
46 signal(SIGINT, SIG_DFL);
47 signal(SIGQUIT, SIG_DFL);
48 signal(SIGTERM, SIG_DFL);
51 getstr(user, sizeof(user), "username too long\n");
52 getstr(pass, sizeof(pass), "password too long\n");
53 - getstr(cmdbuf, sizeof(cmdbuf), "command too long\n");
54 + getstr(cmdbuf, cmdbuflen, "command too long\n");
56 #define PAM_BAIL if (pam_error != PAM_SUCCESS) { \
57 pam_end(pamh, pam_error); exit(1); \
58 diff -Naur ./rshd/rshd.c ../copy/rshd/rshd.c
59 --- ./rshd/rshd.c 2008-06-13 21:40:15.000000000 +0200
60 +++ ../copy/rshd/rshd.c 2008-06-13 21:45:04.000000000 +0200
63 doit(struct sockaddr_in *fromp)
65 - char cmdbuf[ARG_MAX+1];
68 const char *theshell, *shellname;
69 char locuser[16], remuser[16];
75 + cmdbuflen = sysconf (_SC_ARG_MAX);
76 + if (!(cmdbuflen > 0)) {
77 + syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed");
81 + cmdbuf = malloc (++cmdbuflen);
82 + if (cmdbuf == NULL) {
83 + syslog (LOG_ERR, "Could not allocate space for cmdbuf");
87 signal(SIGINT, SIG_DFL);
88 signal(SIGQUIT, SIG_DFL);
89 signal(SIGTERM, SIG_DFL);