!
! Editted for V2.0 on 29-Jan-84	Frank J. Nagy
! Editted for V3.0 and VMS V4.x on 30-Oct-85 Frank J. Nagy
! Editted for V3.1 on 31-Oct-85 Frank J. Nagy
!
1 SETUSER
 Changes UIC and username to that of a specified user:

	SETUSER  -I  username  [account]

 where the UIC is gotten by converting the ASCII username as a
 rights identifier (UIC format).  To provide an explicit UIC use:

	SETUSER  username  uic  [account]

 Changes the UIC and username associated with the process to those
 specified (optionally, the account name may also be changed).
 The explicit UIC can be in "[ggg,mmm]" format where "ggg" and "mmm"
 are octal numbers or in "[name]" format where "name" is an ASCII
 rights identifier (UIC format).

 To restore the original (login) user account, use the command:

	RESTORE_USER

 CMKRNL privilege is required to use either of these commands.

 SETUSER can also access the User Authorization File, see "Via_UAF".
2 Via_UAF
 The SETUSER command can access the UAF file given the username.  The
 UIC and username are extracted from the UAF record and used to change
 the username and UIC for the process:

	SETUSER  -U  username
	-or-
	SETUSER  -UA  username

 Where the "A" option causes the account name from the UAF record to
 replace the current account name for the process.  If the "D" option
 is added to the list, as in:

	SETUSER  -UD  username

 then an implicit "SET DEFAULT" command is done, using the login device
 and directory as stored in the UAF record for the specified user.

 The logical name SYSUAF can be defined to direct SETUSER to search a
 particular User Authorization File, otherwise the system UAF, SYSUAF.DAT,
 in SYS$SYSTEM: is searched (the defaults "SYS$SYSTEM:.DAT" are applied
 to "SYSUAF" in the file open).   Note that SYSPRV is required to read
 the system authorization file.
2 Definitions
 The SETUSER command is defined as a foreign command by:

	SETUSER :== $FERMI$EXE:SETUSER

 Similarly, the RESTORE_USER command is defined (in the login file)
 as:

	user = F$GETJPI("","USERNAME")
	account = F$GETJPI("","ACCOUNT")
	s_mem = F$ELEMENT( 0, "]", F$ELEMENT( 1, ",", F$USER()))
	uic = F$FAO( "!%U", F$IDENTIFIER( s_mem, "NAME_TO_NUMBER"))
	RESTORE_USER :== $FERMI$EXE:SETUSER  'user'  'uic'  'account'

