Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3194)

Issue 102640045: code review 102640045: os: handle the sticky bit separately for *BSD (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 10 months ago by kazuyoshi
Modified:
9 years, 4 months ago
CC:
golang-codereviews, unclejack
Visibility:
Public.

Description

os: handle the sticky bit separately for *BSD open(2) and mkdir(2) won't set the sticky bit on *BSD. This behavior is mentioned on sticky(8). see also: https://github.com/dotcloud/docker/pull/6587 Fixes issue 8383.

Patch Set 1 #

Patch Set 2 : diff -r 75040398cb4e https://code.google.com/p/go/ #

Patch Set 3 : diff -r 67f9ef140028 https://code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r 14ce03206cbd https://code.google.com/p/go/ #

Patch Set 5 : diff -r 14ce03206cbd https://code.google.com/p/go/ #

Patch Set 6 : diff -r 14ce03206cbd https://code.google.com/p/go/ #

Total comments: 1

Patch Set 7 : diff -r 14ce03206cbd https://code.google.com/p/go/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -0 lines) Patch
M src/pkg/os/file.go View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/os/file_unix.go View 1 2 3 4 1 chunk +6 lines, -0 lines 1 comment Download
A src/pkg/os/sticky_bsd.go View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
A src/pkg/os/sticky_notbsd.go View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 18
unclejack
Can you review this CL, please?
9 years, 9 months ago (2014-07-11 22:07:36 UTC) #1
dfc
On 2014/07/11 22:07:36, unclejack wrote: > Can you review this CL, please? You have to ...
9 years, 9 months ago (2014-07-12 00:19:57 UTC) #2
unclejack
On 2014/07/12 00:19:57, dfc wrote: > You have to `hg mail` it first. Unfortunately, it's ...
9 years, 9 months ago (2014-07-12 08:48:36 UTC) #3
kazuyoshi
Hello golang-codereviews@googlegroups.com (cc: dave@cheney.net, golang-codereviews@googlegroups.com, unclejacksons@gmail.com), I'd like you to review this change to https://code.google.com/p/go/
9 years, 9 months ago (2014-07-14 13:27:16 UTC) #4
iant
It would be pretty easy to add a const that tells Openfile and Mkdir whether ...
9 years, 9 months ago (2014-07-14 14:45:51 UTC) #5
kazuyoshi
https://codereview.appspot.com/102640045/diff/40001/src/pkg/os/file.go File src/pkg/os/file.go (right): https://codereview.appspot.com/102640045/diff/40001/src/pkg/os/file.go#newcode207 src/pkg/os/file.go:207: // FreeBSD and NetBSD's open(2) can't handle the sticky ...
9 years, 9 months ago (2014-07-15 13:01:23 UTC) #6
kazuyoshi
On 2014/07/14 14:45:51, iant wrote: > It would be pretty easy to add a const ...
9 years, 9 months ago (2014-07-15 13:02:42 UTC) #7
iant
I suspect this will break the build on dragonfly because supportsCreateWithStickyBit won't be defined anywhere. ...
9 years, 9 months ago (2014-07-15 21:05:37 UTC) #8
kazuyoshi
Hello golang-codereviews@googlegroups.com, iant@golang.org (cc: dave@cheney.net, golang-codereviews@googlegroups.com, unclejacksons@gmail.com), Please take another look.
9 years, 9 months ago (2014-07-16 07:59:49 UTC) #9
kazuyoshi
On 2014/07/16 07:59:49, kazuyoshi wrote: > Hello mailto:golang-codereviews@googlegroups.com, mailto:iant@golang.org (cc: mailto:dave@cheney.net, > mailto:golang-codereviews@googlegroups.com, mailto:unclejacksons@gmail.com), > ...
9 years, 9 months ago (2014-07-16 08:02:23 UTC) #10
dfc
I'd like to see a bug on the issue tracker for this, golang.org/issue
9 years, 9 months ago (2014-07-17 08:35:34 UTC) #11
kazuyoshi
Hello golang-codereviews@googlegroups.com, iant@golang.org, dave@cheney.net (cc: golang-codereviews@googlegroups.com, unclejacksons@gmail.com), Please take another look.
9 years, 9 months ago (2014-07-17 14:05:37 UTC) #12
iant
The description should say exactly Fixes bug 8383. That exact test is recognized by the ...
9 years, 9 months ago (2014-07-17 21:34:58 UTC) #13
iant
https://codereview.appspot.com/102640045/diff/100001/src/pkg/os/sticky_bsd.go File src/pkg/os/sticky_bsd.go (right): https://codereview.appspot.com/102640045/diff/100001/src/pkg/os/sticky_bsd.go#newcode5 src/pkg/os/sticky_bsd.go:5: // +build freebsd netbsd openbsd darwin dragonfly The two ...
9 years, 9 months ago (2014-07-17 21:36:45 UTC) #14
kazuyoshi
Hello golang-codereviews@googlegroups.com, iant@golang.org, dave@cheney.net (cc: golang-codereviews@googlegroups.com, unclejacksons@gmail.com), Please take another look.
9 years, 9 months ago (2014-07-18 11:44:29 UTC) #15
kazuyoshi
ping? On 2014/07/18 11:44:29, kazuyoshi wrote: > Hello mailto:golang-codereviews@googlegroups.com, mailto:iant@golang.org, mailto:dave@cheney.net (cc: > mailto:golang-codereviews@googlegroups.com, mailto:unclejacksons@gmail.com), ...
9 years, 5 months ago (2014-11-01 21:22:53 UTC) #16
iant
Very sorry, I completely lost track of this. https://codereview.appspot.com/102640045/diff/120001/src/pkg/os/file_unix.go File src/pkg/os/file_unix.go (right): https://codereview.appspot.com/102640045/diff/120001/src/pkg/os/file_unix.go#newcode80 src/pkg/os/file_unix.go:80: if ...
9 years, 5 months ago (2014-11-01 22:11:30 UTC) #17
kazuyoshi
9 years, 4 months ago (2014-12-17 16:10:23 UTC) #18
On 2014/11/01 22:11:30, iant wrote:
> Very sorry, I completely lost track of this.
> 
> https://codereview.appspot.com/102640045/diff/120001/src/pkg/os/file_unix.go
> File src/pkg/os/file_unix.go (right):
> 
>
https://codereview.appspot.com/102640045/diff/120001/src/pkg/os/file_unix.go#...
> src/pkg/os/file_unix.go:80: if !supportsCreateWithStickyBit && e == nil &&
> perm&ModeSticky != 0 {
> It seems to me that this will do the wrong thing if the file is not being
> created.  We don't want to change the mode of an existing file.  Unfortunately
I
> think we need to write something like
> 
>     chmod := false
>     if !supportsCreateWithStickyBit && flag&O_CREATE != 0 && perm&ModeSticky
!=
> 0 {
>         if _, err := Stat(name); IsNotExist(err) {
>             chmod = true
>         }
>     }
> 
>     r, e := syscall.Open(...)
> 
>     if chmod && e == nil {
>         e = Chmod(name, perm)
>     }
> 
> This is very imperfect but I don't see what else we can do.

The change is submitted as https://go-review.googlesource.com/#/c/1673/ and
merged! Thanks.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b