From 5015b05fc495bf3e87f8decfd1617a4a399939d4 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 18 Jun 2022 15:59:12 +0200 Subject: Replaced Linux syscall macros by libc macros. User-space programs should use the SYS_*form, as documented in syscall(2). That also adds compatibility to non-Linux systems. --- auto/isolation | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'auto/isolation') diff --git a/auto/isolation b/auto/isolation index fd35f8ed..4ade6a38 100644 --- a/auto/isolation +++ b/auto/isolation @@ -21,7 +21,7 @@ nxt_feature_test="#include #include int main() { - return __NR_clone | SIGCHLD; + return SYS_clone | SIGCHLD; }" . auto/feature @@ -68,7 +68,7 @@ nxt_feature_libs= nxt_feature_test="#include int main() { - return __NR_pivot_root; + return SYS_pivot_root; }" . auto/feature -- cgit From 2c0888f69c247c82fc02ba207aa19fa00acf4b5e Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 19 Jun 2022 12:48:01 +0200 Subject: Including iff it exists. With NXT_HAVE_PIVOT_ROOT, we had issues in MacOS. Headers should normally be included unconditionally, except of course if they don't exist. This fixes part of the #737 issue on GitHub. --- auto/isolation | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'auto/isolation') diff --git a/auto/isolation b/auto/isolation index 4ade6a38..6debdc3b 100644 --- a/auto/isolation +++ b/auto/isolation @@ -73,6 +73,19 @@ nxt_feature_test="#include . auto/feature +nxt_feature="" +nxt_feature_name=NXT_HAVE_MNTENT_H +nxt_feature_run=no +nxt_feature_incs= +nxt_feature_libs= +nxt_feature_test="#include + + int main(void) { + return 0; + }" +. auto/feature + + nxt_feature="prctl(PR_SET_NO_NEW_PRIVS)" nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS0 nxt_feature_run=no -- cgit From 418bc208d08dbc4a0a3511e503c946ab6ac71c39 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 2 Aug 2022 19:39:55 +0200 Subject: Rejecting non-Linux pivot_root(2). Some non-Linux systems implement pivot_root(2), even if they don't document that. An example is MacOS: $ grepc pivot_root / 2>/dev/null .../sys/sysproto.h:3012: int pivot_root(struct proc *, struct pivot_root_args *, int *); Since the prototype of the syscall differs from that of Linux, we can't use that syscall. Let's make sure the test only detects pivot_root(2) under Linux. Also, rename the feature macro to make clear that it's only about Linux's pivot_root(2). This closes #737 issue on GitHub. --- auto/isolation | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'auto/isolation') diff --git a/auto/isolation b/auto/isolation index 6debdc3b..384f7ef1 100644 --- a/auto/isolation +++ b/auto/isolation @@ -61,11 +61,14 @@ fi nxt_feature="Linux pivot_root()" -nxt_feature_name=NXT_HAVE_PIVOT_ROOT +nxt_feature_name=NXT_HAVE_LINUX_PIVOT_ROOT nxt_feature_run=no nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include + #if !defined(__linux__) + # error + #endif int main() { return SYS_pivot_root; -- cgit