getcifsacl, setcifsacl: add missing <linux/limits.h> include for XATTR_SIZE_MAX
Subsystems (2)
PATCH 1/2 getcifsacl, setcifsacl: add missing <linux/limits.h> include for XATTR_SIZE_MAX
Needed to build on musl. It only works on glibc because of transitive includes (which could break in future).
Example failure:
```
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) {
| ^~~~~~~~~~~~~~
```Signed-off-by Sam James <[email protected]>
--- getcifsacl.c | 1 + setcifsacl.c | 1 + 2 files changed, 2 insertions(+)
getcifsacl.c +1 -0
@@ -34,6 +34,7 @@#include <errno.h> #include <limits.h> #include <ctype.h> +#include <linux/limits.h> #include <sys/xattr.h> #include "cifsacl.h" #include "idmap_plugin.h"
setcifsacl.c +1 -0
@@ -48,6 +48,7 @@#include <errno.h> #include <limits.h> #include <ctype.h> +#include <linux/limits.h> #include <sys/xattr.h> #include "cifsacl.h"
Signature · 1 line
2.37.2
PATCH 2/2 getcifsacl, setcifsacl: add missing <endian.h> include for le32toh
Needed to fix build on musl libc. It only works by chance on glibc because of transitive includes (which could break at any time).
Example failure:
```
getcifsacl.c: In function 'print_ace':
getcifsacl.c:284:16: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration]
284 | size = le16toh(pace->size);
| ^~~~~~~
```Signed-off-by Sam James <[email protected]>
--- getcifsacl.c | 1 + setcifsacl.c | 1 + 2 files changed, 2 insertions(+)
getcifsacl.c +1 -0
@@ -23,6 +23,7 @@#include "config.h" #endif /* HAVE_CONFIG_H */ +#include <endian.h> #include <string.h> #include <getopt.h> #include <stdint.h>
setcifsacl.c +1 -0
@@ -38,6 +38,7 @@#include "config.h" #endif /* HAVE_CONFIG_H */ +#include <endian.h> #include <string.h> #include <getopt.h> #include <stdint.h>
Signature · 1 line
2.37.2
Merged #1 and #2 into next. Thanks. Sorry, I missed these patches previously.
Best regards,
Pavel Shilovsky
пн, 15 авг. 2022 г. в 17:43, Sam James <[email protected]>:
Quoted 46 lines
Needed to build on musl. It only works on glibc because of transitive includes (which could break in future).
Example failure:
``` 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) { | ^~~~~~~~~~~~~~ ```Signed-off-by Sam James <[email protected]>--- getcifsacl.c | 1 + setcifsacl.c | 1 + 2 files changed, 2 insertions(+)getcifsacl.c +1
-0@@ -34,6 +34,7 @@#include <errno.h> #include <limits.h> #include <ctype.h> +#include <linux/limits.h> #include <sys/xattr.h> #include "cifsacl.h" #include "idmap_plugin.h" setcifsacl.c +1
-1@@ -48,6 +48,7 @@#include <errno.h> #include <limits.h> #include <ctype.h> +#include <linux/limits.h> #include <sys/xattr.h> #include "cifsacl.h" --2.37.2