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 <stefanb@linux.ibm.com>
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 @@
#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 @@
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),