You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--output <file> now writes to a temp file, calls file.Chmod(0644), and renames it into place. Compared with the previous os.WriteFile(path, data, 0666), this changes behavior in three ways:
umask is ignored. A user with umask 077 used to get 0600 and now gets world-readable 0644.
The existing file mode is lost. Overwriting an existing 0600 file used to keep its mode. Now it becomes 0644.
Symlinks are replaced. If <file> is a symlink, it is now replaced by a regular file instead of being written through.
Suggested fix: if the target exists, copy its mode. Otherwise apply 0666 &^ umask, matching what os.WriteFile did. You could also resolve symlinks with filepath.EvalSymlinks before choosing the temp dir and rename target.
Activity