;------------------------------------------------------------------------------ .TITLE PERSONA_MAR .IDENT /1.0.1/ ;------------------------------------------------------------------------------ ; ; This package is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; version 2 of the License, or any later ; version. ; This package is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; This module has been plagiarized from MACRO that supports(ed?) ; the BECOME program (WEW). Culled to merely set the PCB username(s). ; This is only intended for pre-VMS 6.2 VAX where $PERSONA is not supported. ; See PERSONA.C for the environment from which this is called. ; It assumes the username parameter will be 12 characters blank filled. ; I am not a VMS internals specialist! ; I have absolutely little idea what I'm doing here!! ; Use at your own risk!!! ; YOU HAVE BEEN WARNED!!!! ; VERSION HISTORY ; --------------- ; 01-NOV-2001 MGD v1.0.1, refinements suggested by J.Begg ; 28-OCT-2001 MGD v1.0.0, initial ; ;------------------------------------------------------------------------------ ; ; Include files: ; .LIBRARY /SYS$LIBRARY:LIB/ ; Executive macro library .LINK 'SYS$SYSTEM:SYS.STB'/SELECTIVE_SEARCH $PCBDEF ; Process Control Block offsets $JIBDEF ; Job Information Block offsets $PHDDEF ; Process Header Block offsets $PRDEF ;------------------------------------------------------------------------------- .PSECT DATA,RD,NOWRT,NOEXE,PIC,LONG ;------------------------------------------------------------------------------- .ENTRY MACRO_SET_USERNAME, 0 ; Routine entry point $CMKRNL_S ROUTIN=MACRO_SETUSR, - ; Kick into kernel ARGLST=(AP) ; & pass along the argument list RET ; back to the calling function .ENTRY MACRO_SETUSR, ^M ; Kernel entry point MOVAL HANDLER, (FP) ; Establish anti-crashing handler MOVL PCB$L_JIB(R4),R0 ; Get JIB address MOVC3 #JIB$S_USERNAME,@4(AP),- ; Copy the username JIB$T_USERNAME(R0) ; into the JIB MOVC3 #JIB$S_USERNAME,@4(AP),- ; Copy the username G^CTL$T_USERNAME ; into the CTL region MOVZBL #SS$_NORMAL, R0 ; Set success RET ; from kernel ;------------------------------------------------------------------------------- .PSECT COND_HANDLER RD,NOWRT,PIC,EXE,LONG ;------------------------------------------------------------------------------- .ENTRY HANDLER ^M<> ; 10$: $EXIT_S ; Cause process to exit ;------------------------------------------------------------------------------- .END ;-------------------------------------------------------------------------------