Skip to content

State acl.present doesn't allow to set "default" ACLs #22142

Closed

Description

@multani

The following state:

/foo/bar
  acl.present:
    - acl_type: default:group
    - acl_name: some-group
    - perms: rw

gives the following error:

          ID: /foo/bar
    Function: acl.present
      Result: False
     Comment: ACL Type does not exist
     Started: 13:25:03.784565
    Duration: 6.592 ms
     Changes: 

This is because of this check:

  • it uses acl.getfacl which doesn't return the "default" ACLs if none has been set
  • additionaly, even if acl.getfacl did this, the same check can't understand the tree-like structure returned by acl.getfacl in case a default ACL has been set (in this case, acl.getfacl returns a dictionary with a defaults key which then contains the groups and users information related to the default ACL).

I'm willing to propose a fix, but I'd like to have a little guidance here.

I would go this way:

  • do some parsing around acl_type and detect if we want to set the default ACL or not.
  • if it does, limit the _current_perm dictionary to the content of the defaults key if it exists or an empty dictionary if it doesn't
  • then proceed as already done in the state function (get the user, try to see if the permission is already set, etc.)

Thoughts?

Activity

  1. added
    bug
    severity-low
    on Mar 30, 2015
  2. added this to the Approved milestone on Mar 30, 2015
  3. jfindlay commented on Mar 30, 2015

    @jfindlay
    Contributor

    @multani, I'm not an ACL expert, but your proposed solution seems like the right approach to me. Please feel free to submit a pull request against the oldest release branch applicable, thanks.

  4. added
    P2
    severity-medium
    and removed
    severity-low
    on Apr 16, 2015
  5. added
    Platform
    on May 26, 2015
  6. implicitnewt commented on Sep 3, 2015

    @implicitnewt

    Has this bug been addressed?

  7. multani commented on Sep 3, 2015

    @multani
    ContributorAuthor

    I haven't took the time to propose a patch yet, sorry about that... :(

  8. implicitnewt commented on Sep 3, 2015

    @implicitnewt

    Ok fair enough, I'll just package up a bunch of commands for it for now.... not enough time to dig through the code here :(

  9. DylanFrese commented on Mar 7, 2016

    @DylanFrese
    Contributor

    @multani I just ran into this. I haven't used Python before, but I'm willing to put some hours towards a patch if you haven't put one together yet.

  10. added
    P1
    and removed
    P2
    on Mar 7, 2016
  11. multani commented on Mar 9, 2016

    @multani
    ContributorAuthor

    @DylanFrese I had a beginning of a patch somewhere, but I can't find it anymore :/

  12. DylanFrese commented on Mar 9, 2016

    @DylanFrese
    Contributor

    @multani I've created a PR if you want to take a look.

    It seems a commit was added in November that did much of what you suggested, but not quite enough.

  13. added
    fixed-pls-verify
    on Mar 9, 2016
  14. LuboVarga commented on May 9, 2016

    @LuboVarga

    Hi here, I have tested manually applying of commit 71d48a4 onto 2015.8.8.2 (Beryllium) (centos from saltstack repo). Default acl is working as expected.

  15. jfindlay commented on May 9, 2016

    @jfindlay
    Contributor

    @LuboVarga, thanks for verifying. If anyone else is still having problems, we can reopen the issue.

  16. timwsuqld commented on May 9, 2016

    @timwsuqld

    @jfindlay Which release can we expect this fix to be in?

  17. jfindlay commented on May 10, 2016

    @jfindlay
    Contributor

    @timwsuqld, since the fix was made against develop, we should ask @rallytime to consider a backport.

  18. rallytime commented on May 10, 2016

    @rallytime
    Contributor

    Sure. Back-port to 2015.8 is in #33139.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1PlatformState-Modulebugfixed-pls-verifyseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions