SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      42  DECLARATIONS

   (3)     113  SETPRIV - Set or Clear privilege bit

SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   1

01                                                                                                                               (1)



                                     0000     1 

                                     0000     2 	.TITLE	SETPRIV - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME

                                     0000     3 	.IDENT	/01/

                                     0000     4 

                                     0000     5 ;

                                     0000     6 ; COPYRIGHT (C) 1978

                                     0000     7 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000     8 ;

                                     0000     9 ; THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

                                     0000    10 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000    11 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000    12 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000    13 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000    14 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000    15 ; REMAIN IN DEC.

                                     0000    16 ;

                                     0000    17 ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

                                     0000    18 ; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

                                     0000    19 ; CORPORATION.

                                     0000    20 ;

                                     0000    21 ; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

                                     0000    22 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000    23 

                                     0000    24 ;++

                                     0000    25 ; FACILITY: System Subroutine

                                     0000    26 ;

                                     0000    27 ; ABSTRACT:

                                     0000    28 ;

                                     0000    29 ;	This routine takes an ascii privilege name and sets or

                                     0000    30 ;	clears the specified bit in the supplied privilege vector.

                                     0000    31 ;

                                     0000    32 ; ENVIRONMENT: mode of caller

                                     0000    33 ;

                                     0000    34 ; AUTHOR: Henry M. Levy	, CREATION DATE: 10-January-1978

                                     0000    35 ;

                                     0000    36 ; MODIFIED BY:

                                     0000    37 ;

                                     0000    38 ;	, : VERSION

                                     0000    39 ; 01	- 

                                     0000    40 ;--

SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   2

01              DECLARATIONS                                                                                                     (2)



                                     0000    42 	.SBTTL	DECLARATIONS

                                     0000    43 ;

                                     0000    44 ; INCLUDE FILES:

                                     0000    45 ;

                                     0000    46 

                                     0000    47 	$PRVDEF				; define privilege bits

                                     0000    48 

                                     0000    49 ;

                                     0000    50 ; MACROS:

                                     0000    51 ;

                                     0000    52 

                                     0000    53 ;

                                     0000    54 ;	Macro to define entry to privilege name table.

                                     0000    55 ;

                                     0000    56 

                                     0000    57 	.MACRO	PRIVDEF BIT,MIN,NAME

                                     0000    58 	.BYTE	MIN

                                     0000    59 	.BYTE	PRV$V_'BIT

                                     0000    60 	.IF	NB	NAME

                                     0000    61 	.ASCIC	/NAME/

                                     0000    62 	.IFF

                                     0000    63 	.ASCIC /BIT/

                                     0000    64 	.ENDC

                                     0000    65 	.ENDM	PRIVDEF

                                     0000    66 

                                     0000    67 ;

                                     0000    68 ; EQUATED SYMBOLS:

                                     0000    69 ;

                           00000004  0000    70 	NAMDSC = 4			; offset to string descriptor

                           00000008  0000    71 	PRIVEC = 8			; offset to privilege vector address

                                     0000    72 

                           00000002  0000    73 	PRV$_INVNAM == 2		; privilege name invalid

                           00000004  0000    74 	PRV$_NOTUNQ == 4		; privilege name not unique

                                     0000    75 

                                     0000    76 

                                     0000    77 ;

                                     0000    78 ; OWN STORAGE:

                                     0000    79 ;

                                     0000    80 

                                     0000    81 PRV$AB_NAMES::

                                     0000    82 	PRIVDEF	CMKRNL,3	; MAY CHANGE MODE TO KERNEL

                                     0009    83 	PRIVDEF	CMEXEC,3	; MAY CHANGE MODE TO EXEC

                                     0012    84 ; ***** THE PRECEEDING TWO BITS MUST BE ADJACENT

                                     0012    85 ; ***** THE FOLLOWING TWO BITS MUST BE ADJACENT

                                     0012    86 	PRIVDEF	SYSNAM,4	; MAY INSERT IN SYSTEM LOGICAL NAME TABLE

                                     001B    87 	PRIVDEF	GRPNAM,3	; MAY INSERT IN GROUP LOGICAL NAME TABLE

                                     0024    88 ; ***** THE PRECEEDING TWO BITS MUST BE ADJACENT

                                     0024    89 	PRIVDEF	ALLSPOOL,3	; MAY ALLOCATE SPOOLED DEVICE

                                     002F    90 	PRIVDEF	DETACH,3	; MAY CREATE DETACHED PROCESSES

                                     0038    91 	PRIVDEF	DIAGNOSE,3	; MAY DIAGNOSE DEVICES

                                     0043    92 	PRIVDEF	LOG_IO,3	; MAY DO LOGICAL I/O

                                     004C    93 	PRIVDEF	GROUP,3		; MAY AFFECT OTHER PROCESSES IN SAME GROUP

                                     0054    94 	PRIVDEF	NOACNT,3,<ACNT>	; MAY SUPPRESS ACCOUNTING MESSAGE

                                     005B    95 	PRIVDEF	PRMCEB,4	; MAY CREATE PERMANENT COMMON EVENT CLUSTERS

                                     0064    96 	PRIVDEF	PRMMBX,4	; MAY CREATE PERMANENT MAILBOX

                                     006D    97 	PRIVDEF	PSWAPM,3	; MAY CHANGE PROCESS SWAP MODE

                                     0076    98 	PRIVDEF	SETPRI,3,<ALTPRI> ; MAY SET ANY PRIORITY VALUE

SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   3

01              DECLARATIONS                                                                                                     (2)



                                     007F    99 	PRIVDEF	SETPRV,3	; MAY SET ANY PRIVILEGE BITS

                                     0088   100 	PRIVDEF	TMPMBX,3	; MAY CREATE TEMPORARY MAILBOX

                                     0091   101 	PRIVDEF	WORLD,3		; MAY AFFECT OTHER PROCESSES IN THE WORLD

                                     0099   102 	PRIVDEF	OPER,3		; OPERATOR PRIVILEGE

                                     00A0   103 	PRIVDEF	EXQUOTA,3	; MAY EXCEED QUOTAS

                                     00AA   104 	PRIVDEF	NETMBX,3	; MAY CREATE NETWORK DEVICE

                                     00B3   105 	PRIVDEF	VOLPRO,3	; MAY OVERRIDE VOLUME PROTECTION

                                     00BC   106 	PRIVDEF	PHY_IO,3	; MAY DO PHYSICAL I/O

                                     00C5   107 	PRIVDEF	BUGCHK,3	; MAY MAKE BUG CHECK ERROR LOG ENTRIES

                                     00CE   108 	PRIVDEF	PRMGBL,4	; MAY CREATE PERMANENT GLOBAL SECTIONS

                                     00D7   109 	PRIVDEF	SYSGBL,4	; MAY CREATE SYSTEM WIDE GLOBAL SECTIONS

                                     00E0   110 	PRIVDEF	MOUNT,3		; MAY EXECUTE MOUNT VOLUME QIO

                              00 00  00E8   111 	.BYTE	0,0		; terminate table

SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   4

01              SETPRIV - Set or Clear privilege bit                                                                             (3)



                                     00EA   113 	.SBTTL	SETPRIV - Set or Clear privilege bit

                                     00EA   114 

                                     00EA   115 ;++

                                     00EA   116 ;

                                     00EA   117 ; FUNCTIONAL DESCRIPTION:

                                     00EA   118 ;

                                     00EA   119 ;	Set or clear privilege bit in specified privilege vector

                                     00EA   120 ;	depending on ascii privilege name.

                                     00EA   121 ;

                                     00EA   122 ; CALLING SEQUENCE:

                                     00EA   123 ;

                                     00EA   124 ;	CALLS/CALLG

                                     00EA   125 ;

                                     00EA   126 ; INPUTS:

                                     00EA   127 ;

                                     00EA   128 ;	NAMDSC(AP) = address of a string descriptor for the ascii

                                     00EA   129 ;		     privilege name

                                     00EA   130 ;	PRIVEC = address of the privilege vector in which to clear

                                     00EA   131 ;		 or set bits

                                     00EA   132 ;

                                     00EA   133 ; IMPLICIT INPUTS:

                                     00EA   134 ;

                                     00EA   135 ;	none

                                     00EA   136 ;

                                     00EA   137 ; OUTPUTS:

                                     00EA   138 ;

                                     00EA   139 ;	none

                                     00EA   140 ;

                                     00EA   141 ; IMPLICIT OUTPUTS:

                                     00EA   142 ;

                                     00EA   143 ;	none

                                     00EA   144 ;

                                     00EA   145 ; ROUTINE VALUE:

                                     00EA   146 ;

                                     00EA   147 ;    R0 =

                                     00EA   148 ;	LOW BIT SET -> success

                                     00EA   149 ;	LOW BIT CLEAR -> failure with:

                                     00EA   150 ;	    PRV$_NOTUNQ -> privilege name is ambiguous

                                     00EA   151 ;	    PRV$_INVNAM -> invalid privilege name

                                     00EA   152 ;

                                     00EA   153 ; SIDE EFFECTS:

                                     00EA   154 ;

                                     00EA   155 ;	none

                                     00EA   156 ;--

                                     00EA   157 

                                     00EA   158 PRV$SETPRIV::

                               07FC  00EA   159 	.WORD	^M<R2,R3,R4,R5,R6,R7,R8,R9,R10>

            54         04 AC     D0  00EC   160 	MOVL	NAMDSC(AP),R4		; get name string descriptor

            5A            64     3C  00F0   161 	MOVZWL	(R4),R10		; get string length

            54         04 A4     D0  00F3   162 	MOVL	4(R4),R4		; get string address

            55       FF05 CF     DE  00F7   163 	MOVAL	PRV$AB_NAMES,R5		; get address of name table

            56            01     D0  00FC   164 	MOVL	#1,R6			; assume 'NO' not specified

            5A            02     B1  00FF   165 	CMPW	#2,R10			; check at least 2 long

                          0F     14  0102   166 	BGTR	10$			; not enough to check for 'NO'

            64       4F4E 8F     B1  0104   167 	CMPW	#^A/NO/,(R4)		; see if bit to be turned off

                          08     12  0109   168 	BNEQ	10$			; branch if not

                          56     D4  010B   169 	CLRL	R6			; else remember to turn off bit

SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   5

01              SETPRIV - Set or Clear privilege bit                                                                             (3)



            54            02     C0  010D   170 	ADDL	#2,R4			; point string over 'NO'

            5A            02     C2  0110   171 	SUBL	#2,R10			; decrease length by 2

                                     0113   172 10$:

            57            85     9A  0113   173 	MOVZBL	(R5)+,R7		; get min string length

                          04     12  0116   174 	BNEQ	20$			; continue if more in table

            50            02     D0  0118   175 	MOVL	#PRV$_INVNAM,R0		; table done, name not found

                                 04  011B   176 	RET

                                     011C   177 20$:

            58            85     9A  011C   178 	MOVZBL	(R5)+,R8		; get privilege bit number

            59            85     9A  011F   179 	MOVZBL	(R5)+,R9		; get cstring length

            64            5A     29  0122   180 	CMPC3	R10,(R4),(R5)		; see if string match

                          65         0125       

                          05     13  0126   181 	BEQL	30$			; branch if strings match

            55            59     C0  0128   182 	ADDL	R9,R5			; skip of string in table

                          E6     11  012B   183 	BRB	10$			; continue search

                                     012D   184 30$:

            50            04     D0  012D   185 	MOVL	#PRV$_NOTUNQ,R0		; assume not unique

            57            5A     B1  0130   186 	CMPW	R10,R7			; see if enough was specified

                          08     19  0133   187 	BLSS	40$			; return if not enough

            58            56     F0  0135   188 	INSV	R6,R8,#1,@PRIVEC(AP)	; set or clear bit

         08 BC            01         0138       

                          50     D6  013B   189 	INCL	R0			; note success

                                     013D   190 40$:

                                 04  013D   191 	RET				; return to caller

                                     013E   192 

                                     013E   193 	.END

SETPRIV         - SET OR CLEAR PRIVILEGE BIT BY ASCII NAME       22-AUG-1978 04:23:33   VAX-11 MACRO X0.3-11               Page   6

SYMBOL TABLE                                                                                                                     (3)



BIT...         = 0000001A            

GBL...         = 00000000            

NAMDSC         = 00000004            

PRIVEC         = 00000008            

PRV$AB_NAMES     00000000 RG    01   

PRV$SETPRIV      000000EA RG    01   

PRV$V_ALLSPOOL = 00000004            

PRV$V_BUGCHK   = 00000017            

PRV$V_CMEXEC   = 00000001            

PRV$V_CMKRNL   = 00000000            

PRV$V_DETACH   = 00000005            

PRV$V_DIAGNOSE = 00000006            

PRV$V_EXQUOTA  = 00000013            

PRV$V_GROUP    = 00000008            

PRV$V_GRPNAM   = 00000003            

PRV$V_LOG_IO   = 00000007            

PRV$V_MOUNT    = 00000011            

PRV$V_NETMBX   = 00000014            

PRV$V_NOACNT   = 00000009            

PRV$V_OPER     = 00000012            

PRV$V_PHY_IO   = 00000016            

PRV$V_PRMCEB   = 0000000A            

PRV$V_PRMGBL   = 00000018            

PRV$V_PRMMBX   = 0000000B            

PRV$V_PSWAPM   = 0000000C            

PRV$V_SETPRI   = 0000000D            

PRV$V_SETPRV   = 0000000E            

PRV$V_SYSGBL   = 00000019            

PRV$V_SYSNAM   = 00000002            

PRV$V_TMPMBX   = 0000000F            

PRV$V_VOLPRO   = 00000015            

PRV$V_WORLD    = 00000010            

PRV$_INVNAM    = 00000002  G         

PRV$_NOTUNQ    = 00000004  G         





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        0000013E      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            00000000      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

26168. BYTES LEFT IN FREE MEMORY POOL.

346. BYTES OF RECLAIMED MEMORY.

OBJ$:SETPRIV,LIS$:SETPRIV/-SP=SRC$:SETPRIV

2 MLB DIR RDS - 97 GETS TO DEFINE 7 MACROS. 10 INTER. FILE WRITES. 

