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 1010
1111#if !defined(_MSC_VER)
1212#include < unistd.h> // setuid, getuid
13- #include < sys/capability.h>
13+ #include < linux/capability.h>
14+ #include < sys/syscall.h>
1415#endif
1516
1617namespace node {
@@ -44,7 +45,7 @@ bool HasCapability(int capability) {
4445 };
4546 struct __user_cap_data_struct cap_data;
4647
47- if (capget ( &cap_header_data, &cap_data) == -1 ) {
48+ if (syscall (SYS_capget, &cap_header_data, &cap_data) == -1 ) {
4849 return false ;
4950 }
5051
@@ -58,8 +59,8 @@ bool HasCapability(int capability) {
5859// then lookup will not be allowed.
5960bool SafeGetenv (const char * key, std::string* text, Environment* env) {
6061#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 ()))
6364 goto fail;
6465#endif
6566
You can’t perform that action at this time.
0 commit comments