GET User Authorization File data (GETUAF) ----------------------------------------- The GET User Authorization File data (GETUAF) program allows a privileged VAX/VMS user to obtain from the User Authorization File (UAF) information about another user by specifying either the Username or the user's UIC. The information available is the user's Username, UIC, Account, Owner name, Device, and Directory. In addition to this, GETUAF can find an unused UIC member for a specified UIC group (very useful for adding new users to the system). The information requested is returned in DCL local symbols which may then be used, via substitution, in subsuquent DCL commands. Complete HELP instructions are supplied with the program which describe its use and syntax. The Floppy disk containing the files for the GETUAF program is formatted as a Files-11 Structure level 2 disk (single density). Note: This program may be distributed on Mag Tape for users who do not have a single density floppy disk drive. The files for GETUAF are located in the directory [GETUAF]. All the files in this directory are part of GETUAF. A short description of each file is given below: 0README.1ST Contains this notice. 0README.RNO The RUNOFF source used to generate the 0README.1ST notice. ABSTRACT.DOC This is the abstract submitted to DECUS along with the program. ABSTRACT.RNO The RUNOFF source used to generate the ABSTRACT.DOC file and the opening paragraph of 0README.1ST notice. GETUAF.EXE A linked executable version of GETUAF. In order to use this program a foreign command must be created and the user must have SYSPRV (or the System Manager may install the program with SYSPRV privilege at system startup time). To define the foreign command enter the following: $ GETUAF :== $disk:[directory]GETUAF.EXE GETUAF.HLP This is a HELP module describing how to use GETUAF. This module is ready for adding to the system HELP library (SYS$HELP:HELPLIB.HLB). To add this module to the HELP library you use the following command: $ LIBRARY/HELP SYS$HELPLIB.HLB GETUAF.HLP Note: In our system all non-DEC help modules have '_$' appended to the module name. If you do not use this convention you must edit the file GETUAF.HLP and remove the '_$' from the first line of the file before adding it to HELP. GETUAF.GEN Command proc to compile/assemble and link all the source files needed to generate a new version of GETUAF. GETUAF.LNK The actual command proc used to link GETUAF. Called by GETUAF.GEN or seperatly when developing enhancements to GETUAF. Source files. GETUAF.FOR GETUAF main program. General support routines borrowed from other projects. DEF.MAR Defines external symbols for use by FORTRAN modules. DEFSYM.MAR Routine to define a DCL symbol for use by command procs. GETSTRING.FOR Routine to find a string bounded by blanks, tabs, eol. LOGTRANS.FOR Routine to translate a logical name to its lowest level. NARGS.MAR Routine to tell a subroutine how may arguments it was passed. QSTRING.FOR Routine to search a string for /qualifiers. QUPCASE.FOR Routine to translate all lower case characters to upper case. TABS2BLNK.FOR Routine to translate all tabs to a single blank. There are also several Run-Time Library routines and System Service routines used. At our facility we use GETUAF extensively in several applications. They are the following: o In the add new user command procedure GETUAF is used to: * Determine if a new username has already been used. . . . $ PROMPT_USERNAME: $ INQUIRE USERNAME "Enter new Username" $ SET NOON $ GETUAF := $disk:[directory]GETUAF $ GETUAF/OWNER=OWNER 'USERNAME' $ STATUS = '$STATUS' $ SET ON $ IF .NOT. STATUS THEN GOTO USERNAME_AVAILABLE $ WRITE SYS$OUTPUT - "Username ''USERNAME' already",- "in use by ''OWNER'" $ GOTO PROMPT_USERNAME $ USERNAME_AVAILABLE: . . . * Determine if a username will create a directory name that is in conflict with an existing directory name (ie. LIBRARYKEY1 & LIBRARYKEY2 both would have the same directory name [LIBRARYKE]). . . . $ PROMPT_USERNAME: . . . $ USERNAME_AVAILABLE: $ USER_DIR := 'F$EXTRACT(0,9,USERNAME)' $ EXACT := "/EXACT" $ IF 'F$LENGTH(USERNAME)' .GE. 9 THEN - EXACT := "/NOEXACT" $ SET NOON $ GETUAF := $disk:[directory]GETUAF $ GETUAF/USERNAME=UAF_KEY - /OWNER=UAF_OWNER - 'USER_DIR' 'EXACT' $ STATUS = '$STATUS' $ SET ON $ IF .NOT. STATUS THEN GOTO DIRECTORY_AVAILABLE $ WRITE SYS$OUTPUT - "Directory [''USERDIR'] already in use",- "by ''UAF_KEY' (''UAFOWNER')" $ GOTO PROMPT_USERNAME $ DIRECTORY_AVAILABLE: . . . * Determine the next available UIC member of a specified group. . . . $ INQUIRE GROUP - "Specify UIC group to place new user in" $ INQUIRE MEMBER_MIN - "Specify minimum UIC member value" $ GETUAF := $disk:[directory]GETUAF $ GETUAF/NEXT_UIC_MEMBER=MEMBER - ['GROUP','MEMBER_MIN'] $ NEW_UIC := ['GROUP','MEMBER'] . . . o In our delete user command procedure we use GETUAF to verify that the specified user is correct and to obtain from the UAF the user's disk, main directory and UIC so his files may be deleted and his diskquota removed. . . . $ PROMPT_USERNAME: $ INQUIRE USERNAME "Enter Username" $ SET NOON $ GETUAF := $disk:[directory]GETUAF $ GETUAF/DEVICE=USER_DISK - /DIRECTORY=USER_DIR - /UIC=USER_UIC - 'USERNAME' $ STATUS = '$STATUS' $ SET ON $ IF STATUS THEN GOTO CORRECT_USERNAME $ WRITE SYS$OUTPUT - "Username ''USERNAME' not in UAF." $ GOTO PROMPT_USERNAME $ CORRECT_USERNAME: . . . o We have a command procedure which will allow a user to set his default disk and directory to the main directory of a user by specifying the user's key name and letting the UAF supply the correct disk and directory name. $ VERIFY = 'F$VERIFY("NO")' $ HOME := SYS$LOGIN $ IF P1 .EQS. "" THEN GOTO ENDIF_ANOTHER_USERS_HOME $ GETUAF := $SYS$COM:GETUAF $ GETUAF/DEVICE=DEVICE/DIRECTORY=DIRECTORY - 'P1'/NOEXACT $ HOME := 'DEVICE''DIRECTORY' $ ENDIF_ANOTHER_USERS_HOME: $ SET DEFAULT 'HOME' $ SHOW DEFAULT $ IF VERIFY THEN SET VERIFY !'F$VERIFY("NO")' If P1 is specified the command procedure will fetch the disk and directory from the UAF otherwise it will set the user to his own home directory (note: the /NOEXACT allows the user to enter only the number of characters necessary to select a unique username).