SSH keys in account settings; wrappers for agents, terminal and git
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
247ddcf14a
commit
6e8e739906
16 files changed
+517
-6
No files matched your search
@@ -132,7 +132,10 @@ pub fn bwrap_args(spec: &SandboxSpec, cwd: &Path, extra_ro: &[&Path], new_sessio
|
||||
if new_session {
|
||||
push(&[&"--new-session"]);
|
||||
}
|
||||
let path = format!("{home}/.local/bin:{home}/.cargo/bin:{home}/.npm-global/bin:/usr/local/bin:/usr/bin:/bin");
|
||||
// SSH wrappers (user's keys); only when keys are set up.
|
||||
let ssh_wrapper = spec.home.join(crate::sshkeys::SANDBOX_BIN).join("ssh");
|
||||
let ssh_bin = format!("{home}/{}", crate::sshkeys::SANDBOX_BIN);
|
||||
let path = format!("{}{home}/.local/bin:{home}/.cargo/bin:{home}/.npm-global/bin:/usr/local/bin:/usr/bin:/bin", if ssh_wrapper.exists() { format!("{ssh_bin}:") } else { String::new() });
|
||||
let npm = format!("{home}/.npm-global");
|
||||
let pipx = format!("{home}/.local/pipx");
|
||||
let pipx_bin = format!("{home}/.local/bin");
|
||||
@@ -152,6 +155,10 @@ pub fn bwrap_args(spec: &SandboxSpec, cwd: &Path, extra_ro: &[&Path], new_sessio
|
||||
] {
|
||||
push(&[&"--setenv", &k, &v]);
|
||||
}
|
||||
if ssh_wrapper.exists() {
|
||||
let cmd = format!("{ssh_bin}/ssh");
|
||||
push(&[&"--setenv", &"GIT_SSH_COMMAND", &cmd]);
|
||||
}
|
||||
for (k, v) in &spec.env {
|
||||
push(&[&"--setenv", k, v]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user