Skip to content

Remove initCommand from DocumentPtySession and PtyProcess#26837

Merged
ravicious merged 1 commit intomasterfrom
ravicious/init-command
May 26, 2023
Merged

Remove initCommand from DocumentPtySession and PtyProcess#26837
ravicious merged 1 commit intomasterfrom
ravicious/init-command

Conversation

@ravicious
Copy link
Copy Markdown
Member

initCommand was our (admittedly hacky) solution to opening a shell session and executing a specific command when it starts. It has been used for two features which are no longer existing:

  • Launching an arbitrary command from the command bar.
    • The command bar was replaced with the search bar in v13.
  • Opening a new terminal tab and running a gateway CLI client.

Since it's no longer used, we can remove it. Documents are persisted to disk, so we have to be careful about modifying their fields. However, removing fields is generally safe. On top that, initCommand was removed from the state as soon as the tab got opened. If by any chance there's a user with a doc with initCommand in the state (for example, we failed to spawn the PTY and they closed the app), this document will become a regular terminal tab.

It doesn't get rid of the problems raised in TEL-Q322-15 (see the description of #26057), but it does get rid of an attack vector.

@github-actions github-actions Bot requested review from rudream and ryanclark May 24, 2023 14:40
@ravicious ravicious requested review from gzdunek and removed request for rudream May 24, 2023 14:40
@ravicious ravicious added this pull request to the merge queue May 26, 2023
Merged via the queue into master with commit b3e7a30 May 26, 2023
@ravicious ravicious deleted the ravicious/init-command branch May 26, 2023 09:43
@public-teleport-github-review-bot
Copy link
Copy Markdown

@ravicious See the table below for backport results.

Branch Result
branch/v13 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants