mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
f3b91b7f11
Replace afero.TempFile (which uses os.CreateTemp with mode 0600) with a custom createTempFile that uses OpenFile with mode 0666. This lets the kernel apply the process umask, matching the default behavior of os.Create. New files now get ~0644 (with standard umask) instead of 0600. Extract atomicWrite(ctx, path, mode, haveMode, reader) to share the entire temp-file lifecycle between writeFile and editFile.