Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
207159cf
Commit
207159cf
authored
Feb 27, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ansible: fix bug in apply_mode_spec().
parent
ff617824
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ansible_mitogen/helpers.py
ansible_mitogen/helpers.py
+4
-4
No files found.
ansible_mitogen/helpers.py
View file @
207159cf
...
@@ -172,7 +172,7 @@ def write_path(path, s):
...
@@ -172,7 +172,7 @@ def write_path(path, s):
CHMOD_CLAUSE_PAT
=
re
.
compile
(
r'([uoga]
?
)([+\
-=])([ugo]|[
rwx]*)'
)
CHMOD_CLAUSE_PAT
=
re
.
compile
(
r'([uoga]
*
)([+\
-=])([ugo]|[
rwx]*)'
)
CHMOD_MASKS
=
{
CHMOD_MASKS
=
{
'u'
:
stat
.
S_IRWXU
,
'u'
:
stat
.
S_IRWXU
,
'g'
:
stat
.
S_IRWXG
,
'g'
:
stat
.
S_IRWXG
,
...
@@ -198,16 +198,16 @@ def apply_mode_spec(spec, mode):
...
@@ -198,16 +198,16 @@ def apply_mode_spec(spec, mode):
for
clause
in
spec
.
split
(
','
):
for
clause
in
spec
.
split
(
','
):
match
=
CHMOD_CLAUSE_PAT
.
match
(
clause
)
match
=
CHMOD_CLAUSE_PAT
.
match
(
clause
)
who
,
op
,
perms
=
match
.
groups
()
who
,
op
,
perms
=
match
.
groups
()
mask
=
CHMOD_MASKS
[
who
]
bits
=
CHMOD_BITS
[
who
]
for
ch
in
who
or
'a'
:
for
ch
in
who
or
'a'
:
mask
=
CHMOD_MASKS
[
ch
]
bits
=
CHMOD_BITS
[
ch
]
cur_perm_bits
=
mode
&
mask
cur_perm_bits
=
mode
&
mask
new_perm_bits
=
or_
(
bits
[
p
]
for
p
in
perms
)
new_perm_bits
=
or_
(
bits
[
p
]
for
p
in
perms
)
mode
&=
~
mask
mode
&=
~
mask
if
op
==
'='
:
if
op
==
'='
:
mode
|=
new_perm_bits
mode
|=
new_perm_bits
elif
op
==
'+'
:
elif
op
==
'+'
:
mode
|=
new_perm_bits
|
cur_per_bits
mode
|=
new_perm_bits
|
cur_per
m
_bits
else
:
else
:
mode
|=
cur_perm_bits
&
~
new_perm_bits
mode
|=
cur_perm_bits
&
~
new_perm_bits
return
mode
return
mode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment