Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 842195

Summary: net-fs/cifs-utils-6.13-r1 - In function 'getcifsacl': getcifsacl.c:429:24: error: 'XATTR_SIZE_MAX' undeclared (first use in this function) (on musl))
Product: Gentoo Linux Reporter: ernsteiswuerfel <erhard_f>
Component: Current packagesAssignee: Gentoo's SAMBA Team <samba>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://marc.info/?l=linux-cifs&m=165604639613381&w=2
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
build.log
musl patch for net-fs/cifs-utils-6.13

Description ernsteiswuerfel archtester 2022-05-02 14:34:20 UTC
Created attachment 776096 [details]
emerge --info

As cifs-utils-6.13-r1 previously built with musl this is probably musl-1.2.3 related.

[...]
make[2]: Entering directory '/var/tmp/portage/net-fs/cifs-utils-6.13-r1/work/cifs-utils-6.13'
x86_64-gentoo-linux-musl-gcc -DHAVE_CONFIG_H -I.    -Wall -Wextra -D_FORTIFY_SOURCE=2 -fpie -pie -Wl,-z,relro,-z,now -Os -march=bdver2 -mtune=bdver2 -pipe -c -o getcifsacl.o getcifsacl.c
getcifsacl.c: In function 'print_sid':
getcifsacl.c:272:31: warning: implicit declaration of function 'le32toh' [-Wimplicit-function-declaration]
  272 |                 printf("-%u", le32toh(csid->sub_auth[i]));
      |                               ^~~~~~~
getcifsacl.c: In function 'print_ace':
getcifsacl.c:284:16: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration]
  284 |         size = le16toh(pace->size);
      |                ^~~~~~~
getcifsacl.c: In function 'getcifsacl':
getcifsacl.c:429:24: error: 'XATTR_SIZE_MAX' undeclared (first use in this function)
  429 |         if (bufsize >= XATTR_SIZE_MAX) {
      |                        ^~~~~~~~~~~~~~
getcifsacl.c:429:24: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:861: getcifsacl.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-fs/cifs-utils-6.13-r1/work/cifs-utils-6.13'
make[1]: *** [Makefile:984: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-fs/cifs-utils-6.13-r1/work/cifs-utils-6.13'
make: *** [Makefile:497: all] Error 2
 * ERROR: net-fs/cifs-utils-6.13-r1::gentoo failed (compile phase):
 *   emake failed
Comment 1 ernsteiswuerfel archtester 2022-05-02 14:34:40 UTC
Created attachment 776099 [details]
build.log
Comment 2 CFuga 2022-06-23 15:40:50 UTC
Created attachment 787112 [details, diff]
musl patch for net-fs/cifs-utils-6.13

This patch adds the following include files in getcifsacl.c and setcifsacl.c

#include <linux/limits.h>
#include <endian.h>

The first include declares XATTR_SIZE_MAX and the last include defines le32toh() and le16toh()
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-24 04:56:23 UTC
Thanks. I've been meaning to send these upstream for ages but for some reason, everyone puts it off w/ the Samba stack. Done at https://marc.info/?l=linux-cifs&m=165604639613381&w=2.
Comment 4 Larry the Git Cow gentoo-dev 2022-06-24 05:26:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa0dfbb6b2c16007e97457e3bda1ca88b85860fe

commit fa0dfbb6b2c16007e97457e3bda1ca88b85860fe
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-06-24 05:03:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-06-24 05:26:08 +0000

    net-fs/cifs-utils: fix build on musl
    
    Closes: https://bugs.gentoo.org/842195
    Acked-by: David Seifert <soap@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 net-fs/cifs-utils/cifs-utils-6.15.ebuild           |  1 +
 net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch | 80 ++++++++++++++++++++++
 2 files changed, 81 insertions(+)
Comment 5 ernsteiswuerfel archtester 2022-06-24 08:59:00 UTC
Thanks! +1 for samba.