You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: drop privileges to original user when running with sudo
When jail is executed with sudo, the subprocess now runs as the original
user instead of root. This is a minimal implementation that only handles
privilege dropping without environment manipulation.
Changes:
- Linux: Check SUDO_UID/SUDO_GID and use syscall.Credential to drop privileges
- macOS: Same privilege dropping logic, preserve original group behavior for non-sudo
- Added proper error handling and debug logging
Now 'sudo jail -- whoami' returns the original username instead of 'root'.
Co-authored-by: f0ssel <[email protected]>
0 commit comments