/[pkgs]/rpms/rsh/devel/netkit-rsh-0.17-arg_max.patch
ViewVC logotype

Contents of /rpms/rsh/devel/netkit-rsh-0.17-arg_max.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download) (as text)
Fri May 9 10:59:21 2008 UTC (18 months, 2 weeks ago) by atkac
Branch: MAIN
CVS Tags: F-12-split, rsh-0_17-54_fc11, F-10-split, rsh-0_17-52_fc11, rsh-0_17-50_fc10, F-11-split, rsh-0_17-55_fc12, rsh-0_17-57_fc12, rsh-0_17-56_fc12, rsh-0_17-51_fc10, rsh-0_17-53_fc11, rsh-0_17-58_fc12, HEAD
Changes since 1.1: +13 -4 lines
File MIME type: text/x-patch
- fixed typos in arg_max and audit patches (#445606)
- use pam_rhosts, not pam_rhosts_auth (#445606)
1 atkac 1.1 diff -up netkit-rsh-0.17/rexecd/rexecd.c.arg_max netkit-rsh-0.17/rexecd/rexecd.c
2 atkac 1.2 --- netkit-rsh-0.17/rexecd/rexecd.c.arg_max 2008-05-09 10:36:44.000000000 +0200
3     +++ netkit-rsh-0.17/rexecd/rexecd.c 2008-05-09 10:36:44.000000000 +0200
4 atkac 1.1 @@ -235,7 +235,8 @@ static struct pam_conv PAM_conversation
5     static void
6     doit(struct sockaddr_in *fromp)
7     {
8     - char cmdbuf[ARG_MAX+1];
9     + char *cmdbuf;
10     + long cmdbuflen;
11     char user[17], pass[17];
12     struct passwd *pwd;
13     int s = -1;
14     @@ -254,6 +255,18 @@ doit(struct sockaddr_in *fromp)
15     #endif
16     #endif /* USE_PAM */
17    
18     + cmdbuflen = sysconf (_SC_ARG_MAX);
19     + if (!(cmdbuflen > 0)) {
20     + syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed");
21     + fatal ("sysconf (_SC_ARG_MAX) failed\n");
22     + }
23     +
24     + cmdbuf = malloc (++cmdbuflen);
25     + if (cmdbuf == NULL) {
26     + syslog (LOG_ERR, "Could not allocate space for cmdbuf");
27     + fatal ("Could not allocate space for cmdbuf\n");
28     + }
29     +
30     signal(SIGINT, SIG_DFL);
31     signal(SIGQUIT, SIG_DFL);
32     signal(SIGTERM, SIG_DFL);
33     @@ -303,7 +316,7 @@ doit(struct sockaddr_in *fromp)
34    
35     getstr(user, sizeof(user), "username too long\n");
36     getstr(pass, sizeof(pass), "password too long\n");
37     - getstr(cmdbuf, sizeof(cmdbuf), "command too long\n");
38     + getstr(cmdbuf, cmdbuflen, "command too long\n");
39     #ifdef USE_PAM
40     #define PAM_BAIL if (pam_error != PAM_SUCCESS) { \
41     pam_end(pamh, pam_error); exit(1); \
42     diff -up netkit-rsh-0.17/rshd/rshd.c.arg_max netkit-rsh-0.17/rshd/rshd.c
43 atkac 1.2 --- netkit-rsh-0.17/rshd/rshd.c.arg_max 2008-05-09 10:36:44.000000000 +0200
44     +++ netkit-rsh-0.17/rshd/rshd.c 2008-05-09 10:38:51.000000000 +0200
45 atkac 1.1 @@ -402,7 +402,8 @@ static int log_audit(const char *usernam
46     static void
47     doit(struct sockaddr_storage *fromp, socklen_t fromlen)
48     {
49     - char cmdbuf[ARG_MAX+1];
50     + char *cmdbuf;
51     + long cmdbuflen;
52     const char *theshell, *shellname;
53     char locuser[16], remuser[16];
54     struct passwd *pwd;
55     @@ -415,6 +416,18 @@ doit(struct sockaddr_storage *fromp, soc
56     int i;
57     #endif
58    
59     + cmdbuflen = sysconf (_SC_ARG_MAX);
60     + if (!(cmdbuflen > 0)) {
61     + syslog (LOG_ERR, "sysconf (_SC_ARG_MAX) failed");
62     + exit (1);
63     + }
64     +
65     + cmdbuf = malloc (++cmdbuflen);
66     + if (cmdbuf == NULL) {
67     + syslog (LOG_ERR, "Could not allocate space for cmdbuf");
68     + exit (1);
69     + }
70     +
71     signal(SIGINT, SIG_DFL);
72     signal(SIGQUIT, SIG_DFL);
73     signal(SIGTERM, SIG_DFL);
74 atkac 1.2 @@ -460,7 +473,7 @@ doit(struct sockaddr_storage *fromp, soc
75    
76     getstr(remuser, sizeof(remuser), "remuser");
77     getstr(locuser, sizeof(locuser), "locuser");
78     - getstr(cmdbuf, sizeof(cmdbuf), "command");
79     + getstr(cmdbuf, cmdbuflen, "command");
80     if (!strcmp(locuser, "root")) paranoid = 1;
81    
82     hostname = findhostname((struct sockaddr *)fromp, fromlen,

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2