Projects
openEuler:Mainline
isula-build
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 197
View file
_service:tar_scm_kernel_repo:isula-build.spec
Changed
@@ -2,7 +2,7 @@ Name: isula-build Version: 0.9.6 -Release: 9 +Release: 10 Summary: A tool to build container images License: Mulan PSL V2 URL: https://gitee.com/openeuler/isula-build @@ -85,6 +85,12 @@ /usr/share/bash-completion/completions/isula-build %changelog +* Tue Jul 26 2022 lujingxiao <lujingxiao@huawei.com> - 0.9.6-10 +- Type:bugfix +- CVE:NA +- SUG:restart +- DESC:registries.toml could not be empty;hosts, resolv.conf, .dockerignore file could be empty + * Tue Jul 26 2022 xingweizheng <xingweizheng@huawei.com> - 0.9.6-9 - Type:bugfix - CVE:NA
View file
_service:recompress:tar_scm_kernel_repo:patch.tar.gz/0122-registries.toml-could-not-be-empty-hosts-resolv.conf.patch
Added
@@ -0,0 +1,92 @@ +From dda31ed16ab7ae19bf07762f48d0863414ffd2da Mon Sep 17 00:00:00 2001 +From: xingweizheng <xingweizheng@huawei.com> +Date: Mon, 25 Jul 2022 18:48:10 +0800 +Subject: [PATCH] registries.toml could not be empty;hosts, resolv.conf, + .dockerignore file could be empty + +--- + builder/dockerfile/parser/parser.go | 2 +- + builder/dockerfile/run.go | 4 ++-- + cmd/daemon/before.go | 2 +- + util/common.go | 17 +++++++++++++++++ + 4 files changed, 21 insertions(+), 4 deletions(-) + +diff --git a/builder/dockerfile/parser/parser.go b/builder/dockerfile/parser/parser.go +index 1968fc1..2c34bbe 100644 +--- a/builder/dockerfile/parser/parser.go ++++ b/builder/dockerfile/parser/parser.go +@@ -304,7 +304,7 @@ func (df *dockerfile) ParseIgnore(dir string) ([]string, error) { + } + return ignores, errors.Wrap(err, "state dockerignore file failed") + } +- if err := util.CheckFileInfoAndSize(fullPath, constant.MaxFileSize); err != nil { ++ if err := util.CheckFileAllowEmpty(fullPath, constant.MaxFileSize); err != nil { + return ignores, err + } + +diff --git a/builder/dockerfile/run.go b/builder/dockerfile/run.go +index 5b066fb..651897a 100644 +--- a/builder/dockerfile/run.go ++++ b/builder/dockerfile/run.go +@@ -171,7 +171,7 @@ func setupBindFiles(bundlePath string) (map[string]string, error) { + } + + func generateHosts(bundlePath string) (string, error) { +- if err := util.CheckFileInfoAndSize(constant.HostsFilePath, constant.MaxFileSize); err != nil { ++ if err := util.CheckFileAllowEmpty(constant.HostsFilePath, constant.MaxFileSize); err != nil { + return "", err + } + +@@ -194,7 +194,7 @@ func generateHosts(bundlePath string) (string, error) { + } + + func generateResolv(bundlePath string) (string, error) { +- if err := util.CheckFileInfoAndSize(constant.ResolvFilePath, constant.MaxFileSize); err != nil { ++ if err := util.CheckFileAllowEmpty(constant.ResolvFilePath, constant.MaxFileSize); err != nil { + return "", err + } + +diff --git a/cmd/daemon/before.go b/cmd/daemon/before.go +index 1d28d9e..2ed19c9 100644 +--- a/cmd/daemon/before.go ++++ b/cmd/daemon/before.go +@@ -67,7 +67,7 @@ func validateConfigFileAndMerge(cmd *cobra.Command) error { + mergeConfig func(cmd *cobra.Command) error + }{ + {path: constant.StorageConfigPath, needed: false, mergeConfig: mergeStorageConfig}, +- {path: constant.RegistryConfigPath, needed: false, mergeConfig: nil}, ++ {path: constant.RegistryConfigPath, needed: true, mergeConfig: nil}, + // policy.json file must exists + {path: constant.SignaturePolicyPath, needed: true, mergeConfig: nil}, + // main configuration comes last for the final merge operation +diff --git a/util/common.go b/util/common.go +index 42d81b8..a5d0df9 100644 +--- a/util/common.go ++++ b/util/common.go +@@ -111,6 +111,23 @@ func CheckFileInfoAndSize(path string, sizeLimit int64) error { + return nil + } + ++// CheckFileAllowEmpty same as CheckFileInfoAndSize, but allow file to be empty ++func CheckFileAllowEmpty(path string, sizeLimit int64) error { ++ f, err := os.Stat(filepath.Clean(path)) ++ if err != nil { ++ return err ++ } ++ if !f.Mode().IsRegular() { ++ return errors.Errorf("file %s should be a regular file", f.Name()) ++ } ++ ++ if f.Size() > sizeLimit { ++ return errors.Errorf("file %s size is: %d, exceeds limit %d", f.Name(), f.Size(), sizeLimit) ++ } ++ ++ return nil ++} ++ + // ParseServer will get registry address from input + // if input is https://index.docker.io/v1 + // the result will be index.docker.io +-- +2.27.0 +
View file
_service:tar_scm_kernel_repo:VERSION-openeuler
Changed
@@ -1 +1 @@ -0.9.6-9 +0.9.6-10
View file
_service:tar_scm_kernel_repo:git-commit
Changed
@@ -1 +1 @@ -4b22d9293271f94da1231f8efe1fe1e80d7e608b +b414e4354d73c69e624fd365df134ea0f80490df
View file
_service:tar_scm_kernel_repo:series.conf
Changed
@@ -30,3 +30,4 @@ patch/0119-config-golangci-lint-to-lint-unit-test.patch patch/0120-make-isula-build-store-more-simple.patch patch/0121-print-first-and-second-error-when-dockerfile-not-fou.patch +patch/0122-registries.toml-could-not-be-empty-hosts-resolv.conf.patch
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.