The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7983
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === -bash-4.2$ make go get -t -v -d ./... CC=gcc go install -v -tags "libsqlite3" ./... gopkg.in/lxc/go-lxc.v2 github.com/canonical/go-dqlite/internal/bindings github.com/lxc/lxd/shared/idmap # github.com/lxc/lxd/shared/idmap shared/idmap/shift_linux.go:32:35: fatal error: linux/posix_acl_xattr.h: No such file or directory #include <linux/posix_acl_xattr.h> ^ compilation terminated. # github.com/canonical/go-dqlite/internal/bindings /bin/ld: cannot find -lraft /bin/ld: cannot find -ldqlite collect2: error: ld returned 1 exit status make: *** [default] Error 2 -bash-4.2$ # Steps to reproduce 1. try to build on an older kernel system (e.g., rhel7) Closes #7982. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From a5e40f8791afb55d91984a9934c895e261aaa349 Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Mon, 5 Oct 2020 18:25:20 +0200 Subject: [PATCH] shift_linux: vendor posix_acl_xattr.h -bash-4.2$ make go get -t -v -d ./... CC=gcc go install -v -tags "libsqlite3" ./... gopkg.in/lxc/go-lxc.v2 github.com/canonical/go-dqlite/internal/bindings github.com/lxc/lxd/shared/idmap # github.com/lxc/lxd/shared/idmap shared/idmap/shift_linux.go:32:35: fatal error: linux/posix_acl_xattr.h: No such file or directory #include <linux/posix_acl_xattr.h> ^ compilation terminated. # github.com/canonical/go-dqlite/internal/bindings /bin/ld: cannot find -lraft /bin/ld: cannot find -ldqlite collect2: error: ld returned 1 exit status make: *** [default] Error 2 -bash-4.2$ # Steps to reproduce 1. try to build on an older kernel system (e.g., rhel7) Closes #7982. Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- lxd/include/lxd_posix_acl_xattr.h | 39 +++++++++++++++++++++++++++++++ shared/idmap/shift_linux.go | 8 +++---- 2 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 lxd/include/lxd_posix_acl_xattr.h diff --git a/lxd/include/lxd_posix_acl_xattr.h b/lxd/include/lxd_posix_acl_xattr.h new file mode 100644 index 0000000000..506380f0b9 --- /dev/null +++ b/lxd/include/lxd_posix_acl_xattr.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */ +/* + * Copyright (C) 2002 Andreas Gruenbacher <a.gruenbac...@computer.org> + * Copyright (C) 2016 Red Hat, Inc. + * + * This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + */ + +#ifndef __UAPI_POSIX_ACL_XATTR_H +#define __UAPI_POSIX_ACL_XATTR_H + +#include <linux/types.h> + +/* Supported ACL a_version fields */ +#define POSIX_ACL_XATTR_VERSION 0x0002 + +/* An undefined entry e_id value */ +#define ACL_UNDEFINED_ID (-1) + +struct posix_acl_xattr_entry { + __le16 e_tag; + __le16 e_perm; + __le32 e_id; +}; + +struct posix_acl_xattr_header { + __le32 a_version; +}; + +#endif /* __UAPI_POSIX_ACL_XATTR_H */ diff --git a/shared/idmap/shift_linux.go b/shared/idmap/shift_linux.go index 05fdd6cd6f..c61f534ca6 100644 --- a/shared/idmap/shift_linux.go +++ b/shared/idmap/shift_linux.go @@ -29,7 +29,6 @@ import ( #include <errno.h> #include <fcntl.h> #include <limits.h> -#include <linux/posix_acl_xattr.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -37,13 +36,14 @@ import ( #include <unistd.h> #include <sys/stat.h> #include <sys/types.h> -#include <sys/acl.h> + +#include "../../lxd/include/lxd_posix_acl_xattr.h" +#include "../../lxd/include/memory_utils.h" // Needs to be included at the end +#include <sys/acl.h> #include <sys/xattr.h> -#include "../../lxd/include/memory_utils.h" - #ifndef VFS_CAP_REVISION_1 #define VFS_CAP_REVISION_1 0x01000000 #endif
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel