mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Improved the capabilities feature detection.
Previously included file sys/capability.h mentioned in capset(2) man page, belongs to the libcap-dev package, which may not be installed on some Linux systems when compiling nginx. This prevented the capabilities feature from being detected and compiled on that systems. Now linux/capability.h system header is included instead. Since capset() declaration is located in sys/capability.h, now capset() syscall is defined explicitly in code using the SYS_capset constant, similarly to other Linux-specific features in nginx.
This commit is contained in:
@@ -174,7 +174,8 @@ ngx_feature_test="if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0) == -1) return 1"
|
||||
ngx_feature="capabilities"
|
||||
ngx_feature_name="NGX_HAVE_CAPABILITIES"
|
||||
ngx_feature_run=no
|
||||
ngx_feature_incs="#include <sys/capability.h>"
|
||||
ngx_feature_incs="#include <linux/capability.h>
|
||||
#include <sys/syscall.h>"
|
||||
ngx_feature_path=
|
||||
ngx_feature_libs=
|
||||
ngx_feature_test="struct __user_cap_data_struct data;
|
||||
@@ -184,7 +185,7 @@ ngx_feature_test="struct __user_cap_data_struct data;
|
||||
data.effective = CAP_TO_MASK(CAP_NET_RAW);
|
||||
data.permitted = 0;
|
||||
|
||||
(void) capset(&header, &data)"
|
||||
(void) SYS_capset"
|
||||
. auto/feature
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user