[comp.sys.att] Full command line arguments/process status

john@polyof.UUCP ( John Buck ) (03/21/89)

About a week ago, I posted an article about a program I wrote that
gives extended process status information.  I said if you wanted
a copy of this (binary-only) program to send me mail, and I would
send you a copy.

Well, since that time I have received over 100 requests.  (I am sure
other requests will filter in as leaf USENET nodes get the message.)

Being that the response was so large, I have decided to post the
uuencoded/compressed(b12) program.  I realize that this group may not
be the best place to post this, but I'm sure many of the people
that want this program either a) don't get unix-pc groups
			      b) don't get full comp.sources

Since I only posted the request to this group (and X-post to unix-pc),
I will post the distribution here.  It is really quite short
(only about 16K bytes, 400 or so lines in shar-file.)

John Buck
john@polyof.poly.edu
john@polygraf.bitnet
trixie!polyof!john
---------- CUT HERE, then run through a Bourne Shell --------------------
#! /bin/sh
echo copyright
sed -e 's/^X//' <<"EOFcopyright" >copyright
X
XThis program is Copyright (c) 1989 by John Buck.  It may not be sold
Xor redistributed as part of any commerical product.  It may not be
Xbundled with any commercial product.  It may not be copied without
Xthe inclusion of this Copyright notice.
X
XThis program (and the algorithms contained within) may NOT be reverse
Xassembled for purposes of recompilation or further re-distribution.
X
XDirect inquires (bug reports?) to:
Xjohn@polyof.poly.edu [128.238.10.100], or john@polygraf.bitnet or
Xtrixie!polyof!john.
EOFcopyright
echo readme
sed -e 's/^X//' <<"EOFreadme" >readme
XMon Mar 20 11:38:18 EST 1989
X
X*----------------------------------------------------------------*
X* Disclaimer: I am not responsible for any side-effects this     *
X*    program may have.  Carefully read the information below     *
X*    and make sure you understand it.  Stat will overwrite a     *
X*    file in /etc (/etc/stat_nl).  Be sure you do not have a     *
X*    file by this name.  Stat reads system memory (/dev/mem,     *
X*    /dev/kmem, /dev/swap).  It is possible for stat to get      *
X*    bad pointers internally and reference possibly illegal      *
X*    addresses.  This could, theoretically, cause system crashes *
X*    Bad pointers are possible due to the fleeting nature        *
X*    of some of the data in the OS.  You run this program at     *
X*    your own risk.                                              *
X*----------------------------------------------------------------*
X
X
XHere is the 'stat' distribution.
X
XAfter 'un-shar'ing, simply run the 'makestat' shell script.
XYou can do this by typeing: "sh makestat"
X
XThis will uncompress the 'stat' binary in the current directory.
XYou may then install 'stat' in whatever directory you want (/bin?).
X
X'stat' does NOT have to be made 'sbit'.  It does, however, require
Xread permission on the following files:
X	/dev/swap
X	/dev/kmem
X	/dev/mem
X	/unix
X	/etc/mnttab
X
XIt also requires both read/write access to (an empty file): /etc/stat_nl
XYou can do:
X	chmod 666 /etc/stat_nl >/etc/stat_nl
X
X'stat' uses this file to store the symbol table address it needs
Xfrom /unix.  It stores only those it needs for faster start-up.
XIf 'stat' sees that /unix has changed, or stat_nl has disappeared,
Xit will try to create a new /etc/stat_nl.  Stat will take
Xnoticably longer to run if it can not access the /etc/stat_nl file.
XThe first time 'stat' is run, it will create this file.  Expect
Xslow start-up for the first run.
X
XIf you are lazy, you can just make 'stat' s-bit, owner root:
X	chown 0 stat
X	chmod 4711 stat
X
XIf you are paranoid, just make sure all the files above are accessible
Xby stat.
X
XIf you have any questions, or problems, let me know:
XJohn Buck
X
Xjohn@polyof.poly.edu
Xjohn@polygraf.bitnet
Xtrixie!polyof!john
EOFreadme
echo makestat
sed -e 's/^X//' <<"EOFmakestat" >makestat
Xuud=""
Xunc=""
X# Try to find where things are
Xfor dir in /bin /usr/bin /etc /usr/lib /usr/lib/uucp /usr/lib/news /usr/local /local /usr/local/bin /usr/ucb
Xdo
X	if test -z "$uud" -a -x $dir/uudecode
X	then
X		uud=$dir/uudecode
X	fi
X	if test -z "$unc" -a -x $dir/uncompress
X	then
X		unc=$dir/uncompress
X	fi
X	if test -z "$unc" -a -x $dir/compress
X	then
X		unc=$dir/compress -d
X	fi
X	if test -n "$unc" -a -n "$uud"
X	then
X		break
X	fi
Xdone
Xif test -z "$uud"
Xthen
X	echo "I can't seem to find where uudecode is."
X	echo ""
X	while test -z "$uud"
X	do
X		echo "Enter the pathname of the 'uudecode' program:"
X		read a
X		if test -x "$a"
X		then	uud=$a
X		else	echo ""
X			echo "Sorry, but $a is not executable by you.  Try again."
X		fi
X	done
Xfi
Xif test -z "$unc"
Xthen
X	echo "I can't seem to find where uncompress is."
X	echo ""
X	while test -z "$unc"
X	do
X		echo "Enter the command you use to 'uncompress' things: "
X		read a b
X		if test -x "$a"
X		then	unc="$a $b"
X		else	echo ""
X			echo "Sorry, but $a is not executable by you.  Try again."
X		fi
X	done
Xfi
X$uud <stat.uue
X$unc <stat.comp.b12 >stat
X/bin/chmod 711 stat
Xset `wc -c stat`
Xsz="$1"
Xif test "$1" -eq 10393
Xthen
X	echo stat has been successfully uncompressed.
X	/bin/rm -f stat.uue stat.comp.b12
Xelse
X	echo There was a problem uncompressing 'stat' -- I give up.
Xfi
EOFmakestat
/bin/chmod 755 makestat
echo stat.uue
sed -e 's/^X//' <<"EOFstat.uue" >stat.uue
Xbegin 644 stat.comp.b12
XM'YV, :0 ($"BA(,V !(J5,A!P(, "Q9NX)#0 *B$*=@!0*"08\($"5W0*8.'
XMSD*/&R52'+BPI4L (%R0"4,GS$*0'Q=:3 CBI4\ 0%R(F3.G98*=1R\"R/BS
XM*2 7;-*(,0J#$8 $59MJW<JUJ]>O8,.*'4NVK-FS:-.J7<NVK=NW<./*G4NW
XMKMV[>,^^X'&UJI-< &(DQ/((Q),HCUQ@>H%DH!),9@#\X\=XXPAD &! (/ W
XM)8\7 #H+Q@.#;P G0)Q8^0<+B3L.#/ZQ$^+JGS3:_YP)<?./F1# ('V)!N"J
XM!Y!_WHS_4Z8$R!D2#(  $'#&0W0 9<Y@&"Y*N;?F9Q1<?W&&@')FE929!#-=
XM&P@W !B0@ *&0TS;T ") % .$+1 $FB 1"!(!/.?'#! $D@+QTG#@ 29M6' 
XM@P#D\ 8V2M0F37GI@6$!"7Q<M0(?[\7G B1(2"$: 11@\42&MK'!@0L:[G55
XM )"(-@ G+L(1@ N #(<' $( $ ![ H!1(@,@0!$$.D:V@,0_VN#F#)$0'$G"
XM?<[DMU]__XG FS92U*:-!!$,6."!"2YXG#/O4<D !!%.2*>%S,#H#$(!V,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P>,3P:"3P<N
XMP/I)@%UM$ 9K[P9O@%UB@/>W#@=I /8@< =I0 =H\ 9UL/1T@ 9X?_ECP 9U
XM, =<'_1Z1 =HH/7:_P9PD =RD 9G@ ;8Y09OX/-O+_8*0 5HH/5[Q/AG( =1
XM_WSHS_)T@ 9XK_)G(/1I0 =HT 9S  *WKO1A</E@#P)WD 9T@ :7GP*P' 9K
XM[P1/0 4@( :'O_!7W_<* /Y]WP9BP.LL;P9"OT>%#P=OT/=S$/1Z9/BWW@9P
XMD :\[_- +_3S7/AT@ 9^;_C"I/6 +Q5UX/.X+O8*0 1I8/B##P*7'P=UD :&
XM/P?/)P9UL/Z&#P="3P=S\ ,I  )T\ 8ZH !J\ 9HX 9   >[G@=O8 8N  >[
XMG@<N /8HO075C@,N( ,S@ ,N$.TN$.TPT 5&)O0@H 9O@ 9N  1PL.MY< 9R
XH$ 9F(!1I0 =NH.]!+P<* /@'GP9E$ )PL.MY\ 9F$ )J\ 9HX 9B#^MY
X 
Xend
EOFstat.uue
echo stat.1
sed -e 's/^X//' <<"EOFstat.1" >stat.1
X.de lp
X.in .5i
X.ta \\$2
X.in \\$1
X.ti -\\$2
X..
X.TH STAT 1M 11/01/81
X.SH NAME
Xstat \- lots of system stats
X.SH SYNOPSIS
Xstat
X.B "[ -b ] "
X.B "[ -c kmem_file [ mem_file ] ] "
X.B "[ -d ]"
X.B "[ -e ] "
X.B "[ -f ] "
X.B "[ -h ] "
X.B "[ -i ] "
X.B "[ -I ] "
X.B "[ -l ] "
X.B "[ -n ] "
X.br
X\ \ \ 
X.B "[ -o [ dev1 dev2 ... ] ] "
X.B "[ -p ] "
X.B "[ -q ] "
X.B "[ -r ] "
X.B "[ -s ] "
X.B "[ -S ] "
X.B "[ -tx1,x2,.. ] "
X.B "[ -T ] "
X.br
X\ \ \ 
X.B "[ -u namelist ] "
X.B "[ -w ] "
X.SH DESCRIPTION
X.B Stat
Xis the all purpose system table listing program.
XIt will display a multitude of information, as indicated by the following
Xoptions:
X.LP
X.LP
X.lp +8 4
X-b Print long command names, I.E. Upto 5120 characters
X.LP
X.lp +8 4
X-c Take next two arguments as the KMEM and MEM replacement files
X.LP
X.lp +8 4
X-d Print disk structure
X.LP
X.lp +8 4
X-e Print the environment for the process.  Implies -b as well.
X.LP
X.lp +8 4
X-f Full: Print process status, Pipes, Open files on all devs
X.LP
X.lp +8 4
X-h Print Informatory header (Time date etc...)
X.LP
X.lp +8 4
X-i Print only "In-core" processes, (Flag & 1) == 1
X.LP
X.lp +8 4
X-I When printing any open file information, do not print
Xthe pathnames, just the inode number, and the status
Xstructure.
X.LP
X.lp +8 4
X-l Print long process listing
X.LP
X.lp +8 4
X-n When printing open files on /, do not print tty's
X.LP
X.lp +8 4
X-o Print open files on all devices.  If arguments follow (without
Xdash characters first), files open on these devices will NOT
Xbe printed. So, to get all open files, except on rm0,
Xstat -o rm0
X.LP
X.lp +8 4
X-p print pipes
X.LP
X.lp +8 4
X-q set high priority (nice -20) while running
X.LP
X.lp +8 4
X-r Print Root procs, I.E. UID=0
X.LP
X.lp +8 4
X-R# Repeat status every # seconds. Absence of # causes
Xcontinuous iterations, non-stop.
X.LP
X.lp +8 4
X-s Print status only (default)
X.LP
X.lp +8 4
X-S Print signal dispostion for procs.
X.br
XT = being privately trapped
X.br
XI = being ignored
X.br
X- = Normal handling.  
X.LP
X.lp +8 4
X-tx1,x2,... Print info only for procs on ttyx1,ttyx2,....
X.LP
X.lp +8 4
X-T When printing cpu time, separate system and user time into two columns
X.LP
X.lp +8 4
X-u Take next argument as the namelist from which to get system table addresses
X.LP
X.lp +8 4
X-w Print Working Directories
X.in -8
X.LP
XFurthermore, an optional first argument
Xof a \fBlogin name\fP or \fBUID\fP specifies that
Xinformation for that user only will be printed.
X.LP
XExample:
X.LP
X.in +5
X\fBstat adm\fP\ \ \ or\ \ \ \fBstat 2\fP
X.br
X.LP
Xwill print information for user 'adm' (UID=2)  only.
X.SH "SEE ALSO"
Xps(1), pwd(1), who(1)
EOFstat.1

alex@otter.UMBC.EDU (alex) (03/21/89)

In article <455@polyof.UUCP>, john@polyof.UUCP ( John Buck ) writes:

> Being that the response was so large, I have decided to post the
> uuencoded/compressed(b12) program.

	With all respect for John for posting his work, I can't help but be
surprised that there would be such a large demand for a unix-pc *binary* 
without source. All the other binaries to come through these groups have been
accompanied by sources.

	I think that I've contributed my share of software to the
unix-pc users of the world, so I guess I have a right to say that I'm
disturbed and insulted by the binary-only distribution of this
program. I for one would never consider using a binary without source,
unless the vendor agreed to supply support. The fact that this is an
suid program with known bugs (The release notes state that some of the
options do not work) only confirms my feelings.

	I also think that this sets a bad precident. One of the
biggest advantages of the unix-pc is the volume of free software
available for it, a factor that helps to make up for the lack of
vendor support for the machine.  I wonder if the author used any of
that software (emacs? gcc? shcc? sh-ld?  ptys? capcntrl?)  I would be
very upset to see a trend of selling software amongst ourselves, there
aren't enought unix-pc users to support the effort and the division
could be devistating.

	I realize that this is a religious issue, but I am a religious 
person, and something had to be said.

					:alex
Alex Crain
Systems Programmer			alex@umbc3.umbc.edu
Univ Md Baltimore County		nerwin!alex@umbc3.umbc.edu

wilkes@mips.COM (John Wilkes) (03/22/89)

In article <1818@umbc3.UMBC.EDU> alex@otter.UMBC.EDU (alex) writes:
|In article <455@polyof.UUCP>, john@polyof.UUCP ( John Buck ) writes:
|
|> Being that the response was so large, I have decided to post the
|> uuencoded/compressed(b12) program.
|
|	With all respect for John for posting his work, I can't help but be
| [...]
|disturbed and insulted by the binary-only distribution of this
|program. I for one would never consider using a binary without source,

I really dislike seeing content-free postings that merely say, "Yeah, what
he said," but I am compelled to post just such a thing right now.

I, too, was distrurbed by seeing a binary-only posting to this group.
The description of the program is intriguing, and it sounds like a useful
tool.  However, I have no intention of running a setuid program without
first at least glancing at the source to see what it does.  In fact, I have
no intention of running *any* binary that comes off the net.  If I can't
have the source code, I'm not interested.  I wonder how many unix-pc owners
share this opinion?

|	I also think that this sets a bad precident. One of the
|biggest advantages of the unix-pc is the volume of free software

Indeed.

|(emacs? gcc? shcc? sh-ld?  ptys? capcntrl?)

mtools? pcomm? xmodem? kermit? patch? news? rn? less? sc? nbs_time? windy?
The list is infinite.

Another advantage is the community of unix-pc owners.  I have received an
incredible amount of help and support from strangers, none of whom have
ever asked for compensation.  I've even offered meager assistance to others
when I've been able, and I've never sent a bill.

|	I realize that this is a religious issue, but I am a religious 
|person, and something had to be said.

Me, too.  I hope that John reconsiders his position and posts source for
his program.  I'm certain that I could learn something from it.

On the other hand, perhaps he started with proprietary sources, like the
AT&T source for ps, and is legally unable to post the sources.  If this is
the case, I hope he will tell us (and post the diffs, which I believe is
leagal.)

-wilkes
-- 
-- work: {decwrl ames pyramid prls}!mips!wilkes  -OR-  wilkes@mips.com

lenny@icus.islp.ny.us (Lenny Tropiano) (03/23/89)

In article <15656@electron.mips.COM> wilkes@mips.COM (John Wilkes) writes:
|>In article <1818@umbc3.UMBC.EDU> alex@otter.UMBC.EDU (alex) writes:
|>|In article <455@polyof.UUCP>, john@polyof.UUCP ( John Buck ) writes:
|>|
|>|> Being that the response was so large, I have decided to post the
|>|> uuencoded/compressed(b12) program.
|>|
|>|	With all respect for John for posting his work, I can't help but be
|>| [...]
|>|disturbed and insulted by the binary-only distribution of this
|>|program. I for one would never consider using a binary without source,
|>
|>I really dislike seeing content-free postings that merely say, "Yeah, what
|>he said," but I am compelled to post just such a thing right now.
|>

Just like John Wilkes and Alex Crain, I feel *very* compelled to comment
on this issue.  It's funny, I probably was one of the key people who
started this whole thing.   About 1 year ago, a discussion started on the
net about getting ps(1) for the UNIX PC to display all the command arguments. 
It was noted back then, by myself and other people that only the first
14 characters of the command were saved in the user structure.  This is
unlike other UNIX machines that will display the entire list of command
line arguments when ps(1) is invoked with the "-f" command.  John Buck
replied in saying that the arguments are available if you can read them
off the user's stack space (since exec uses this area).  He mentioned that
he would post his program if he was able to get time port it to the UNIX PC.
About 2 weeks ago, I was going through some old mail, and I found his letter
to me.  I replied again to him, in hopes that he had finished he program, 
since I was about to undertake the project myself.   Obviously he finished
the extend-ps part of his "stat" program, hence his postings about it.

|>I, too, was distrurbed by seeing a binary-only posting to this group.
|>The description of the program is intriguing, and it sounds like a useful
|>tool.  However, I have no intention of running a setuid program without
|>first at least glancing at the source to see what it does.  In fact, I have
|>no intention of running *any* binary that comes off the net.  If I can't
|>have the source code, I'm not interested.  I wonder how many unix-pc owners
|>share this opinion?
|>
...
Binary postings to the net have really no place.  In this age of "virus" and
"worm" programs, I would be very leary in running *anyone's* binary posting,
if it wasn't accompanied with the source code.   Yes, I agree the program does
have good uses, but certainly doesn't outweigh the hazards of running any
binary posting.  Not to mention that you would have to run the program setuid
to read the files /dev/kmem, /dev/mem, and /dev/swap.   John Buck covers himself
in saying:

[...from the README file that came with the stat binary distribution...]

|*----------------------------------------------------------------*
|* Disclaimer: I am not responsible for any side-effects this     *
|*    program may have.  Carefully read the information below     *
|*    and make sure you understand it.  Stat will overwrite a     *
|*    file in /etc (/etc/stat_nl).  Be sure you do not have a     *
|*    file by this name.  Stat reads system memory (/dev/mem,     *
|*    /dev/kmem, /dev/swap).  It is possible for stat to get      *
|*    bad pointers internally and reference possibly illegal      *
|*    addresses.  This could, theoretically, cause system crashes *
|*    Bad pointers are possible due to the fleeting nature        *
|*    of some of the data in the OS.  You run this program at     *
|*    your own risk.                                              *
|*----------------------------------------------------------------*
...
|'stat' does NOT have to be made 'sbit'.  It does, however, require
|read permission on the following files:
|	/dev/swap
|	/dev/kmem
|	/dev/mem
|	/unix
|	/etc/mnttab
|
|It also requires both read/write access to (an empty file): /etc/stat_nl
|You can do:
|	chmod 666 /etc/stat_nl >/etc/stat_nl
...
|
|If you are paranoid, just make sure all the files above are accessible
|by stat.

Changing the permission on the /dev/*mem files would only compromise the
security of your UNIX pc even more than it already is.  Readable memory
just prompts someone to scan the /dev/*mem files with "strings" and find
things like the "root" password in it.  When you login as root, the password
is in the tty buffers unencrypted, right?  And the buffers are in memory 
right?  Believe me I saw my root password there!

Now someone is going to come back and say, "But the UNIX pc has many more
ways to become root, break-in, compromise security..."  My answer is *why*
make it any easier?  I'm sure we've all tried to tighten security in some
way or another (and probably fighting a loosing battle) ...

|>|	I also think that this sets a bad precident. One of the
|>|biggest advantages of the unix-pc is the volume of free software
|>
|>Indeed.
|>
|>|(emacs? gcc? shcc? sh-ld?  ptys? capcntrl?)
|>
|>mtools? pcomm? xmodem? kermit? patch? news? rn? less? sc? nbs_time? windy?
|>The list is infinite.
|>
|>Another advantage is the community of unix-pc owners.  I have received an
|>incredible amount of help and support from strangers, none of whom have
|>ever asked for compensation.  I've even offered meager assistance to others
|>when I've been able, and I've never sent a bill.
|>
...
We've all contributed in some way to the net, if it's not like myself who
has been an active participant with the unix-pc world with source postings,
discussions, helpful hints, etc..., it's been the learning experience with
great deals of information for a machine that is no longer supported with 
much vigor by it's vendor.   The wealth of information from the net has
been worth more than the information that we get from AT&T, I'm sure most of us,
yes, including myself, would feel it's been a learning experience for them.

|>|	I realize that this is a religious issue, but I am a religious 
|>|person, and something had to be said.
|>
|>Me, too.  I hope that John reconsiders his position and posts source for
|>his program.  I'm certain that I could learn something from it.
|>
...
I'm certain I could learn from it too.  I wouldn't have any bad feelings 
about running it on my machine if I could glance on how it worked.  
And if it crashed at least have the ability to see if I could fix it!   
Surely nothing is that difficult, and since we all know it can be done, 
why can't someone else write it now.  Even if it's unfinished, I would 
hope John Buck reconsiders ... We all aren't perfect, and I'm sure there
are potential problems with John Buck's "stat" program, so why not post
the source and have the net show you a thing or two...  In my opinion the
net is the world's largest source debugger :-)  Until then, if that ever
occurs, the best spot for his binary is saved to /dev/null.

-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 582-5525
lenny@icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny  attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752