Commit 3f61940
committed
src: allow CAP_NET_BIND_SERVICE in SafeGetenv
This commit updates SafeGetenv to check if the current process has the
effective capability cap_net_bind_service set, and if so allows
environment variables to be read.
The motivation for this change is a use-case where Node is run in a
container, and the is a requirement to be able to listen to ports
below 1024. This is done by setting the capability of
cap_net_bind_service. In addition there is a need to set the
environment variable `NODE_EXTRA_CA_CERTS`. But currently this
environment variable will not be read when the capability has been set
on the executable.
PR-URL: #37727
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>1 parent 8e84d56 commit 3f61940Copy full SHA for 3f61940
File tree
Expand file treeCollapse file tree
1 file changed
+36
-1
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
1 file changed
+36
-1
lines changedOpen diff view settings
Collapse file
+36-1Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
11 | 11 | |
12 | 12 | |
13 | 13 | |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
14 | 18 | |
15 | 19 | |
16 | 20 | |
| ||
33 | 37 | |
34 | 38 | |
35 | 39 | |
36 | | - |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
37 | 67 | |
38 | 68 | |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
39 | 73 | |
40 | 74 | |
| 75 | + |
41 | 76 | |
42 | 77 | |
43 | 78 | |
|
0 commit comments