fix(env_passthrough): tolerate an unresolvable home when keying the allowlist cache
_make_run_env runs with a stripped environ on Windows children; hermes_home_key() raises RuntimeError there (no HOME/USERPROFILE). Fall back to an unkeyed slot instead of failing the sandbox env build.
This commit is contained in:
@@ -86,7 +86,11 @@ def _load_config_passthrough() -> frozenset[str]:
|
||||
credentials into sandbox children either (GHSA-rhgp-j443-p4rf)."""
|
||||
from hermes_constants import hermes_home_key
|
||||
|
||||
home_key = hermes_home_key()
|
||||
try:
|
||||
home_key = hermes_home_key()
|
||||
except (RuntimeError, OSError):
|
||||
# No resolvable home (stripped environ in a sandbox child): nothing to scope by.
|
||||
home_key = ""
|
||||
cached = _config_passthrough.get(home_key)
|
||||
if cached is not None:
|
||||
return cached
|
||||
|
||||
Reference in New Issue
Block a user