-
Notifications
You must be signed in to change notification settings - Fork 526
Description
Title: Permission denied when cleaning up temporary files during user switching (non-root)
Type: Bug Report / Potential Improvement
Description:
When using Xpipe to switch from a standard user (e.g., userA) to another non-root user (e.g., userB) via the "Shell Environment" feature, the generated command fails to clean up the temporary askpass script. This is because the script is owned by the initial login user, and the target user does not have the permission to delete it.
Steps to Reproduce:
- Connect to a remote host as a standard user (e.g.,
userA). - Configure a Shell Environment to switch identity to another non-root user (e.g., userB) using
sudo -u userB. - Launch the shell.
- Observe the error message:
rm: cannot remove '/tmp/xpipe-XXXXXXXX.sh': Operation not permitted.
Expected Behavior:
The temporary script should be cleaned up silently without permission errors, or the cleanup should be handled by a process with sufficient privileges.
Actual Behavior:
Xpipe attempts to execute rm -f "/tmp/xpipe-XXXXXXXX.sh" as userB. Since the file is owned by userA and stored in /tmp (which usually has the sticky bit set), the operation fails with "Operation not permitted".
Environment:
- Xpipe Version: [20.3]
- OS: [Ubuntu 22.04]
- Shell: zsh
Suggested Fix/Workaround:
Perhaps Xpipe could:
- Wrap the cleanup command in a way that it executes as the original user.
- Redirect
stderrto/dev/nullfor thermcommand to avoid cluttering the terminal.