PROGRAM NAME:  deass - deassign system resources

AUTHOR:  pavo

DATE WRITTEN:  november 21, 1976

SOURCE LANGUAGE:  c

LOCATION OF SOURCE:  /usr/pavo/deass.c

LOCATION OF BINARY:  /usr/bin/deass

SYNTAX:
deass  dev1  [dev2  [dev3 ... ]  ]

	"dev" is any system device that resides in directory /dev.
A user may type the valid device name (/dev/xxxxx) or simply the
mnemonic (xxxxx).  For example, deass will recognize "/dev/ct0" or
just "ct0" as COMTAL 0.

DESCRIPTION:
	deass logically deassigns devices that have been assigned 
(using ass).  Ass and deass can easily be thought of as a "begin/
end" pair that enclose (protect) a device.  Deassigning a 
device effectively returns it to the system (enabling further
assignments to other users).

MESSAGES & DIAGNOSTICS:
	Deass is a fault-tolerant procedure.  If you try to deassign
a non-existent device, it will detect this and immediately fetch the
next argument (if any) to process.  Similiar for devices which are
unassignable devices.  In these cases, deass will
say nothing about the mistake.
	Invoking deass with no arguments causes a "usage" message to
be printed.  This will inform the errant user as to the correct com-
mand syntx.
	A message such as:
	/dev/xxxx:	assigned to yyyyy
indicates that user yyyyy has the device and is still logged-on,
in this case, the deassignment must come from user yyyyy before any-
one else can use the device.
	In the event that a user tries to deassign a device that has
been assigned to him, he will receive a message such as:
	/dev/xxxx:	now unassigned
indicating the device's new status.

SEE ALSO:
	/usr/pavo/ass.c		source program for companion procedure
	"ls -l /dev"		device directory (all system resources)
	chown(ii)		system procedure to change file owner
	chmod(ii)		system procedure to change file mode

FILES USED:
	/etc/passwd		password file
	/etc/utmp		user information
	/usr/sys/sbuf.h		inode structure for "stat" calls

KNOWN BUGS:
	If a user logs off of UNIX after having been assigned
a device, the device may remain assigned to that user for some time
to come.  To avoid this, all devices should be deassigned as soon as
possible.  There are only 2 ways devices will be deassigned:  (1) if
the current owner explicitly requests deassignment, and (2) if ass is
called with no parameters, it will return all devices that are
assigned to users that are not logged-on.  Remember that ass and deass
work best together.

IMPLEMENTATION DESCRIPTION:
	deass is a miniscule main procedure that calls deassign.  Deassign
coordinates the calling of other procedures to deassign a device:
	logdin	- a boolean procedure to determine if a user is logged-on
		  to UNIX
	getun   - get a user name given his user id
	compstr - compare 2 strings and return a flag indicating whether
		  they are equivalent
	sizstr  - determine the length of a null-terminated string
	chdev	- change the mode and owner of a device to unprotected and
		  system, respectively.
