[mod.computers.vax] Set Protection=RWED/NAME_TABLE=...

lars@ACC.ARPA (10/31/85)

I figured it out - 2 hours with the fiche and 3 crashes:

This is the interesting part of my program (sections before this
verify the validity of the request).

If this will compile and link without error, then
the routines in the kernel are probably still intact.

If you want the whole program, send me a note, and I'll mail it.


			/ Lars Poulsen
			  Advanced Computer Communications
			 <Lars @ ACC.ARPA>
----------------------------------------------------------
	.TITLE	Charge
	.Ident	/4.03/
;    ________________________________________________________
;   /                                                         \
;   |          AAA          CCCCCCCCCCCCCC    CCCCCCCCCCCCCC   |
;   |         AAAAA        CCCCCCCCCCCCCCCC  CCCCCCCCCCCCCCCC  |
;   |        AAAAAAA       CCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC |
;   |       AAAA AAAA      CCCC              CCCC              |
;   |      AAAA   AAAA     CCCC              CCCC              |
;   |     AAAA     AAAA    CCCC              CCCC              |
;   |    AAAA       AAAA   CCCC              CCCC              |
;   |   AAAA  AAAAAAAAAAA  CCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCC |
;   |  AAAA    AAAAAAAAAAA CCCCCCCCCCCCCCCC  CCCCCCCCCCCCCCCC  |
;   | AAAA      AAAAAAAAA   CCCCCCCCCCCCCC    CCCCCCCCCCCCCC   |
;    \________________________________________________________/
;
;	Copyright (c) 1985 Advanced Computer Communications, Inc
;	720 Santa Barbara Street, Santa Barbara, California  93101
;	(805) 963-9431
;
;	A license to copy and use (but not for profit) and to
;	modify for their own use (but not to re-distribute modified
;	versions) is hereby granted to all DECUS members and to
;	all users in the ARPAnet community.
;	If you make changes or improvements, please send a copy
;	of your enhanced version back to ACC.
;
;
;
; Task Build Command Line:
;		LINK CHARGE+SYS$SYSTEM:SYS.STB/SELECT+SYSDEF.STB/SELECT
;
;
; System Notes:
;		Must be INSTALLED with PRIV=(CMK,SYSPRV)
;

P1	=	4
P2	=	8
P3	=	12

	.LIBRARY	/SYS$LIBRARY:LIB.MLB/				;851003
									;851003
	$IPLDEF								;851030
	$LNMDEF								;851023
	$LNMSTRDEF							;851030
	$ORBDEF								;851030
	$PRVDEF								;851003
	$UAFDEF								;851003

; .... stuff omitted

NAMEDESC:	.ASCID	/SYS$LOGIN/					;831030
TBLDESC:	.ASCID	/LNM$JOB/					;831030

; .... stuff omitted

	.ENTRY	SET_ACNT,0
;
;	Acnt = 8H12345678						;830721
;	Uic  = Group*(2**16) + Member
;	Idsw = SET_ACNT(%ref(Acnt),%val(Uic))
;
	$CMKRNL_S PATCH_IT,(AP)		; Call action routine
	RET

	.ENTRY	PATCH_IT,0

	MOVL	@#SCH$GL_CURPCB,R0	; Get PCB
	TSTL	P2(AP)			; Do we need to set the UIC ?
	BLEQ	10$			; If neg or zero, no
	MOVL	P2(AP),PCB$L_UIC(R0)	; Set UIC			;830721
10$:
	MOVL	PCB$L_JIB(R0),R0	; Get JIB
	MOVAL	JIB$T_ACCOUNT(R0),R1	; Point to Account code
	MOVQ	@P1(AP),(R1)		; Set new account code		;830721
	MOVQ	@P1(AP),CTL$T_ACCOUNT					;830721
;
;	Change ownership of Job Logical Name Table
;
	SETIPL	#IPL$_ASTDEL		; Prevent LNM tables from change
	PUSHL	R4			; Save PCB
	JSB	G^LNM$LOCKR		; Lock LNM MUTEX for reading
	MOVQ	NAMEDESC,R0		; Search for SYS$LOGIN
	BICL2	#^XFFFF0000,R0		; 
	MOVQ	TBLDESC,R2		;  in LNM$JOB
	BICL2	#^XFFFF0000,R2		; 
	MOVL	#PSL$C_USER,R5		; Search in User Mode
	JSB	G^LNM$SEARCHLOG
	PUSHR	#^M<R0,R1>
	MOVL	2*4(SP),R4
	JSB	G^LNM$UNLOCK		; Unlock mutex
	SETIPL	#0
	POPR	#^M<R0,R1>
	BLBC	R0,20$
;					; r1 -> Logical name block
	MOVL	LNMB$L_TABLE(R1),R1	; R1 -> Table Header
	MOVL	LNMTH$L_ORB(R1),R1	; R1 -> Owner Rights Block
	MOVL	P2(AP),ORB$L_OWNER(R1)	; Zap the ownership
20$:
	RET

	.END
------