Skip to content

Prevent early variable expansion in header command #364

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

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Feb 20, 2024

Fixes #338.

The problem was that if your header command was something like auth --url=$CODER_URL, it would get expanded as part of executing the proxy command and you end up with auth --url= since CODER_URL is not set.

We want to pass it literally to the binary so that it can then be expanded in the binary when it executes the header command, since the binary will set CODER_URL when spawning.

An alternative would be to set CODER_URL when the proxy command is spawned, but I am not sure we can as I think it would be using the current process environment (via that SSHJ library I think). Maybe there is a way to mutate the current environment, but a quick look says no.

@code-asher code-asher force-pushed the asher/escape-subcommand branch 2 times, most recently from 8fbef28 to 1dd7d2c Compare February 20, 2024 21:24
@code-asher code-asher force-pushed the asher/escape-subcommand branch from 1dd7d2c to f735e7a Compare February 20, 2024 21:49
Copy link
Contributor

Qodana Community for JVM

48 new problems were found

Inspection name Severity Problems
Unused symbol 🔶 Warning 26
Unstable API Usage 🔶 Warning 8
Incorrect string capitalization 🔶 Warning 7
Redundant qualifier name 🔶 Warning 2
Call to 'equals()' or 'hashCode()' on 'URL' object 🔶 Warning 2
Redundant semicolon 🔶 Warning 1
Redundant curly braces in string template ◽️ Notice 1
Redundant empty primary constructor ◽️ Notice 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

  1. Register at Qodana Cloud and configure the action
  2. Use GitHub Code Scanning with Qodana
  3. Host Qodana report at GitHub Pages
  4. Inspect and use qodana.sarif.json (see the Qodana SARIF format for details)

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2023.3.0
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@code-asher code-asher requested a review from johnstcn February 20, 2024 21:59
@code-asher code-asher merged commit 1da515e into main Feb 21, 2024
@code-asher code-asher deleted the asher/escape-subcommand branch February 21, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent variable expansion in header command
2 participants