File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
#if !defined(_MSC_VER)
12
12
#include < unistd.h> // setuid, getuid
13
- #include < sys/capability.h>
13
+ #include < linux/capability.h>
14
+ #include < sys/syscall.h>
14
15
#endif
15
16
16
17
namespace node {
@@ -44,7 +45,7 @@ bool HasCapability(int capability) {
44
45
};
45
46
struct __user_cap_data_struct cap_data;
46
47
47
- if (capget ( &cap_header_data, &cap_data) == -1 ) {
48
+ if (syscall (SYS_capget, &cap_header_data, &cap_data) == -1 ) {
48
49
return false ;
49
50
}
50
51
@@ -58,8 +59,8 @@ bool HasCapability(int capability) {
58
59
// then lookup will not be allowed.
59
60
bool SafeGetenv (const char * key, std::string* text, Environment* env) {
60
61
#if !defined(__CloudABI__) && !defined(_WIN32)
61
- if (!HasCapability (CAP_NET_BIND_SERVICE) && per_process::linux_at_secure ||
62
- getuid () != geteuid () || getgid () != getegid ())
62
+ if (!HasCapability (CAP_NET_BIND_SERVICE) && ( per_process::linux_at_secure ||
63
+ getuid () != geteuid () || getgid () != getegid ()))
63
64
goto fail;
64
65
#endif
65
66
You can’t perform that action at this time.
0 commit comments