KACL from KIO isn't really POSIX-compliant

Albert Astals Cid aacid at kde.org
Wed Dec 16 18:03:24 GMT 2020


El dimecres, 2 de desembre de 2020, a les 10:36:30 CET, Gleb Popov va escriure:
> Hello everyone.
> 
> I tried compiling kio/src/core/kacl.cpp on FreeBSD, which does support
> POSIX ACLs, and failed. This is because KACL's code uses non-standard
> Linux-specific acl_* functions. I tried implementing them using standard
> ones and it turned out to be impossible, mainly because types like acl_t
> are opaque to the user of the library.
> 
> For instance, there is no standard acl_get_perm() function and it is
> impossible to implement it without getting into acl_permset_t.
> 
> Now I'm a bit unsure how to solve this. I can implement non-standard
> functions in FreeBSD's libc without touching KACL code, or I can rewrite
> the KACL class to be truly POSIX-compliant. The latter seems to be a better
> idea on the first look, but it'd require keeping track of all the
> permission flags set (again, because there is no acl_get_perm()) inside.
> This will turn KACL class from being a tiny acl_* wrapper into a beefy
> chunk of code, but at least we won't lie that it is POSIX-compliant.
> 
> Any thoughts?

This is exactly why we need CI at the Merge Request stage and not later, we would have caught this and whoever was proposing the change would have to fix it or find someone to help fix it.

Anyhow, that's off topic :D

About how to fix it, well fixing it in FreeBSD is probably "harder" that in kio (amount of people needed to be convinced), so I'd vote for the second so we can get unblocked as soon as possible.

On how to fix it in KIO, the optimal way in my opinion is "abstract-like-its-kde", i.e. create a wrapper API on top of acl_* that has a #if LINUX and just calls the existing code and and #else POSIX and has the "beefy chunk of code" (but that's me not having a clue whatsoever about this ACL code).

Cheers,
  Albert

> 
> P.S. Please CC me, as I'm not subscribed.
> 






More information about the Kde-frameworks-devel mailing list