Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
secrules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
tools
secrules
Commits
844e1bd3c328
Commit
844e1bd3c328
authored
2 years ago
by
jfp
Browse files
Options
Downloads
Patches
Plain Diff
rule02: make code simple to read
rule04: starlet.device_scan always returns 4 values
parent
a859d1226501
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
secrules/rules02.py
+8
-2
8 additions, 2 deletions
secrules/rules02.py
secrules/rules04.py
+5
-5
5 additions, 5 deletions
secrules/rules04.py
with
13 additions
and
7 deletions
secrules/rules02.py
+
8
−
2
View file @
844e1bd3
...
@@ -46,7 +46,10 @@
...
@@ -46,7 +46,10 @@
)[
2
][
)[
2
][
ossdef
.
OSS__PROTECTION
ossdef
.
OSS__PROTECTION
]
# type:ignore
]
# type:ignore
if
not
((
sec
&
0x8000
)
and
(
sec
&
0x2000
)):
wprot
=
(
sec
&
0xF000
)
>>
12
wbit
=
0x2
dbit
=
0x8
if
wprot
&
wbit
==
0
or
wprot
&
dbit
==
0
:
if
fmt
:
if
fmt
:
print
(
'
0201
"
2
"'
,
fn
,
file
=
fo
)
print
(
'
0201
"
2
"'
,
fn
,
file
=
fo
)
else
:
else
:
...
@@ -90,7 +93,10 @@
...
@@ -90,7 +93,10 @@
)[
2
][
)[
2
][
ossdef
.
OSS__PROTECTION
ossdef
.
OSS__PROTECTION
]
# type:ignore
]
# type:ignore
if
not
((
sec
&
0x800
)
and
(
sec
&
0x200
)):
gprot
=
(
sec
&
0x0F00
)
>>
8
wbit
=
0x2
dbit
=
0x8
if
gprot
&
wbit
==
0
or
gprot
&
dbit
==
0
:
if
fmt
:
if
fmt
:
print
(
'
0202
"
3
"'
,
fn
.
decode
(),
file
=
fo
)
# type:ignore
print
(
'
0202
"
3
"'
,
fn
.
decode
(),
file
=
fo
)
# type:ignore
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
secrules/rules04.py
+
5
−
5
View file @
844e1bd3
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
while
True
:
while
True
:
try
:
try
:
sts
,
device
,
devCtx
=
starlet
.
device_scan
(
b
'
*
'
,
devItm
,
devCtx
)
sts
,
device
,
devCtx
,
d
=
starlet
.
device_scan
(
b
'
*
'
,
devItm
,
devCtx
)
except
:
except
:
break
break
if
not
lib
.
getdvi
(
dvidef
.
DVI__MNT
,
device_name
=
device
)[
1
]:
if
not
lib
.
getdvi
(
dvidef
.
DVI__MNT
,
device_name
=
device
)[
1
]:
...
@@ -138,5 +138,5 @@
...
@@ -138,5 +138,5 @@
print
(
fn
.
decode
(),
prot
.
decode
(),
file
=
fo
)
print
(
fn
.
decode
(),
prot
.
decode
(),
file
=
fo
)
devCtx
=
0
devCtx
=
0
devItm
=
[
devItm
=
(
itemList
.
itemList
(
code
=
dvsdef
.
DVS__DEVCLASS
,
value
=
dcdef
.
DC__DISK
),
itemList
.
itemList
(
code
=
dvsdef
.
DVS__DEVCLASS
,
value
=
dcdef
.
DC__DISK
),
...
@@ -142,5 +142,5 @@
...
@@ -142,5 +142,5 @@
itemList
.
itemList
(
code
=
dvsdef
.
DVS__DEVCLASS
,
value
=
dcdef
.
DC__DISK
),
itemList
.
itemList
(
code
=
dvsdef
.
DVS__DEVCLASS
,
value
=
dcdef
.
DC__DISK
),
]
)
while
True
:
while
True
:
try
:
try
:
...
@@ -144,7 +144,7 @@
...
@@ -144,7 +144,7 @@
while
True
:
while
True
:
try
:
try
:
sts
,
device
,
devCtx
=
starlet
.
device_scan
(
b
'
*
'
,
devItm
,
devCtx
)
sts
,
device
,
devCtx
,
d
=
starlet
.
device_scan
(
b
'
*
'
,
devItm
,
devCtx
)
except
:
except
:
break
break
if
not
lib
.
getdvi
(
dvidef
.
DVI__MNT
,
device_name
=
device
)[
1
]:
if
not
lib
.
getdvi
(
dvidef
.
DVI__MNT
,
device_name
=
device
)[
1
]:
...
@@ -307,7 +307,7 @@
...
@@ -307,7 +307,7 @@
while
True
:
while
True
:
try
:
try
:
sts
,
device
,
devCtx
=
starlet
.
device_scan
(
b
'
*
'
,
devItm
,
devCtx
)
sts
,
device
,
devCtx
,
d
=
starlet
.
device_scan
(
b
'
*
'
,
devItm
,
devCtx
)
except
:
except
:
break
break
if
not
lib
.
getdvi
(
dvidef
.
DVI__MNT
,
device_name
=
device
)[
1
]:
if
not
lib
.
getdvi
(
dvidef
.
DVI__MNT
,
device_name
=
device
)[
1
]:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment