Google
 

Trailing-Edge - PDP-10 Archives - bb-x130a-sb - accchk.mac
There are 4 other files named accchk.mac in the archive. Click here to see a list.
TITLE ACCCHK - Sample program to do access control via ACTDAE

;COPYRIGHT (C) 1980,1981 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERRED.
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.


	SEARCH	UUOSYM,MACTEN,ACTSYM	;GET SOME SYMBOLS
	SALL

	ACCVER==1		;VERSION NUMBER
	ACCEDT==2		;EDIT NUMBER
	ACCWHO==0		;WHO LAST EDIT
	ACCMIN==0		;MINOR VERSION NUMBER

	LOC	137
	VRSN.	(ACC)		;INSTALL THE VERSION NUMBER
	RELOC

;This sample program shows how to have ACTDAE verify the PPN, Password, and
;	Account string for a particular user.  This can be used
;	by a program that needs to check access but does not want to learn
;	how to read ACCT.SYS (e.g. A file transfer spooler).  A program
;	wishing to ask ACTDAE for this function must be privileged.

;Since I am not about to hard code my PPN and Password into this program, you
;	will have to patch/modify it to see it work.

ACCCHK:	RESET				;START FRESH
	MOVE	1,[BLKLEN,,ARGBLK]	;POINT TO QUEUE. ARGUMENTS
	QUEUE.	1,			;ASK ACTDAE
	  JRST	[OUTSTR [ASCIZ/?/]	;SHOW ERROR CHARACTER
		OUTSTR RESPON		;AND ACTDAES ERROR MESSAGE
		JRST XIT]		;AND QUIT
	OUTSTR	[ASCIZ/Access will be allowed./]
	LDB	1,[POINT 7,RESPON,6]	;SEE IF ACTDAE HAS AN ACCOUNT STRING FOR US
	JUMPE	1,XIT			;NOPE
	OUTSTR	[ASCIZ/ (Returned account string = "/]
	OUTSTR	RESPON			;SHOW ACCOUNT STRING WE ARE SUPPOSED TO USE
	OUTSTR	[ASCIZ/")./]		;FINISH OUTPUT
XIT:	MONRT.				;ALL DONE
	JRST	.-1			;NO CONTINUE

ARGBLK:	QF.RSP!.QUMAE			;WANT RESPONSE,,TALK TO ACTDAE
	0				;RESERVED
	20,,RESPON			;LENGTH,,ADDR OF RESPONSE BLOCK
	QA.IMM!1B17!.QBAFN		;ACCOUNTING SUB-FUNCTION HERE
	UGACC$				;FUNCTION = ACCESS CONTROL CHECK

	QA.IMM!1B17!.UGTYP		;TYPE OF CHECK REQUESTED
	UG.VER				;NORMAL PPN, ACCT STRING, AND PASSWORD

	10,,.UGACT			;HERE COMES AN ACCOUNT STRING
	ACTSTR				;FIND IT OVER THERE

	QA.IMM!1B17!.UGPPN		;PPN TO CHECK
PPN:	0				;PUT IT HERE

	QA.IMM!1B17!.UGPSW		;PASSWORD THE USER TYPED
PSW:	0				;PUT IT HERE

BLKLEN==.-ARGBLK			;LENGTH OF THE ARGUMENT BLOCK

ACTSTR:	BLOCK	10			;SPACE FOR THE ACCOUNT STRING
RESPON:	BLOCK	20			;THE RESPONSE BLOCK

	END	ACCCHK