From 6a3abbbc7065295a4dcbb4ada9b473808edb2167 Mon Sep 17 00:00:00 2001 From: DCCooper <1866858@gmail.com> Date: Thu, 12 Nov 2020 21:06:15 +0800 Subject: [PATCH] bugfix:chown config root path before daemon started Signed-off-by: DCCooper <1866858@gmail.com> --- VERSION-openeuler | 2 +- git-commit | 2 +- isula-build.spec | 5 ++- ...nfig-root-path-before-daemon-started.patch | 43 +++++++++++++++++++ series.conf | 1 + 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 patch/0066-bugfix-chown-config-root-path-before-daemon-started.patch diff --git a/VERSION-openeuler b/VERSION-openeuler index bd9a33f..f5e0256 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -0.9.4-2 +0.9.4-3 diff --git a/git-commit b/git-commit index 499ef89..fcd6084 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -95f55a42ca8f886a540ee792a591e16a96058da0 +8ef723e794eead5d385ed014f743ad5147c7ac87 diff --git a/isula-build.spec b/isula-build.spec index 4bdc9b0..ee319c0 100644 --- a/isula-build.spec +++ b/isula-build.spec @@ -2,7 +2,7 @@ Name: isula-build Version: 0.9.4 -Release: 2 +Release: 3 Summary: A tool to build container images License: Mulan PSL V2 URL: https://gitee.com/openeuler/isula-build @@ -81,6 +81,9 @@ fi /usr/share/bash-completion/completions/isula-build %changelog +* Thu Nov 12 2020 lixiang - 0.9.4-3 +- Chown config root path before daemon started + * Tue Nov 10 2020 lixiang - 0.9.4-2 - Fix panic when user knock ctrl-c in pull/push/save command diff --git a/patch/0066-bugfix-chown-config-root-path-before-daemon-started.patch b/patch/0066-bugfix-chown-config-root-path-before-daemon-started.patch new file mode 100644 index 0000000..2ceec88 --- /dev/null +++ b/patch/0066-bugfix-chown-config-root-path-before-daemon-started.patch @@ -0,0 +1,43 @@ +From 11eac36a06326126ada8e42ea2b3bd0cfb9a3b4e Mon Sep 17 00:00:00 2001 +From: DCCooper <1866858@gmail.com> +Date: Thu, 12 Nov 2020 15:39:33 +0800 +Subject: [PATCH] bugfix:chown config root path before daemon started + +Signed-off-by: DCCooper <1866858@gmail.com> +--- + cmd/daemon/main.go | 6 ++++++ + cmd/daemon/main_test.go | 1 + + 2 files changed, 7 insertions(+) + +diff --git a/cmd/daemon/main.go b/cmd/daemon/main.go +index bd9c0cc..9fcde5c 100644 +--- a/cmd/daemon/main.go ++++ b/cmd/daemon/main.go +@@ -276,6 +276,12 @@ func setupWorkingDirectories() error { + } + } + ++ // change config root owner as group current defined ++ if err := util.ChangeGroup(constant.ConfigRoot, daemonOpts.Group); err != nil { ++ logrus.Errorf("Chown for %s failed: %v", constant.ConfigRoot, err) ++ return err ++ } ++ + return nil + } + +diff --git a/cmd/daemon/main_test.go b/cmd/daemon/main_test.go +index 46cc683..660d84d 100644 +--- a/cmd/daemon/main_test.go ++++ b/cmd/daemon/main_test.go +@@ -97,6 +97,7 @@ func TestSetupWorkingDirectories(t *testing.T) { + tt.prepareFunc(t) + defer testDir.Remove() + ++ daemonOpts.Group = "root" + if err := setupWorkingDirectories(); (err != nil) != tt.wantErr { + t.Errorf("testing failed! err = %v, wantErr = %v", err, tt.wantErr) + } +-- +1.8.3.1 + diff --git a/series.conf b/series.conf index ecb39ce..416159e 100644 --- a/series.conf +++ b/series.conf @@ -9,3 +9,4 @@ patch/0037-isula-build-fix-goroutine-leak-problem.patch #patch/0040-isula-build-change-default-healthcheck-timeout-to-20.patch #patch/0041-isula-build-add-t-shortname-for-tag-and-remove-it-fr.patch patch/0065-fix-panic-when-user-knock-ctrl-c-when-pull-push-and-.patch +patch/0066-bugfix-chown-config-root-path-before-daemon-started.patch