Skip to content

Commit c7fc7b9

Browse files
fix: create directory before writing coder connect network info file (coder#17628)
The regular network info file creation code also calls `Mkdirall`. Wasn't picked up in manual testing as I already had the `/net` folder in my VSCode. Wasn't picked up in automated testing because we use an in-memory FS, which for some reason does this implicitly.
1 parent 4de7661 commit c7fc7b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/ssh.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,10 @@ func writeCoderConnectNetInfo(ctx context.Context, networkInfoDir string) error
15421542
if !ok {
15431543
fs = afero.NewOsFs()
15441544
}
1545+
if err := fs.MkdirAll(networkInfoDir, 0o700); err != nil {
1546+
return xerrors.Errorf("mkdir: %w", err)
1547+
}
1548+
15451549
// The VS Code extension obtains the PID of the SSH process to
15461550
// find the log file associated with a SSH session.
15471551
//

0 commit comments

Comments
 (0)