Re: About the userland API for ACL, xattr, extattr
Hi,
i now believe that the ENOSYS is in libattr1 which has as source
attr-2.4.46 with file libattr/syscalls.c .
(There seems to be a transition underways to move this part
into eglibc.)
If this assessment is correct then currently kfreebsd aims for
ACL implemented on top of xattr (libattr1, attr).
To follow this path, one would have to examine whether FreeBSD ACLs
are implemented on top of extattr in a similar way. If so, then one
could try to implement xattr on top of extattr. Further one would
have to examine the functions from FreeBSD which convert the
internal attribute representation of ACL from and to the public text
representation as of setfacl(1). The ones in libacl would have to
be made compatible to that internal FreeBSD ACL format.
If the ACL doings of FreeBSD deviate too much from this model,
then one would have to implement FreeBSD ACL habits in libacl.
(I.e. exploit https://svnweb.freebsd.org/base/head/lib/libc/posix1e/ )
In summary, there seems to be quite some work waiting.
I will hardly start it myself but would be willing to help
such an endeavor.
-------------------------------------------------------------
Steven Chamberlain wrote:
> https://sources.debian.net/src/acl/
> ENOSYS is coming from either libacl
> or from a stub (unimplemented) function in libc.
Looks like the (non-GNU) upstream
http://git.savannah.gnu.org/cgit/acl.git/tree/libacl
Very different from FreeBSD and using xattr functions as
backend for storing info. FreeBSD offers a different API
for extented file attributes.
The implementation of xattr is in
https://packages.debian.org/wheezy/libattr1
http://http.debian.net/debian/pool/main/a/attr/attr_2.4.46.orig.tar.bz2
In there, the file
attr-2.4.46/libattr/syscalls.c
has an architecture-dependend list of system call numbers.
I wrote a small test program with these "#if" clauses.
My "amd64" Jessie host system matches "__x86_64__".
My "kfreebsd-i386" does not match any of them.
The git repository differs in this aspect.
http://git.savannah.gnu.org/cgit/attr.git/tree/
There the file libattr/syscalls.c points to libc.
So possibly my current insight gets devalued by the
next version upgrade.
Whatever, this explains why i cannot spot anything by
fgrep -r acl_ eglibc-2.13
in unpacked
http://http.debian.net/debian/pool/main/e/eglibc/eglibc_2.13.orig.tar.gz
I came to that tarball by
https://packages.debian.org/search?mode=exactfilename&suite=wheezy§ion=all&arch=any&searchon=contents&keywords=libc.so
https://packages.debian.org/wheezy/libc0.1-dev
It does have xattr functions. But nothing that would match
FreeBSD in eglibc-2.13/sysdeps .
I assume that kfreebsd would end up in stubs like
eglibc-2.13/misc/fsetxattr.c
which has
int
fsetxattr (int __fd, const char *__name, const void *__value,
size_t __size, int __flags)
{
__set_errno (ENOSYS);
return -1;
}
-------------------------------------------------------------
Have a nice day :)
Thomas
Reply to: