fix(gateway): resolve sudo profile system installs

This commit is contained in:
helix4u
2026-06-14 02:20:55 -07:00
committed by Teknium
parent 1f5eef8093
commit d76a58bd15
6 changed files with 116 additions and 6 deletions
+3 -1
View File
@@ -22,6 +22,7 @@ Usage::
import json
import os
import re
import shlex
import shutil
import stat
import subprocess
@@ -421,7 +422,8 @@ def create_wrapper_script(name: str, target: Optional[str] = None) -> Optional[P
else:
wrapper_path = wrapper_dir / canon
try:
wrapper_path.write_text(f'#!/bin/sh\nexec hermes -p {profile} "$@"\n')
hermes_exe = shutil.which("hermes") or "hermes"
wrapper_path.write_text(f'#!/bin/sh\nexec {shlex.quote(hermes_exe)} -p {profile} "$@"\n')
wrapper_path.chmod(wrapper_path.stat().st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
return wrapper_path
except OSError as e: