1 Star 0 Fork 58

gnaygnil/docker

forked from src-openEuler/docker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0063-test-fix-umask-make-file-mode-failed.patch 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
gnaygnil 提交于 2020-02-13 15:36 . docker: Fixed build error and URL
From a683efcf5e14acdd40574edeaed6b293b0536867 Mon Sep 17 00:00:00 2001
From: jingrui <jingrui@huawei.com>
Date: Tue, 15 Jan 2019 10:16:25 +0800
Subject: [PATCH 063/111] test: fix umask make file mode failed
reason: set umask to 0022 make sure test added file's mode match expect.
Change-Id: I258d3d999c82041a16851f438f556746e6477ebf
Signed-off-by: jingrui <jingrui@huawei.com>
---
components/engine/internal/test/fakecontext/context.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/components/engine/internal/test/fakecontext/context.go b/components/engine/internal/test/fakecontext/context.go
index 8b11da207e..24f326b864 100644
--- a/components/engine/internal/test/fakecontext/context.go
+++ b/components/engine/internal/test/fakecontext/context.go
@@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
+ "syscall"
"github.com/docker/docker/internal/test"
"github.com/docker/docker/pkg/archive"
@@ -96,6 +97,9 @@ func (f *Fake) Add(file, content string) error {
}
func (f *Fake) addFile(file string, content []byte) error {
+ mask := syscall.Umask(0022)
+ defer syscall.Umask(mask)
+
fp := filepath.Join(f.Dir, filepath.FromSlash(file))
dirpath := filepath.Dir(fp)
if dirpath != "." {
--
2.17.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gnaygnil/docker.git
git@gitee.com:gnaygnil/docker.git
gnaygnil
docker
docker
master

搜索帮助