Commit abd8cdf
committed
win, child_process: sanitize env variables
On Windows environment variables are case-insensitive. When spawning
child process certain apps can get confused if some of the variables are
duplicated.
This adds a step on Windows to normalizeSpawnArguments that removes such
duplicates, keeping only the first (in lexicographic order) entry in the
env key of options. This is partly already done for the PATH entry.
Fixes: #35129
PR-URL: #35210
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>1 parent e36ffb7 commit abd8cdfCopy full SHA for abd8cdf
File tree
Expand file treeCollapse file tree
3 files changed
+34
-1
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+34
-1
lines changedOpen diff view settings
Collapse file
+4Lines changed: 4 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
43 | 43 | |
44 | 44 | |
45 | 45 | |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
46 | 50 | |
47 | 51 | |
48 | 52 | |
|
Collapse file
+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
| 32 | + |
32 | 33 | |
33 | 34 | |
34 | 35 | |
| ||
524 | 525 | |
525 | 526 | |
526 | 527 | |
| 528 | + |
527 | 529 | |
528 | 530 | |
| 531 | + |
| 532 | + |
| 533 | + |
| 534 | + |
| 535 | + |
| 536 | + |
| 537 | + |
| 538 | + |
| 539 | + |
| 540 | + |
| 541 | + |
| 542 | + |
| 543 | + |
| 544 | + |
| 545 | + |
| 546 | + |
| 547 | + |
| 548 | + |
529 | 549 | |
530 | 550 | |
531 | 551 | |
|
Collapse file
test/parallel/test-child-process-env.js
Copy file name to clipboardExpand all lines: test/parallel/test-child-process-env.js+10-1Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
| 39 | + |
| 40 | + |
| 41 | + |
40 | 42 | |
41 | 43 | |
42 | 44 | |
| ||
65 | 67 | |
66 | 68 | |
67 | 69 | |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
68 | 77 | |
0 commit comments