[Gluster-devel] Problems about acl_get_file used in posix_pacl_get
Niels de Vos
ndevos at redhat.com
Fri Aug 17 09:13:57 UTC 2018
On Fri, Aug 17, 2018 at 03:04:43PM +0800, Kinglong Mee wrote:
> Hello folks,
> nfs-ganesha using the new gfapi named glfs_h_acl_set/glfs_h_acl_get,
> at xlator posix, glusterfsd calls acl_get_file/acl_set_file (libacl functions) to process xattrs.
> By default, sys_lsetxattr/sys_llistxattr/sys_lgetxattr/sys_lremovexattr are used to process xattrs.
> But, unfortunately, those two functions do syscall by getxattr/setxattr.
> I don't think that is we want.
> Is it a known problem ?
There should not be a problem for libacl to use syscalls directly. The
Gluster sources use sys_<syscall> so that there can be wrappers for the
differences between OS's. In the end, these sys_<syscall> functions will
mostly call the <syscall> with (adapted) arguments.
I do not know what problem you are facing, but I can imagine that there
is a 'getxattr' symbol in the executable image that gets called by
libacl, instead of the 'getxattr' syscall. This will likely result in
very strange behaviour, if not segfaults.
None of the Gluster libraries or xlators is allowed to expose symbols
that collide with 'standard' ones. This includes syscalls or symbols
from commonly used libraries.
To fix this, all symbols in the Gluster libraries should have a gf_
prefix. This is not commonly done for xlators, and we have had issues
with that before. All FOPs and callbacks in xlators should in general be
marked static to prevent symbol collisions.
More information about the Gluster-devel