.title uai_lgicmd ;uai_lgicmd.mar .ident "V1.0" ; ; Digital Equipment Computer Users Society (DECUS) ; This program may be freely distributed or modified by any party, including ; but not limited to DECUS and anyone within DECUS. ; USE AT YOUR OWN RISK ; DECUS, DECUServe and the author make NO warranties whatsoever, including ; without limitation, all implied warranties of merchantability and fitness. ; ; This programs defines a local DCL symbol, UAI_LGICMD, which contains ; the contents of the LGICMD (login command file) field from the SYSUAF.DAT ; user authorization record for the process that runs this program. ; ; macro uai_lgicmd ; link uai_lgicmd ; run uai_lgicmd !Symbol UAI_LGICMD is now defined. ; ; Author: Jack Harvey August 14, 1991 ; Simple macro to pass arguments needed here to LIB$SET_SYMBOL .macro set_symbol sym,equ pushal equ ;equivilent string goes here pushal sym ;symbol to create calls #2,G^lib$set_symbol .endm set_symbol .psect uai_lgicmd_data noexe,wrt,pic,noshr,long errdspl:.quad 0 ;used for error messages jpi: .word 12 ;item list for getting our username .word jpi$_username .address username .address namlen namlen: .word 0 ;descriptor for username .word 0 .address username username:.blkb 12 $uaidef ;get the item code definitions uai: .word 64 ;descriptor for getuai lgicmd .word uai$_lgicmd ;default login command file .address lgicmd .address lgilen lgilen: .word 0 ;descriptor for login command file .word 0 lgiadr: .address lgicmd lgicmd: .blkb 64 lgisym: .ascid /UAI_LGICMD/ .psect uai_lgicmd_code exe,nowrt,pic,shr,long .entry uai_lgicmd ^M<> clrq -(SP) ;astadr, astprm arguments null clrl -(SP) ;iosb argument null pushal jpi ;itmlst argument clrq -(SP) ;prcnam, pidadr arguments null clrl -(SP) ;efn argument null calls #7,G^sys$getjpi ;get our username bsbw check_status clrq -(SP) ;2 reserved arguments clrl -(SP) ;reserved argument pushal uai ;itmlst argument pushal namlen ;usrnam argument clrq -(SP) ;2 reserved arguments calls #7,G^sys$getuai ;get our login command file bsbw check_status movzbw lgicmd,lgilen ;convert descriptor incb lgiadr set_symbol lgisym lgilen ;create the DCL symbol LGICMD bsbw check_status $exit_s #ss$_normal ;exit with success check_status: ;report an error status message to sys$output and quit cmpl R0,#SS$_NORMAL ;normal successful completion? beql 50$ ;just exit if normal movl #1,errdspl ;setup for error display movl R0,errdspl+4 $putmsg_s msgvec = errdspl ;display error text to terminal $exit_s ;abort job 50$: rsb ;no error, just return .end uai_lgicmd