(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: INIT_VOL, next: MOD_IDENT)


MOD_HOLDER - Modify Holder Record in Rights Database


Modifies the specified holder record of the target identifier in the rights database.

Format:

    vms_sys.mod_holder (id, holder, [,set_attrib] [,clr_attrib])
Returns:

None

Arguments:

id
Binary value of target identifier to be modified.
holder
Identifier of holder to be modified.
The Python function only accepts a tuple of 2 integers - not a quadword represented by a Python long integer. For OpenVMS V6.1 the first element is the holder's UIC identifier, the second element must be 0. Check the system services reference manual for your version of OpenVMS.
set_attrib
Bit mask of attributes to be enabled for the identifier. If you specify the same attribute in set_attrib and clr_attrib, the attribute is enabled. Bitmask values are defined in module 'vms_kgbdef'.
clr_attrib
Bit mask of attributes to be disabled for the identifier. If you specify the same attribute in set_attrib and clr_attrib, the attribute is enabled. Bitmask values are defined in module 'vms_kgbdef'.
Examples:
UAF> add /identifier ID_1 /attributes=resource
%UAF-I-RDBADDMSG, identifier ID_1 value %X80010011 added to rights \
 database
UAF> add /identifier ID_2 /attributes=(dynamic,resource)
%UAF-I-RDBADDMSG, identifier ID_2 value %X80010012 added to rights \
 database
UAF> grant /identifier ID_1 SYSTEM /attributes=resource
%UAF-I-GRANTMSG, identifier ID_1 granted to SYSTEM
UAF> grant /identifier ID_2 SYSTEM /attributes=(dynamic)
UAF> show /identifier /full ID_1
  Name                             Value           Attributes
  ID_1                             %X80010011      RESOURCE
    Holder                           Attributes
    SYSTEM                           RESOURCE
UAF> show /identifier /full ID_2
  Name                             Value           Attributes
  ID_2                             %X80010012      RESOURCE DYNAMIC
    Holder                           Attributes
    SYSTEM                           DYNAMIC
UAF>


>>> import vms_sys
>>> import vms_kgbdef

>>> id_1 = 0x80010011    # identifier ID_1
>>> id_2 = 0x80010012    # identifier ID_1
>>> uic  = 0x10004       # UIC [1,4] (User SYSTEM)

>>> vms_sys.mod_holder (id_1, (uic,0), None, vms_kgbdef.KGB_M_RESOURCE)

UAF> show /identifier /full ID_1
  Name                             Value           Attributes
  ID_1                             %X80010011      RESOURCE
    Holder                           Attributes
    SYSTEM
UAF> ! attribute removed             !!!!!!!!!!

>>> clr_attr = vms_kgbdef.KGB_M_DYNAMIC
>>> set_attr = vms_kgbdef.KGB_M_RESOURCE

>>> vms_sys.mod_holder (id_1, (uic,0), clr_attr, set_attr)

UAF> show /identifier /full ID_2
  Name                             Value           Attributes
  ID_2                             %X80010012      RESOURCE DYNAMIC
    Holder                           Attributes
    SYSTEM                           DYNAMIC
UAF> ! RESOURCE removed, DYNAMIC applied !!!


>>> id_x = 0x80012345     # ungranted identifier
>>> vms_sys.mod_holder (id_x, (uic,0), clr_attr, set_attr)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (8684, '%SYSTEM-F-NOSUCHID, unknown rights identifier')
>>>

>>> uic_x = 0x30003       # UIC without name
>>> vms_sys.mod_holder (id_1, (uic_x,0), clr_attr, set_attr)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (8684, '%SYSTEM-F-NOSUCHID, unknown rights identifier')
>>>

>>> vms_sys.mod_holder (id_1, 'X')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 2: holder - must be a tuple of 2 integers
>>>
>>> vms_sys.mod_holder (id_1, (0,'X'))
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 2: holder - tuple-element:1 is not an integer
>>>
>>> vms_sys.mod_holder (id_1, ('X',0))
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 2: holder - tuple-element:0 is not an integer
>>>

(go to: table of contents, index, list of vms_sys, prev: INIT_VOL, next: MOD_IDENT)

28-SEP-1998 ZE.