vipw - the program

Joseph E Poplawski jep at fantasci.UUCP
Sun Oct 16 12:37:55 AEST 1988


For those of you who were looking for a copy of 'vipw', here is one that I
wrote.  I want to thank Mike Khaw (mkhaw at teknowledge.arpa) for his suggestions
on what the program should do.

Here it is:

---------------------CUT HERE--------------------------------------------------
# vipw
#
# program to edit the password file. will not allow editing if /etc/ptmp exists.
#
# written by: Jo Poplawski  jep at fantasci.UUCP
#

if [ "n$EDITOR" = "n" ]
then
	EDITOR=/usr/bin/vi
fi

if [ -f "/etc/ptmp" ]
then
	echo ""
	echo "/etc/passwd being used, please try again in a few minutes..."
	echo ""
	exit 1
else
	cat /dev/null >/etc/ptmp
	cp /etc/passwd /etc/ptmp
	$EDITOR /etc/ptmp
	cp /etc/passwd /etc/passwd.old
	mv /etc/ptmp /etc/passwd
	chown root /etc/passwd
	chgrp sys  /etc/passwd
	chmod 444  /etc/passwd
	chmod 000  /etc/passwd.old
fi
---------------------CUT HERE--------------------------------------------------

Enjoy,

-Jo

-------------------------------------------------------------------------------
|  Joseph E Poplawski  (Jo)                   US Mail:  1621 Jackson Street   |
|                                                       Cinnaminson NJ 08077  |
|  UUCP:..!rutgers!rochester!moscom!telesci!fantasci!jep                      |
|       ..!princeton!telesci!fantasci!jep                                     |
|       ..!pyrnj!telesci!fantasci!jep           Phone:  +1 609 786-8099 home  |
-------------------------------------------------------------------------------



More information about the Comp.unix.questions mailing list