CDIST-TYPE__ACL(7)

✨ cdist-type__acl πŸ’… β€” the set ACL entries era

okay bestie so this is cdist-type__acl, part of the cdist manual (section 7), and it's literally the type that sets your ACL entries. file permission drama? solved. periodt. πŸŽ€


🌸 DESCRIPTION

Fully supported and tested on Linux (ext4 filesystem) 🐧, with partial support for FreeBSD. so like, Linux is the main character here, FreeBSD is lowkey invited but not fully in the group chat, ngl.

For the full tea, go peek at the setfacl and acl manpages β€” they have all the extra lore.

⚠️ You must use one of --entry or --source. Not optional, not a vibe, it's a requirement. no cap.

🧚 OPTIONAL MULTIPLE PARAMETERS

  • entry β€” sets an ACL entry following the getfacl output syntax. You must use this one if --source isn't being used. it's giving "pick me, I'm the one you need" πŸ’–

πŸ¦‹ OPTIONAL PARAMETERS

  • source β€” reads ACL entries from stdin or from a file. the ordering of entries does not matter, so don't stress about lining them up like a perfectly curated playlist 🎧. When reading from a file, comments and empty lines are ignored (they simply don't exist to this type, iconic behavior). You must use this if --entry isn't being used.
  • file β€” create/change a file with __file using the user:group:mode pattern. yes the whole pattern, exactly like that πŸ‘‘
  • directory β€” create/change a directory with __directory using the user:group:mode pattern. same energy, but for a dir πŸ’œ

🌈 BOOLEAN PARAMETERS

  • default β€” sets all ACL entries as default too. Heads up bestie: only directories can have default ACLs, and setting a default ACL in FreeBSD is currently not supported. so if you're on FreeBSD and try this, it's a no from the codebase 😭
  • recursive β€” makes setfacl recursive (Linux only!!), but not getfacl in explorer. so like, it goes down the tree for setting, but the explorer isn't doing the same. iykyk.
  • remove β€” removes undefined ACL entries. 🧹 but real talk: mask and other entries can't be removed, they can only be changed. so don't come for them, they're not going anywhere. πŸ’€

πŸ”₯ EXAMPLES

the moment you've been waiting for, the main event, the slay:

__acl /srv/project \
    --default \
    --recursive \
    --remove \
    --entry user:alice:rwx \
    --entry user:bob:r-x \
    --entry group:project-group:rwx \
    --entry group:some-other-group:r-x \
    --entry mask::r-x \
    --entry other::r-x

then we've got the sneaky one β€” giving Alice read-only access to a subdir, but not letting her see the parent content:

# give Alice read-only access to subdir,
# but don't allow her to see parent content.

__acl /srv/project2 \
    --remove \
    --entry default:group:secret-project:rwx \
    --entry group:secret-project:rwx \
    --entry user:alice:--x

__acl /srv/project2/subdir \
    --default \
    --remove \
    --entry group:secret-project:rwx \
    --entry user:alice:r-x

reading an ACL from stdin, because piping is self-care 🫢:

# read acl from stdin
echo 'user:alice:rwx' \
    | __acl /path/to/directory --source -

and finally, creating/changing the directory too, because why not do both:

# create/change directory too
__acl /path/to/directory \
    --default \
    --remove \
    --directory root:root:770 \
    --entry user:nobody:rwx

πŸ‘‘ AUTHORS

Ander Punnar <ander-at-kvlt-dot-ee> β€” absolute legend, wrote the whole thing πŸ’–


πŸ“œ COPYING

Copyright (C) 2018 Ander Punnar. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

(yes that's the standard GPL blessing, we love a permissive queen πŸŽ€)


ungleich GmbH 2021


and that's the whole page bestie, tysm for reading, ily 🫢 β€” this was cdist-type__acl from the cdist manual, version 7.0.0, dated Jul 31, 2022. go forth and set your ACLs correctly, no cap. πŸ’…βœ¨

πŸ“¦ where this page comes from