Skip to content

Commit

Permalink
Merge branch 'freebsd-archive-diff' into freebsd-201406
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
  • Loading branch information
kzys committed Jun 29, 2014
2 parents 53d2d56 + b6590bb commit 9387eaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion archive/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func ApplyLayer(dest string, layer ArchiveReader) error {
parent := filepath.Dir(hdr.Name)
parentPath := filepath.Join(dest, parent)
if _, err := os.Lstat(parentPath); err != nil && os.IsNotExist(err) {
err = os.MkdirAll(parentPath, 0600)
err = os.MkdirAll(parentPath, 0700)
if err != nil {
return err
}
Expand Down
10 changes: 8 additions & 2 deletions graph/tags_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ const (
)

func fakeTar() (io.Reader, error) {
uid := os.Getuid()
gid := os.Getgid()

content := []byte("Hello world!\n")
buf := new(bytes.Buffer)
tw := tar.NewWriter(buf)
for _, name := range []string{"/etc/postgres/postgres.conf", "/etc/passwd", "/var/log/postgres/postgres.conf"} {
hdr := new(tar.Header)

// Leaving these fields blank requires root privileges
hdr.Uid = uid
hdr.Gid = gid

hdr.Size = int64(len(content))
hdr.Name = name
if err := tw.WriteHeader(hdr); err != nil {
Expand Down Expand Up @@ -53,8 +61,6 @@ func mkTestTagStore(root string, t *testing.T) *TagStore {
t.Fatal(err)
}
img := &image.Image{ID: testImageID}
// FIXME: this fails on Darwin with:
// tags_unit_test.go:36: mkdir /var/folders/7g/b3ydb5gx4t94ndr_cljffbt80000gq/T/docker-test569b-tRunner-075013689/vfs/dir/foo/etc/postgres: permission denied
if err := graph.Register(nil, archive, img); err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 9387eaa

Please sign in to comment.