(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: RESUME, next: SCHDWK)


REVOKID - Revoke Identifier from Process


Removes the specified identifier from the rights list of the process or the system. If the identifier is listed as a holder of any other identifier, the appropriate holder records are also deleted.

Format:

    setflg, targpid, id, prvatr = vms_sys.revokid \
                          ([pidadr] [,prcnam] [,id] [,name])
Returns:
setflg
The system service returns SS$_WASSET or SS$_WASCLR to indicate if the rightslist did or did not contain the identifier before. The Python function does not return the status code - it returns 0 if the identifier did not exist in the rightslist before and returns 1 if it did. Any other code returned from the system service results in a Python exception.
targpid
Process identification of process to be affected. A value of -1 indicates the system rights list.
The targed PID (targpid) is always returned - it is as if you have specified a '0' value for the 'pidadr' argument. If an error happens, then vms_sys.revokid() raises a Python exception.
id
Identifier and attributes to be removed. These are even returned when the programmer specifies 'None' as argument 3.
The Python function returns a tuple of 2 integers - not a quadword represented by a Python long integer. The first element contains the binary identifier code. The second element contains the attributes. Bitmask values for these attributes are defined in module 'vms_kgbdef'.
prvatr
Previous attributes of the identifier if it was previously present in the rights list.
Arguments:
pidadr
Process identification of process to be affected.
prcnam
Process name of process to be affected.
id
Identifier and attributes to be removed.
The Python function only accepts a tuple of 2 integers - not a quadword represented by a Python long integer. The first element contains the binary identifier code. The second element contains the attributes. Bitmask values for these attributes are defined in module 'vms_kgbdef'.
name
Name of the identifier to be removed - this is a string.
Examples:
$ show process /rights

 3-SEP-1998 21:36:41.07   User: ZESSIN     Process ID:   00000097
                          Node: HERE       Process name: "ZESSIN_FTA10"

Process rights:
 INTERACTIVE
 LOCAL

System rights:
 SYS$NODE_HERE
$

>>> import vms_sys
>>> import vms_kgbdef

>>> pid  = 151
>>> id_1 = 0x80010011    # ID_1
>>> id_2 = 0x80010012    # ID_2
>>> attr = vms_kgbdef.KGB_M_DYNAMIC + vms_kgbdef.KGB_M_RESOURCE

>>> # grant the process an identifier
>>> vms_sys.grantid (pid, None, (id_1,attr), None)
(0, 151, (-2147418095, 3), 0)
 |  |     |            |   |-- previous identifier attributes
 |  |     |            |------ attributes mask (DYNAMIC + RESOURCE)
 |  |     |------------------- identifier ID_1
 |  |------------------------- PID
 |---------------------------- 0= identifier not previously granted
>>> 

$ show process /rights

 3-SEP-1998 21:43:49.95   User: ZESSIN     Process ID:   00000097
                          Node: HERE       Process name: "ZESSIN_FTA10"

Process rights:
 INTERACTIVE
 LOCAL
 ID_1                              resource, dynamic

System rights:
 SYS$NODE_HERE


>>> attr = vms_kgbdef.KGB_M_RESOURCE
>>> # revoke the identifier from the process
>>> vms_sys.revokid (pid, None, (id_1,attr), None)
(1, 151, (-2147418095, 1), 3)
 |  |     |            |   |-- previous identifier attributes
 |  |     |            |------ attributes mask
 |  |     |------------------- identifier ID_1
 |  |------------------------- PID
 |---------------------------- 1= identifier was previously granted

>>> # removing an identifier that is not granted is not an error!
>>> vms_sys.revokid (pid, None, (id_1,attr))
(0, 151, (-2147418095, 1), 0)
 |---------------------------- 0= identifier not previously granted
>>>

$ show process /rights

 3-SEP-1998 21:47:07.39   User: ZESSIN     Process ID:   00000097
                          Node: HERE       Process name: "ZESSIN_FTA10"

Process rights:
 INTERACTIVE
 LOCAL

System rights:
 SYS$NODE_HERE


>>> # CMKRNL privilege is missing
>>> vms_sys.revokid (pid, None, (id_1,attr), None)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (36, '%SYSTEM-F-NOPRIV, insufficient privilege or \
 object protection violation')
>>>
$ set process/privilege=(CMKRNL,SYSNAM)
$ set rights_list /enable /system id_2
$ show process /rights

 3-SEP-1998 21:49:19.02   User: ZESSIN     Process ID:   00000097
                          Node: HERE       Process name: "ZESSIN_FTA10"

Process rights:
 INTERACTIVE
 LOCAL

System rights:
 SYS$NODE_HERE
 ID_2                              resource, dynamic

>>> # remove an identifier from the system rights list
>>> #  -- requires CMKRNL+SYSNAM privilege
>>> id_2 = 0x80010012    # ID_2
>>> attr = vms_kgbdef.KGB_M_DYNAMIC + vms_kgbdef.KGB_M_RESOURCE
>>> vms_sys.revokid (-1, None, (id_2,attr), None)
(1, -1, (-2147418094, 3), 0)
 |  |    |            |   |- old attributes
 |  |    |            |----- current attributes
 |  |    |------------------ identifier value
 |  |----------------------- PID, -1 = system rights list
 |-------------------------- setflg = 1 -- identifier was already
                                           in the system rights list
>>> 

$ show process /rights
$HERE> show process /rights

 3-SEP-1998 21:54:09.18   User: ZESSIN     Process ID:   00000097
                          Node: HERE       Process name: "ZESSIN_FTA10"

Process rights:
 INTERACTIVE
 LOCAL

System rights:
 SYS$NODE_HERE
$
@@ REVOKID - more examples
>>>

(go to: table of contents, index, list of vms_sys, prev: RESUME, next: SCHDWK)

28-SEP-1998 ZE.