(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_sys, prev: NUMUTC, next: PROCESS_SCAN)


PARSE_ACL - Parse Access Control List Entry


Parses the specified text string and converts it to the binary representation for an access control entry (ACE).

Format:

    status, errpos, aclent = vms_sys.parse_acl
             (aclstr ,[accnam] ,[nullarg])
Returns:
status
Condition value from SYS$PARSE_ACL.
errpos
Number of characters from aclstr processed by $PARSE_ACL. If the service fails, this count points to the failing point in the string.
aclent
ACE, binary. See the system services reference manual for an explanation of how it is formatted,
Arguments:
aclstr
Formatted ACE that is to be translated to its binary representationm by SYS$PARSE_ACL.
accnam
Names of the bits in the access mask. Specify 'None' to indicate omission of this argument or a 'vmsobj__access_names' object.
nullarg
Placeholder argument - any input other than None is an error.
Examples:
>>> import vms_sys
>>>
>>> aclstr = '(identifier= [1,4], access= read+write)'
>>>
>>> status, errpos, aclent = vms_sys.parse_acl (aclstr)
>>> print vms_sys.getmsg (status)
('%SYSTEM-S-NORMAL, normal successful completion', (0, 0, 0, 0))
>>> print errpos
39
>>> print len(aclstr)
39
>>> print repr(aclent)
'\014\001\000\000\003\000\000\000\004\000\001\000'
>>> # note that this is OCTAL representation


>>> aclstr = '(identifier= [2,7], access= read+submit)'
>>>
>>> # default is to use FILE access names
>>> status, errpos, aclent = vms_sys.parse_acl (aclstr, None)
>>> print vms_sys.getmsg (status)
%SYSTEM-F-IVACL, invalid access control list entry syntax
>>> print errpos
20
>>> print repr (aclstr[errpos:])
'access= read+submit)'
>>> print repr(aclent)
''
>>>
>>> import vms_lib
>>>
>>> # get access names table of QUEUE
>>> accnam_queue = vms_lib.get_accnam ('QUEUE')
>>> print accnam_queue
<vmsobj__access_names, ACCESS_NAMES at 0x002b6a20>
>>> status, errpos, aclent = vms_sys.parse_acl (aclstr, accnam_queue)
>>> print vms_sys.getmsg (status)
%SYSTEM-S-NORMAL, normal successful completion
>>> print errpos
40
>>> print len(aclstr)
40
>>> print repr(aclent)
'\014\001\000\000\003\000\000\000\007\000\002\000'
>>> # note that this is OCTAL representation


@@ more vms_sys.parse_acl() examples
>>>

(go to: table of contents, index, list of vms_sys, prev: NUMUTC, next: PROCESS_SCAN)

11-JUL-1999 ZE.