Read inherited Idunn descriptors directly
This commit is contained in:
parent
71aa615d93
commit
5697802dbf
2 changed files with 3 additions and 4 deletions
|
|
@ -605,8 +605,7 @@ export function systemdListenPidMatches(listenPid: string | undefined, processPi
|
|||
}
|
||||
|
||||
function readDescriptor(descriptor: number): Buffer {
|
||||
const fdPath = `/proc/self/fd/${descriptor}`;
|
||||
return fs.readFileSync(fdPath);
|
||||
return fs.readFileSync(descriptor);
|
||||
}
|
||||
|
||||
function privateKeyFromSeed(seed: Uint8Array): crypto.KeyObject {
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ test("opens Idunn's machine-bound identity and signs the exact Expected incarnat
|
|||
process.env.LISTEN_FDNAMES = "gamecult-idunn-runtime-activation-key:gamecult-runtime-presence-identity";
|
||||
const realReadFileSync = fs.readFileSync.bind(fs);
|
||||
mock.method(fs, "readFileSync", (filePath: fs.PathOrFileDescriptor, ...args: unknown[]) => {
|
||||
if (filePath === "/proc/self/fd/3") return activationSeed;
|
||||
if (filePath === "/proc/self/fd/4") return providerCredential;
|
||||
if (filePath === 3) return activationSeed;
|
||||
if (filePath === 4) return providerCredential;
|
||||
if (filePath === "/etc/machine-id") return machineId;
|
||||
return realReadFileSync(filePath as never, ...args as never[]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue