Skip to main content
Tweak problem statment (thanks Stéphane)
Source Link
user56041
user56041

I've been following a thread on OSS-Security called Security risk of vim swap files. It looks like Vim and Emacs caught a CVE because the editors created temp files in the wrong place with too many file permissions.

I know Posix has a umask function to set the mask, but I don't really see a function to query it. I'm also aware some shells support UMASK, but I did not see it mentioned in the IEEE pages I visited. (Maybe I missed it; also see How to check umask for all users under Linux?).

How can programs query the umask value in a portable way?

I've been following a thread on OSS-Security called Security risk of vim swap files. It looks like Vim and Emacs caught a CVE because the editors created temp files with too many file permissions.

I know Posix has a umask function to set the mask, but I don't really see a function to query it. I'm also aware some shells support UMASK, but I did not see it mentioned in the IEEE pages I visited. (Maybe I missed it; also see How to check umask for all users under Linux?).

How can programs query the umask value in a portable way?

I've been following a thread on OSS-Security called Security risk of vim swap files. It looks like Vim and Emacs caught a CVE because the editors created temp files in the wrong place with too many file permissions.

I know Posix has a umask function to set the mask, but I don't really see a function to query it. I'm also aware some shells support UMASK, but I did not see it mentioned in the IEEE pages I visited. (Maybe I missed it; also see How to check umask for all users under Linux?).

How can programs query the umask value in a portable way?

Source Link
user56041
user56041

Portable way to query umask for new file permissions?

I've been following a thread on OSS-Security called Security risk of vim swap files. It looks like Vim and Emacs caught a CVE because the editors created temp files with too many file permissions.

I know Posix has a umask function to set the mask, but I don't really see a function to query it. I'm also aware some shells support UMASK, but I did not see it mentioned in the IEEE pages I visited. (Maybe I missed it; also see How to check umask for all users under Linux?).

How can programs query the umask value in a portable way?