Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: MkdirAll does not return an error when insufficient access privilege exists on a path component #44848

Closed
hashibuto opened this issue Mar 7, 2021 · 1 comment

Comments

@hashibuto
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.16 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOOS="linux"
GOARCH="amd64"

What did you do?

Attempt to create a directory with insufficient permissions in /root using os.MkdirAll
Example:

os.MkdirAll("/root/mydir", os.FileMode(0700)

What did you expect to see?

I expected an error to be returned, indicating a permission issue.

What did you see instead?

A nil was returned for the error, but obviously the directory was not created.

@hashibuto hashibuto changed the title os/path: MkdirAll does not return an error when insufficient access privilege exists on a path component os: MkdirAll does not return an error when insufficient access privilege exists on a path component Mar 8, 2021
@gopherbot
Copy link

Change https://golang.org/cl/299611 mentions this issue: os: return an error in os.MkdirAll when user permissions are insufficient

@golang golang locked and limited conversation to collaborators Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants