Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some warnings about environment variables when running commands #23

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/channel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@

if ret != SSH_OK
err = get_error(session)
throw(LibSSHException("Error from lib.ssh_channel_request_env(), could not set environment variable: '$(env_var)'"))
throw(LibSSHException("Error from lib.ssh_channel_request_env(), could not set environment variable '$(env_var)': '$(err)'. Hint: check that the server has an `AcceptEnv` config that allows setting this variable, otherwise it will fail."))

Check warning on line 540 in src/channel.jl

View check run for this annotation

Codecov / codecov/patch

src/channel.jl#L540

Added line #L540 was not covered by tests
end
end
end
Expand Down Expand Up @@ -580,6 +580,10 @@
- Pipelined commands (use a regular pipe like `foo | bar` instead).
- Setting the directory to execute the command in.

!!! note
Setting environment variables is supported, but will fail if the server
forbids setting them.

# Throws
- [`SshProcessFailedException`](@ref): if the command fails and `ignorestatus()`
wasn't used.
Expand Down