Skip to content

Commit c4e16cf

Browse files
richardddricharddavisontrivikr
authored
Explicitly check for process.geteuid from global scope (#916)
Co-authored-by: Davison <[email protected]> Co-authored-by: Trivikram Kamat <[email protected]>
1 parent 12b06d3 commit c4e16cf

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changeset/many-plums-agree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@smithy/shared-ini-file-loader": patch
3+
---
4+
5+
Explicitly check for process.geteuid from global scope

packages/shared-ini-file-loader/src/getHomeDir.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { homedir } from "os";
22
import { sep } from "path";
3-
import { geteuid } from "process";
43

54
const homeDirCache: Record<string, string> = {};
65

76
const getHomeDirCacheKey = (): string => {
87
// geteuid is only available on POSIX platforms (i.e. not Windows or Android).
9-
if (geteuid) {
10-
return `${geteuid()}`;
8+
if (process && process.geteuid) {
9+
return `${process.geteuid()}`;
1110
}
1211
return "DEFAULT";
1312
};

0 commit comments

Comments
 (0)