Commit e93dd4d
process: move POSIX credential accessors into node_credentials.cc
Expose the POSIX credential accessors through
`internalBinding('credentials')` instead of setting them on the
process or bootstrapper object from C++ directly. Also moves
`SafeGetEnv` from `internalBinding('util')` to
`internalBinding('credentials')` since it's closely related to
the credentials.
In the JS land, instead of wrapping the bindings then writing
to the process object directly in main_thread_only.js, return
the wrapped functions back to bootstrap/node.js where they get
written to the process object conditionally for clarity.
Refs: #24961
PR-URL: #25066
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 37ba201 commit e93dd4dCopy full SHA for e93dd4d
File tree
Expand file treeCollapse file tree
17 files changed
+498
-474
lines changedOpen diff view settings
Filter options
- lib
- internal
- bootstrap
- modules/cjs
- process
- src
- test/parallel
Expand file treeCollapse file tree
17 files changed
+498
-474
lines changedOpen diff view settings
Collapse file
lib/internal/bootstrap/node.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js+20-6Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
27 | | - |
| 26 | + |
28 | 27 | |
29 | 28 | |
30 | 29 | |
| ||
73 | 72 | |
74 | 73 | |
75 | 74 | |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
76 | 93 | |
77 | 94 | |
78 | 95 | |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
| 96 | + |
83 | 97 | |
84 | 98 | |
85 | 99 | |
|
Collapse file
lib/internal/modules/cjs/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | | - |
| 37 | + |
38 | 38 | |
39 | 39 | |
40 | 40 | |
|
Collapse file
lib/internal/process/main_thread_only.js
Copy file name to clipboardExpand all lines: lib/internal/process/main_thread_only.js+35-38Lines changed: 35 additions & 38 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
| 32 | + |
39 | 33 | |
40 | 34 | |
41 | 35 | |
| ||
51 | 45 | |
52 | 46 | |
53 | 47 | |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
58 | 59 | |
59 | 60 | |
60 | 61 | |
| ||
64 | 65 | |
65 | 66 | |
66 | 67 | |
67 | | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
83 | | - |
| 68 | + |
84 | 69 | |
85 | | - |
| 70 | + |
86 | 71 | |
87 | 72 | |
88 | 73 | |
| ||
95 | 80 | |
96 | 81 | |
97 | 82 | |
98 | | - |
| 83 | + |
99 | 84 | |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
107 | 94 | |
108 | 95 | |
109 | 96 | |
| ||
113 | 100 | |
114 | 101 | |
115 | 102 | |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
116 | 112 | |
117 | 113 | |
118 | 114 | |
| ||
181 | 177 | |
182 | 178 | |
183 | 179 | |
184 | | - |
| 180 | + |
| 181 | + |
185 | 182 | |
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | | - |
| 24 | + |
25 | 25 | |
26 | 26 | |
27 | 27 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
352 | 352 | |
353 | 353 | |
354 | 354 | |
| 355 | + |
355 | 356 | |
356 | 357 | |
357 | 358 | |
|
Collapse file
-11Lines changed: 0 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
147 | 147 | |
148 | 148 | |
149 | 149 | |
150 | | - |
151 | | - |
152 | | - |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
157 | | - |
158 | | - |
159 | | - |
160 | | - |
161 | 150 | |
162 | 151 | |
163 | 152 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
227 | 227 | |
228 | 228 | |
229 | 229 | |
230 | | - |
| 230 | + |
231 | 231 | |
232 | 232 | |
233 | 233 | |
|
Collapse file
+13-46Lines changed: 13 additions & 46 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
100 | 100 | |
101 | 101 | |
102 | 102 | |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
| 103 | + |
109 | 104 | |
110 | 105 | |
111 | 106 | |
| ||
153 | 148 | |
154 | 149 | |
155 | 150 | |
156 | | - |
157 | | - |
158 | 151 | |
159 | 152 | |
160 | 153 | |
| ||
504 | 497 | |
505 | 498 | |
506 | 499 | |
507 | | - |
508 | | - |
509 | | - |
510 | | - |
511 | | - |
512 | | - |
513 | | - |
514 | | - |
515 | | - |
516 | | - |
517 | | - |
518 | | - |
519 | | - |
520 | | - |
521 | | - |
522 | | - |
523 | | - |
524 | | - |
525 | | - |
526 | | - |
527 | | - |
528 | 500 | |
529 | 501 | |
530 | 502 | |
| ||
1165 | 1137 | |
1166 | 1138 | |
1167 | 1139 | |
1168 | | - |
1169 | | - |
1170 | | - |
1171 | | - |
1172 | | - |
1173 | | - |
1174 | | - |
1175 | | - |
1176 | 1140 | |
1177 | 1141 | |
1178 | 1142 | |
| ||
1633 | 1597 | |
1634 | 1598 | |
1635 | 1599 | |
1636 | | - |
| 1600 | + |
| 1601 | + |
1637 | 1602 | |
1638 | 1603 | |
1639 | 1604 | |
1640 | 1605 | |
1641 | 1606 | |
1642 | 1607 | |
1643 | | - |
| 1608 | + |
| 1609 | + |
1644 | 1610 | |
1645 | 1611 | |
1646 | 1612 | |
1647 | 1613 | |
1648 | 1614 | |
1649 | | - |
| 1615 | + |
| 1616 | + |
1650 | 1617 | |
1651 | 1618 | |
1652 | 1619 | |
1653 | | - |
1654 | | - |
| 1620 | + |
| 1621 | + |
1655 | 1622 | |
1656 | 1623 | |
1657 | 1624 | |
1658 | 1625 | |
1659 | 1626 | |
1660 | | - |
| 1627 | + |
1661 | 1628 | |
1662 | 1629 | |
1663 | 1630 | |
1664 | 1631 | |
1665 | 1632 | |
1666 | | - |
| 1633 | + |
1667 | 1634 | |
1668 | 1635 | |
1669 | 1636 | |
| ||
1695 | 1662 | |
1696 | 1663 | |
1697 | 1664 | |
1698 | | - |
| 1665 | + |
1699 | 1666 | |
1700 | 1667 | |
1701 | 1668 | |
| ||
2103 | 2070 | |
2104 | 2071 | |
2105 | 2072 | |
2106 | | - |
| 2073 | + |
2107 | 2074 | |
2108 | 2075 | |
2109 | 2076 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
| 29 | + |
29 | 30 | |
30 | 31 | |
31 | 32 | |
|
0 commit comments