[comp.unix.wizards] modifying parent's environment, etc.

logan@vsedev.VSE.COM (James Logan III) (04/25/89)

[Note that followups have been redirected to to comp.unix.wizards]

In article <1030@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
# In article <2158@pur-phy> sho@newton.physics.purdue.edu.UUCP (Sho Kuwamoto) writes:
# >This thread got me to thinking.  I wrote a quickie program which,
# >for reasons I don't need to go into now, modified argv[i].  The
# >strangest thing happened: if you run it in the background and look
# >at it using ps, the line where it tells you what you typed in as
# >your command line changes.
# 
# Why do you think that is strange?  ps gets the information about the
# arguments of process #1234 by peeking into the address space of process
# #1234 to find out what argv[] looks like.

Under System V the arguments are stored in the character array
u_psargs[PSARGSZ] in the u structure.  The u structure is usually
read directly from the swap device based on addresses found in 
the process table.

# Note that you don't see I/O redirection, only the strings in argv[].

The I/O redirection symbols are taken care of by the shell and
stripped off before the command sees it.   

			-Jim
-- 
Jim Logan                           logan@vsedev.vse.com
VSE Software Development Lab        uucp:  ..!uunet!vsedev!logan
(703) 329-4654                      inet:  logan%vsedev.vse.com@uunet.uu.net

jiii@visdc.UUCP (John E Van Deusen III) (04/28/89)

In article <1495@vsedev.VSE.COM> (James Logan III) writes:
>
> Under System V the arguments are stored in the character array
> u_psargs[PSARGSZ] in the u structure.  The u structure is usually
> read directly from the swap device based on addresses found in 
> the process table.

The "old" documentation for crypt(1) stated that since the arguments
are potentially visible to users executing ps(1), "crypt takes care
to destroy any record of the key immediately upon entry".  I see that
that line has now been deleted from from the manual entry for UNIX V.
--
John E Van Deusen III, PO Box 9283, Boise, ID  83707, (208) 343-1865

uunet!visdc!jiii