Skip to content

acl.delfacl: fix position of -X option to setfacl - #36938

Merged
rallytime merged 3 commits into
saltstack:developfrom
wanparo:develop
Oct 13, 2016
Merged

rallytime merged 3 commits into
saltstack:developfrom
wanparo:develop

Conversation

@wanparo

@wanparo wanparo commented Oct 12, 2016

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix wrong order of options to setfacl for acl.delfacl of linux_acl.py for recursive=True

Previous Behavior

setfacl called by acl.delfacl recursive=True complains about the wrong -R parameter to the -x option:

$ salt-call acl.delfacl user jr rwx /root/acl-test recursive=True
[INFO    ] Executing command 'setfacl -x -R u:jr rwx /root/acl-test' in directory '/root'
[ERROR   ] Command 'setfacl -x -R u:jr rwx /root/acl-test' failed with return code: 2
[ERROR   ] output: setfacl: Option -x: Invalid argument near character 1
local:
   True
$

New Behavior

The call to setfacl succeeds.

 $ salt-call acl.delfacl user jr rwx /root/acl-test recursive=True
[INFO    ] Executing command 'setfacl -R -x u:jr rwx /root/acl-test' in directory '/root'
local:
    True
$ 

Tests written?

No

Please review Salt's Contributing Guide for best practices.

@wanparo wanparo changed the title - acl.delfacl: fix position of -X option to setfacl acl.delfacl: fix position of -X option to setfacl Oct 12, 2016
@rallytime

Copy link
Copy Markdown
Contributor

Nice catch @wanparo. It looks like one of our unit tests is failing with this change. Can you take a look at that?

Let us know if you have any questions.

@rallytime rallytime added the pending-changes The pull request needs additional changes before it can be merged label Oct 12, 2016
@wanparo

wanparo commented Oct 12, 2016

Copy link
Copy Markdown
Contributor Author

No idea about unit.transport.zeromq_test.AESReqTestCases.test_badload, that seems to be unrelated, but unit.modules.linux_acl_test.LinuxAclTestCase.test_delfacl__recursive_w_multiple_args checks for the broken command line setfacl -x -R ... — and subsequently fails for the corrected one.

@rallytime

Copy link
Copy Markdown
Contributor

@wanparo The zeromq_test is unrelated and a flaky test. I figured the linux_acl_test was failing because of your change (and was testing the incorrect behavior) and needed to be adjusted. Is that something you could fix for this pull request? I can grab it if not. Just let me know either way.

@wanparo

wanparo commented Oct 12, 2016

Copy link
Copy Markdown
Contributor Author

I'm afraid testing the unit test takes more time to setup than I have right now, it would be great if you could make the change to the test yourself.

@rallytime

Copy link
Copy Markdown
Contributor

@wanparo No problem! I have made a pull request against your branch. If you merge that in, I believe that will pull in the change here. Otherwise I can just submit both changes in my own PR to Salt. LMK what you'd prefer.

Thanks again for your help!

Adjust linux_acl unit test argument ordering
@wanparo

wanparo commented Oct 13, 2016

Copy link
Copy Markdown
Contributor Author

Thanks, that worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-changes The pull request needs additional changes before it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants