Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #197742
| From | Lawrence D’Oliveiro <ldo@nz.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Python linuxfs Modules |
| Date | 2026-03-18 08:04 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <10pdm9u$3kgpa$4@dont-email.me> (permalink) |
| References | <10pask7$2m01c$1@dont-email.me> <87bjgld52t.fsf@nightsong.com> |
On Tue, 17 Mar 2026 23:28:26 -0700, Paul Rubin wrote:
> There were a few things like this that were missing for years. I was
> going to suggest adding them to your modules, but it looks like
> they've finally made it to the Python world elsewhere.
Someone else had already done a wrapper for the ACL functions
<https://github.com/iustin/pylibacl>. However, I feel they expose too
much of the underlying libacl details -- for example, I don’t see the
point in separating a “permset” object from its associated ACL entry,
since the two are always tied together anyway. Also they have written
an extension module in C, whereas mine is a pure-Python implementation
using ctypes. As for what difference it makes, consider that they need
about 1800 lines of code, whereas I can provide equivalent
functionality in about half that.
Actually, I have a plan to go further. I have figured out that the
contents of an ACL can be expressed most naturally as a Python object
with the following components:
* a user_access array, indexed by the USERCLASS enum (with values
USER, GROUP and OTHER), with each value being a set of the PERM
enum (with the expected values READ, WRITE and EXECUTE); put these
together, and you get the usual *nix mode value.
* two dictionaries, “users” and “groups”, keyed by user and group
IDs respectively, with the values being sets of PERM as before.
You have the usual Python dictionary operations to
access/iterate/add/modify/remove entries in these -- no need
to invent new API-specific ones.
* a mask value, being yet another set of PERM.
Working at that level, it seems to me, would be easier than any simple
wrapper around libacl.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Python linuxfs Modules Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-17 06:33 +0000
Re: Python linuxfs Modules Oguz Kaan Ocal <oguzkaanocal3169@hotmail.com> - 2026-03-17 14:30 +0300
Re: Python linuxfs Modules Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-17 21:26 +0000
Re: Python linuxfs Modules Oguz Kaan Ocal <oguzkaanocal3169@hotmail.com> - 2026-03-22 14:14 +0300
Re: Python linuxfs Modules Paul Rubin <no.email@nospam.invalid> - 2026-03-17 23:28 -0700
Re: Python linuxfs Modules Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-18 08:04 +0000
Re: Python linuxfs Modules Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-03-21 23:10 +0000
Re: Python linuxfs Modules DFS <nospam@dfs.com> - 2026-04-08 12:26 -0400
csiph-web