!23 bugfix:chown config root path before daemon started

From: @DCCooper
Reviewed-by: @jingxiaolu
Signed-off-by: @jingxiaolu
This commit is contained in:
openeuler-ci-bot 2020-11-16 14:40:32 +08:00 committed by Gitee
commit f5514e1d3e
5 changed files with 50 additions and 3 deletions

View File

@ -1 +1 @@
0.9.4-2
0.9.4-3

View File

@ -1 +1 @@
95f55a42ca8f886a540ee792a591e16a96058da0
8ef723e794eead5d385ed014f743ad5147c7ac87

View File

@ -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 <lixiang172@huawei.com> - 0.9.4-3
- Chown config root path before daemon started
* Tue Nov 10 2020 lixiang <lixiang172@huawei.com> - 0.9.4-2
- Fix panic when user knock ctrl-c in pull/push/save command

View File

@ -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

View File

@ -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