SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
546 stars 36 forks source link

Permissions on Created File #214

Closed thekendog closed 2 years ago

thekendog commented 4 years ago

Whenever I create a file it assigns 666 permissions. It should be 644.

thekendog commented 4 years ago

Edit: Found the newFileMode setting in another issue on here. It's not in the GUI settings or documentation.

SchoofsKelvin commented 4 years ago

Improvement to #39

Not a huge priority of adding a Settings UI entry for this, but I'll keep it in mind.

The 666 seems a bit weird. I can't check the code right now, but the default umask shouldn't be that.

MostHated commented 2 years ago

Due to the fact that I have been making world-writable files left and right for quite some time now and didn't realize it, I think that at a minimum, it should be in the UI as up to right now, it seems the default is still 666.

SchoofsKelvin commented 2 years ago

Just added this (af76438, b904fb9) to the extension. The default permission is now 0o664 (rw-rw-r--), while the UI now also has an easy table-like config field for newFileMode: Screenshot of new field

Mind that I stuck with the default for non-root users (0o664), even for the root user (where the usual default is 0o644) as it is difficult to detect the current user within SFTP. Besides that, the terminal is (still) unaffected by newFileMode, it only affects files created through the SFTP interface, i.e. by VS Code, such as the Explorer view.

These changes will be released in the next version after the current v1.24.0, which I'll probably release later during the weekend.