From 50d576ac8f10d232e0467da79b6f74d9eb9a05b0 Mon Sep 17 00:00:00 2001 From: salk31 Date: Fri, 21 Mar 2025 10:24:25 +0000 Subject: [PATCH] Hints for people expecting an API that mimics setfacl --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a4d171c..c00c78f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ This is a Python 3.7+ extension module allows you to manipulate the POSIX.1e Access Control Lists present in some OS/file-systems -combinations. +combinations. Note this module provides a Python interface to libacl +it does not have the features of setfacl. Downloads: go to . Latest version is 0.7.2. The source repository is either at @@ -59,6 +60,19 @@ or: - `pkg install py37-setuptools` +## Example +``` +import posix1e + +# you must provide user, group and other permissions first and in that order +acl = ACL(text = 'u:rx,g:r,o:-,u:123:r') +# if you don't provide a mask you must explicity have it generated +acl.calc_mask() +acl.applyto('/foo/) +# unlike setfacl there is no "d:u:123:r" call applyto the a different type +acl.applyto('/foo', ACL.ACL_TYPE_DEFAULT) +``` + ## Security For reporting security vulnerabilities, please see `SECURITY.md`.