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
From review of the code, I found an issue with Mkdir and OpenFile on the BSD platforms. Both functions contain an exception on these platforms when the sticky bit is set in the permissions passed:
Normally, the permissions of the created file or directory are influenced using the umask.
But these exceptions mean that, on BSD platforms, an explicit Chmod happens using the passed permissions, completely bypassing umask. This is at least inconsistent and surprising, and could be a security problem in some cases.
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
Mkdir and OpenFile permission inconsistency on BSD when using sticky bit
os: Mkdir and OpenFile permission inconsistency on BSD when using sticky bit
Dec 13, 2017
From review of the code, I found an issue with Mkdir and OpenFile on the BSD platforms. Both functions contain an exception on these platforms when the sticky bit is set in the permissions passed:
go/src/os/file.go
Lines 220 to 223 in 8776be1
go/src/os/file_unix.go
Lines 159 to 163 in 8776be1
Normally, the permissions of the created file or directory are influenced using the umask.
But these exceptions mean that, on BSD platforms, an explicit Chmod happens using the passed permissions, completely bypassing umask. This is at least inconsistent and surprising, and could be a security problem in some cases.
The text was updated successfully, but these errors were encountered: