Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 156651 Details for
Bug 225341
netkit-rsh failure w/ glibc-2.8 (ARG_MAX undeclared)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch fixing this bug
netkit-rsh-0.17-arg_max.patch (text/plain), 2.05 KB, created by
Tom-Steve Watzke
on 2008-06-13 17:59:31 UTC
(
hide
)
Description:
patch fixing this bug
Filename:
MIME Type:
Creator:
Tom-Steve Watzke
Created:
2008-06-13 17:59:31 UTC
Size:
2.05 KB
patch
obsolete
>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);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 225341
:
156649
| 156651 |
156917