Skip to content

os: OpenFile() and Mkdir() won't create a file/directory with the sticky bit on *BSD #8383

Closed
@kzys

Description

@kzys
What does 'go version' print?
go version go1.3 freebsd/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. Run http://play.golang.org/p/g8Wq83b7VF on FreeBSD

$ cat mkdir.go                                                                  
package main

import (
        "fmt"
        "os"
)

func main() {
        os.Mkdir("testdir", os.ModeSticky | 0755)
        info, _ := os.Stat("testdir")
        fmt.Printf("%o\n", info.Mode())
}
$ go run mkdir.go
20000000755
$ 

What happened?

The sticky bit was 0 on testdir.

What should have happened instead?

The sticky bit should be 1. The below is the result on Linux.

$ go run mkdir.go
20004000755
$

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions