]> Cypherpunks repositories - gostls13.git/commitdiff
archive/tar: make test pass on setgid dirs
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 21 Feb 2013 22:00:03 +0000 (14:00 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 21 Feb 2013 22:00:03 +0000 (14:00 -0800)
Fixes #4867

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7382045

src/pkg/archive/tar/tar_test.go

index 7d88716de8104fff80ca9de1d8052a87bc79dc15..b55cc2c613b97532db66183b05ea7c41e752382b 100644 (file)
@@ -48,7 +48,8 @@ func TestFileInfoHeaderDir(t *testing.T) {
        if g, e := h.Name, "testdata/"; g != e {
                t.Errorf("Name = %q; want %q", g, e)
        }
-       if g, e := h.Mode, int64(fi.Mode().Perm())|c_ISDIR; g != e {
+       const setsid = 02000 // see golang.org/issue/4867
+       if g, e := h.Mode&^setsid, int64(fi.Mode().Perm())|c_ISDIR; g != e {
                t.Errorf("Mode = %#o; want %#o", g, e)
        }
        if g, e := h.Size, int64(0); g != e {