> To fix this, use something like this patch, which works on anything I've
> tried since 2.0.27:
>
Not quite right, because you toss the last byte if the string happens to be
shorter.
Either replace the
len = len >= ELF_PRARGSZ ? ELF_PRARGSZ : len;
(two lines above your patch) with
len = (len >= ELF_PRARGSZ-1) ? ELF_PRARGSZ-1 : len;
or simply delete the
psinfo.pr_psargs[len] = 0;
line, depending on whether the core file's string needs to be zero-terminated.
> --- binfmt_elf.c Thu May 1 03:27:19 1997
> +++ binfmt_elf.c Thu May 1 03:28:05 1997
> @@ -1146,7 +1146,7 @@
> for(i = 0; i < len; i++)
> if (psinfo.pr_psargs[i] == 0)
> psinfo.pr_psargs[i] = ' ';
> - psinfo.pr_psargs[len] = 0;
> + psinfo.pr_psargs[len-1] = 0;
>
> set_fs(KERNEL_DS);
> }
>
-- A day without fusion is like a day without sunshine.-- Matthias Urlichs \ noris network GmbH / Xlink-POP Nürnberg Schleiermacherstraße 12 \ Linux+Internet / EMail: urlichs@noris.de 90491 Nürnberg (Germany) \ Consulting+Programming+Networking+etc'ing PGP: 1024/4F578875 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE Click <A HREF="http://info.noris.de/~smurf/finger">here</A>. 42