代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/docker 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From fe67259fd158b8193db31fad83f2dc3d3d3bc5c4 Mon Sep 17 00:00:00 2001
From: lujingxiao <lujingxiao@huawei.com>
Date: Sat, 19 Jan 2019 11:17:38 +0800
Subject: [PATCH 017/111] hookspec: canonicalize hook path before
validation
reason:hook programs must put under hook directory, but if we refer
them with a symbolic link path in hookspecs, docker daemon refuse
to run. so we just canonicalize path first before check.
Change-Id: I68d3757f26d7df05eb048e686368eca061cb06a9
Signed-off-by: zhangyuyun <zhangyuyun@huawei.com>
Signed-off-by: xiadanni <xiadanni@huawei.com>
Signed-off-by: lujingxiao <lujingxiao@huawei.com>
---
components/engine/daemon/container.go | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/components/engine/daemon/container.go b/components/engine/daemon/container.go
index a8cb950f44..06a19bb4c8 100644
--- a/components/engine/daemon/container.go
+++ b/components/engine/daemon/container.go
@@ -366,8 +366,17 @@ func (daemon *Daemon) validateHookPath(path string) error {
return fmt.Errorf("Hook path %q must be an absolute path", path)
}
- if !filepath.HasPrefix(path, daemon.hookStore) {
- return fmt.Errorf("hook program must be put under %q", daemon.hookStore)
+ realPath, err := filepath.EvalSymlinks(path)
+ if err != nil {
+ if !strings.Contains(err.Error(), "no such file or directory") {
+ return fmt.Errorf("failed to canonicalise path for %s: %s", path, err)
+ }
+ // for backward compatibility
+ realPath = path
+ }
+
+ if !filepath.HasPrefix(realPath, daemon.hookStore) {
+ return fmt.Errorf("hook path %q isn't right, hook program must be put under %q", path, daemon.hookStore)
}
return nil
}
--
2.17.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。