]> Cypherpunks repositories - gostls13.git/commit
os: respect umask in Mkdir and OpenFile on BSD systems when perm has ModeSticky set
authorYuval Pavel Zholkover <paulzhol@gmail.com>
Sat, 16 Dec 2017 17:06:10 +0000 (19:06 +0200)
committerIan Lance Taylor <iant@golang.org>
Fri, 23 Feb 2018 22:37:55 +0000 (22:37 +0000)
commita5e8e2d99815346cdff61905237056e0095c75ea
treef9e8cd0aac93fa9c007d15b0e500c1557c4a2b6c
parent788464724cb061198bab1fb4f7885eb46d38f847
os: respect umask in Mkdir and OpenFile on BSD systems when perm has ModeSticky set

Instead of calling Chmod directly on perm, stat the created file/dir to extract the
actual permission bits which can be different from perm due to umask.

Fixes #23120.

Change-Id: I3e70032451fc254bf48ce9627e98988f84af8d91
Reviewed-on: https://go-review.googlesource.com/84477
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/os/file.go
src/os/file_unix.go
src/os/os_unix_test.go