Ok but: union { trivial_NFSv4_xattr_buf xattr; char ch[sizeof (trivial_NFSv4_xattr_buf)]; } stackbuf;
char *listbuf = stackbuf.ch; ssize_t listbufsize = sizeof stackbuf.ch; char *heapbuf = NULL; ssize_t listsize; /* Use listxattr first, as this means just one syscall in the typical case where the file lacks an ACL. Try stackbuf first, falling back on malloc if stackbuf is too small. */ while ((listsize = listxattr (name, listbuf, listbufsize)) < 0 You feed listxattr() with a buffer sized like trivial_NFS4_attr_buf - that just does not seem to be correct right? That trivial_NFS4_attr_buf serves smth completely different. -----Original Message----- From: Paul Eggert <egg...@cs.ucla.edu> Sent: Montag, 15. Mai 2023 19:17 To: Ondrej Valousek <ondrej.valousek...@renesas.com> Cc: Gnulib bugs <bug-gnulib@gnu.org> Subject: Re: [PATCH] fix NFSv4 acl detection on F39 On 2023-05-15 09:43, Ondrej Valousek wrote: > you are not checking for presence of this string in the output of the > listxattr() - unless I am blind. Don't these lines of file-has-acl.c check for that? > bool nfsv4_acl > = 0 < listsize && have_xattr (XATTR_NAME_NFSV4_ACL, listbuf, > listsize);