
How to find out all the input args of a long command line
In article <yzz4s476yyh....@okanogan.mccaw-stg.com>,
Shih-Ming Wang <sw...@mccaw-stg.com> wrote:
This probably ought to be in the FAQ.
Short answer: use /usr/ucb/ps -w or -ww, see the ps(1b) man page for
details. This assumes that you have the BSD compatibility packages
(SUNWscpr & SUNWscpu) installed.
Longer answer: you can't, in principle. /bin/ps is using a copy of
the arguments made by the kernel at exec time: the same data that is
available in the pr_psargs field in /proc/[PID]/psinfo (see proc(4)).
That's just the first 80 bytes, and that's it. /usr/ucb/ps with the
above-mentioned options is peeking at the victim's addess space (for
which it needs its setuid=root privilege, unless you are looking at
your own processes) and examining the storage area at the top of the
stack segment where the arguments were originally stored for passing
to main(argc,argv,envp). However, there's nothing to stop the program
overwriting this area during execution.
Chris Thompson
Email: cet1 [at] cam.ac.uk