-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/go: no respect to group sticky bit #18878
Comments
This is happening because the go tool builds the binary elsewhere, in a temporary directory, and then moves it into place. |
Of course, and I assume it uses I'm haven't looked into the code, but in |
Yes, the code to change is |
CL https://golang.org/cl/36797 mentions this issue. |
CL https://golang.org/cl/40912 mentions this issue. |
Use our own tempdir, to avoid having to Init (and somehow teardown) Builder. This way we don't leave behind any temp files. Also, don't create a hardcoded path inside a testcase. Followup to #18878. Fixes #19449. Change-Id: Ieb1ebeab24ae8a74a6fa058d9c23f72b3fc1c444 Reviewed-on: https://go-review.googlesource.com/40912 Reviewed-by: Ian Lance Taylor <iant@golang.org>
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?What did you do?
Notice the group sticky bit:
$ ls -la drwxrwsr-x 7 user www-data 4096 Feb 1 10:33 . drwxr-xr-x 5 root root 4096 Feb 1 10:55 .. drwxrwsr-x 2 user www-data 4096 Dec 2 17:02 bin drwxrwsr-x 8 user www-data 4096 Feb 1 10:31 .git -rw-rw-r-- 1 user www-data 169 Dec 8 15:25 .gitignore drwxrwsr-x 3 user www-data 4096 Jan 17 15:03 src
Build:
What did you expect to see?
Produced binary respects group sticky bit, and correct group is set:
$ ls -la drwxrwsr-x 7 user www-data 4096 Feb 1 10:33 . drwxr-xr-x 5 root root 4096 Feb 1 10:55 .. drwxrwsr-x 2 user www-data 4096 Dec 2 17:02 bin drwxrwsr-x 8 user www-data 4096 Feb 1 10:31 .git -rw-rw-r-- 1 user www-data 169 Dec 8 15:25 .gitignore -rwxrwxr-x 1 user www-data 14693816 Feb 1 10:58 pkg_name drwxrwsr-x 3 user www-data 4096 Jan 17 15:03 src
What did you see instead?
Group sticky bit is not respected:
$ ls -la drwxrwsr-x 7 user www-data 4096 Feb 1 10:33 . drwxr-xr-x 5 root root 4096 Feb 1 10:55 .. drwxrwsr-x 2 user www-data 4096 Dec 2 17:02 bin drwxrwsr-x 8 user www-data 4096 Feb 1 10:31 .git -rw-rw-r-- 1 user www-data 169 Dec 8 15:25 .gitignore -rwxrwxr-x 1 user user 14693816 Feb 1 10:58 pkg_name drwxrwsr-x 3 user www-data 4096 Jan 17 15:03 src
The text was updated successfully, but these errors were encountered: