Commit 5b650235 authored by Alex Brainman's avatar Alex Brainman

os: include 0111 in directory file mode on windows

Fixes #4444.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6858079
parent 16a59345
......@@ -1095,3 +1095,15 @@ func TestLargeWriteToConsole(t *testing.T) {
t.Errorf("Write to os.Stderr should return %d; got %d", len(b), n)
}
}
func TestStatDirModeExec(t *testing.T) {
const mode = 0111
const path = "."
dir, err := Stat(path)
if err != nil {
t.Fatalf("Stat %q (looking for mode %#o): %s", path, mode, err)
}
if dir.Mode()&mode != mode {
t.Errorf("Stat %q: mode %#o want %#o", path, dir.Mode(), mode)
}
}
......@@ -190,7 +190,7 @@ func mkModTime(mtime syscall.Filetime) time.Time {
func mkMode(fa uint32) (m FileMode) {
if fa&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
m |= ModeDir
m |= ModeDir | 0111
}
if fa&syscall.FILE_ATTRIBUTE_READONLY != 0 {
m |= 0444
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment