1 --- a/shared/idmap/shift_linux.go 2022-03-11 04:52:20.000000000 +0100
2 +++ b/shared/idmap/shift_linux.go 2022-11-22 09:18:23.513333279 +0100
4 static int create_detached_idmapped_mount(const char *path)
6 __do_close int fd_tree = -EBADF, fd_userns = -EBADF;
7 - struct lxc_mount_attr attr = {
8 + struct mount_attr attr = {
9 .attr_set = MOUNT_ATTR_IDMAP,
10 .propagation = MS_SLAVE,
12 --- a/lxd/include/syscall_wrappers.h 2022-11-22 09:10:03.053333289 +0100
13 +++ b/lxd/include/syscall_wrappers.h 2022-11-22 09:20:55.586666611 +0100
15 #include <sys/syscall.h>
16 #include <sys/types.h>
19 +#include <sys/mount.h>
20 #include "syscall_numbers.h"
22 #ifndef CLOSE_RANGE_UNSHARE
24 return syscall(__NR_close_range, fd, max_fd, flags);
27 -static inline int open_tree(int dfd, const char *filename, unsigned int flags)
28 +static inline int xopen_tree(int dfd, const char *filename, unsigned int flags)
30 return syscall(__NR_open_tree, dfd, filename, flags);
36 -static inline int mount_setattr(int dfd, const char *path, unsigned int flags,
37 +static inline int xmount_setattr(int dfd, const char *path, unsigned int flags,
38 struct lxc_mount_attr *attr, size_t size)
40 return syscall(__NR_mount_setattr, dfd, path, flags, attr, size);
43 -static inline int move_mount(int from_dfd, const char *from_pathname, int to_dfd,
44 +static inline int xmove_mount(int from_dfd, const char *from_pathname, int to_dfd,
45 const char *to_pathname, unsigned int flags)
47 return syscall(__NR_move_mount, from_dfd, from_pathname, to_dfd,
48 --- a/lxd/main_checkfeature.go 2022-03-11 04:52:20.000000000 +0100
49 +++ b/lxd/main_checkfeature.go 2022-11-22 10:54:47.506666609 +0100
51 static bool kernel_supports_idmapped_mounts(void)
53 __do_close int fd_devnull = -EBADF, fd_tree = -EBADF;
54 - struct lxc_mount_attr attr = {
55 + struct mount_attr attr = {
56 .attr_set = MOUNT_ATTR_IDMAP,
59 --- a/lxd/main_nsexec.go 2022-03-11 04:52:20.000000000 +0100
60 +++ b/lxd/main_nsexec.go 2022-11-22 10:59:03.776666604 +0100
62 int mount_detach_idmap(const char *path, int fd_userns)
64 __do_close int fd_tree = -EBADF;
65 - struct lxc_mount_attr attr = {
66 + struct mount_attr attr = {
67 .attr_set = MOUNT_ATTR_IDMAP,