|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
From dff6c6295b1cb09d6da8ab054e66059e43247ab1 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
Date: Wed, 3 Apr 2019 12:36:03 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
Subject: [PATCH 10/11] test-seccomp: fix compilation on arm64
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
It has no open().
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
src/test/test-seccomp.c | 8 +++++++-
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
index 8efbecbeff..9b7307cf39 100644
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
--- a/src/test/test-seccomp.c
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+++ b/src/test/test-seccomp.c
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
@@ -7,6 +7,7 @@
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
#include <sys/mman.h>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
#include <sys/personality.h>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
#include <sys/shm.h>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+#include <sys/syscall.h>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
#include <sys/types.h>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
#include <unistd.h>
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
@@ -763,9 +764,14 @@ static void test_lock_personality(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
static int real_open(const char *path, int flags, mode_t mode) {
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
/* glibc internally calls openat() when open() is requested. Let's hence define our own wrapper for
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
- * testing purposes that calls the real syscall. */
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+ * testing purposes that calls the real syscall, on architectures where SYS_open is defined. On
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+ * other architectures, let's just fall back to the glibc call. */
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+#ifdef SYS_open
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
return (int) syscall(SYS_open, path, flags, mode);
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+#else
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+ return open(path, flags, mode);
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
+#endif
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
|
|
Zbigniew Jędrzejewski-Szmek |
5fb495 |
static void test_restrict_suid_sgid(void) {
|