From: Stefan Berger Date: Mon, 22 Aug 2022 18:11:47 +0000 (-0400) Subject: swtpm: Check for defined __SNR_MOUNT_setattr and __NR_mount_setattr X-Git-Tag: v0.8.0~34 X-Git-Url: https://git.proxmox.com/?p=swtpm.git;a=commitdiff_plain;h=df494163fa42fc1c44721b9612a2899b6213378e swtpm: Check for defined __SNR_MOUNT_setattr and __NR_mount_setattr Address the following compilation error on Debian: In file included from /usr/include/seccomp.h:821, from seccomp_profile.c:44: seccomp_profile.c: In function 'create_seccomp_profile': seccomp_profile.c:115:9: error: '__NR_mount_setattr' undeclared (first use in this function) 115 | SCMP_SYS(mount_setattr), | ^~~~~~~~ seccomp_profile.c:115:9: note: each undeclared identifier is reported only once for each function it appears in seccomp_profile.c:172:9: error: '__NR_quotactl_fd' undeclared (first use in this function) 172 | SCMP_SYS(quotactl_fd), | ^~~~~~~~ We need to do this since they are defined like this: #define __SNR_mount_setattr __NR_mount_setattr #define __SNR_quotactl_fd __NR_quotactl_fd Signed-off-by: Stefan Berger --- diff --git a/src/swtpm/seccomp_profile.c b/src/swtpm/seccomp_profile.c index 903ee27..7299b89 100644 --- a/src/swtpm/seccomp_profile.c +++ b/src/swtpm/seccomp_profile.c @@ -111,7 +111,7 @@ int create_seccomp_profile(bool cusetpm, unsigned int action) #ifdef __SNR_move_mount SCMP_SYS(move_mount), #endif -#ifdef __SNR_mount_setattr +#if defined(__SNR_mount_setattr) && defined(__NR_mount_setattr) SCMP_SYS(mount_setattr), #endif SCMP_SYS(umount2), @@ -168,7 +168,7 @@ int create_seccomp_profile(bool cusetpm, unsigned int action) SCMP_SYS(sethostname), SCMP_SYS(setdomainname), SCMP_SYS(quotactl), -#ifdef __SNR_quotactl_fd +#if defined(__SNR_quotactl_fd) && defined(__NR_quotactl_fd) SCMP_SYS(quotactl_fd), #endif SCMP_SYS(readahead),