Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad-img
提交
f5471c75
I
iSulad-img
项目概览
openeuler
/
iSulad-img
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad-img
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f5471c75
编写于
6月 08, 2020
作者:
W
WangFengTu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make sure created time is larger or equal than 1970
Signed-off-by:
N
WangFengTu
<
wangfengtu@huawei.com
>
上级
f3fd7793
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
1 deletion
+57
-1
iSulad-img.spec
iSulad-img.spec
+1
-1
patch/0056-make-sure-created-time-is-larger-or-equal-than-1970.patch
...make-sure-created-time-is-larger-or-equal-than-1970.patch
+55
-0
patch/series-patch.conf
patch/series-patch.conf
+1
-0
未找到文件。
iSulad-img.spec
浏览文件 @
f5471c75
%global _version 2.0.0
%global _release 20200
527.141725.git98f6591
3
%global _release 20200
608.153239.gitf3fd779
3
Name: iSulad-img
Version: %{_version}
Release: %{_release}
...
...
patch/0056-make-sure-created-time-is-larger-or-equal-than-1970.patch
0 → 100644
浏览文件 @
f5471c75
From cc357cbce3222091e7a952f0320f8cdf2363cb37 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Mon, 8 Jun 2020 15:02:55 +0800
Subject: [PATCH] make sure created time is larger or equal than 1970
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
.../containers/image/docker/tarfile/src.go | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/vendor/github.com/containers/image/docker/tarfile/src.go b/vendor/github.com/containers/image/docker/tarfile/src.go
index 82e30a3..c8b4f4e 100644
--- a/vendor/github.com/containers/image/docker/tarfile/src.go
+++ b/vendor/github.com/containers/image/docker/tarfile/src.go
@@ -238,6 +238,26 @@
func mainfestIndex(tarManifest []ManifestItem, repoTag string) (int, error) {
return 0, fmt.Errorf("RepoTag %v not found in tar archive\n", repoTag)
}
+func validConfig(config *manifest.Schema2Image) error {
+ // Linux time start from 1970-01-01 00:00:00 +0000 (UTC)
+ // If year is less then 1970, decode time string may fail.
+ const yearMin int = 1970
+
+ year := config.Created.Year()
+ if year < yearMin {
+ return fmt.Errorf("Invalid year %v of created, min is %v", year, yearMin)
+ }
+
+ for _, h := range config.History {
+ year = h.Created.Year()
+ if year < yearMin {
+ return fmt.Errorf("Invalid year %v of created in history, min is %v", year, yearMin)
+ }
+ }
+
+ return nil
+}
+
// ensureCachedDataIsPresent loads data necessary for any of the public accessors.
func (s *Source) ensureCachedDataIsPresent() error {
if s.tarManifest != nil {
@@ -269,6 +289,10 @@
func (s *Source) ensureCachedDataIsPresent() error {
return errors.Wrapf(err, "Error decoding tar config %s", tarManifest[mIndex].Config)
}
+ if err := validConfig(&parsedConfig); err != nil {
+ return errors.Wrapf(err, "Error validating tar config %s", tarManifest[mIndex].Config)
+ }
+
knownLayers, err := s.prepareLayerData(&tarManifest[mIndex], &parsedConfig)
if err != nil {
return err
--
2.20.1
patch/series-patch.conf
浏览文件 @
f5471c75
...
...
@@ -53,3 +53,4 @@
0053
-
support
-
pull
-
image
-
of
-
schema1
.
patch
0054
-
Change
-
copyright
-
from
-
Mulan
-
PSL
-
v1
-
to
-
Mulan
-
PSL
-
v2
.
patch
0055
-
Change
-
copyright
-
from
-
MulanPSL
-
to
-
MulanPSL2
.
patch
0056
-
make
-
sure
-
created
-
time
-
is
-
larger
-
or
-
equal
-
than
-
1970
.
patch
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录