# HG changeset patch # User Jean-Francois Pieronne <jf.pieronne@laposte.net> # Date 1587571613 -7200 # Wed Apr 22 18:06:53 2020 +0200 # Node ID 2ab83d86bb2946b1c4eac688dcab713598108df2 # Parent bfb6aa2d338bada366cc1f96d49c856cd30ff518 Continue executing on NOSUCHFILE exception diff --git a/secrules/rules02.py b/secrules/rules02.py --- a/secrules/rules02.py +++ b/secrules/rules02.py @@ -29,14 +29,18 @@ with FindFile('SYS$SYSROOT:[000000...]*.*') as fi: for fn in fi: it = [itemList.itemList(code = ossdef.OSS__PROTECTION, dtype = itemList.il_unsignedWord),] - sec = starlet.get_security(objnam=fn, clsnam='FILE', - itmlst=it)[1][ossdef.OSS__PROTECTION] - if not ((sec & 0x8000) and (sec & 0x2000)): - if fmt: - print>>fo, '0201�2�', fn - else: - print>>fo, fn - print>>fo, ' ' * 10, lib.format_sogw_prot (sec)[1] + try: + sec = starlet.get_security(objnam=fn, clsnam='FILE', + itmlst=it)[1][ossdef.OSS__PROTECTION] + if not ((sec & 0x8000) and (sec & 0x2000)): + if fmt: + print>>fo, '0201�2�', fn + else: + print>>fo, fn + print>>fo, ' ' * 10, lib.format_sogw_prot (sec)[1] + except VMSError, e: + if e.errno != ssdef.SS__NOSUCHFILE: + raise @level_rule(3) def rule0202(fo, fmt):