diff --git a/0001-lxcfs-tools-build-security-option.patch b/0001-lxcfs-tools-build-security-option.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6066bc982f3214f5837e9e50351d933686920c6 --- /dev/null +++ b/0001-lxcfs-tools-build-security-option.patch @@ -0,0 +1,50 @@ +From 5a612ba26670f44197906df518b772bf116c0efe Mon Sep 17 00:00:00 2001 +From: zhangsong +Date: Fri, 29 Jan 2021 14:50:19 +0800 +Subject: [PATCH] lxcfs-tools: build security option + +Signed-off-by: zhangsong +--- + Makefile | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/Makefile b/Makefile +index 3eb27a3..a597ff4 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,11 +20,15 @@ TAGS="cgo static_build" + BEP_DIR=/tmp/lxcfs-tools-build-bep + BEP_FLAGS=-tmpdir=/tmp/lxcfs-tools-build-bep + +-GO_LDFLAGS="-w -buildid=IdByiSula -extldflags -static $(BEP_FLAGS) -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" ++GO_LDFLAGS="-buildid=IdByiSula $(BEP_FLAGS) -extldflags=-static -extldflags=-Wl,-z,relro,-z,now -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" + DEF_GOPATH=${GOPATH} + ifneq ($(GOPATH), ) + CUS_GOPATH=${GOPATH}:${PWD} +-ENV = GOPATH=${CUS_GOPATH} CGO_ENABLED=1 ++ENV = GOPATH=${CUS_GOPATH} \ ++ CGO_ENABLED=1 \ ++ CGO_CFLAGS="-fstack-protector-strong -fPIE" \ ++ CGO_LDFLAGS_ALLOW='-Wl,-z,relro,-z,now' \ ++ CGO_LDFLAGS="-Wl,-z,relro,-z,now -Wl,-z,noexecstack" + else + ENV = CGO_ENABLED=1 + endif +@@ -35,12 +39,12 @@ dep: + + toolkit: $(SOURCES) | $(DEPS_LINK) + @echo "Making lxcfs-tools..." +- ${ENV} go build -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/lxcfs-tools . ++ ${ENV} go build -buildmode=pie -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/lxcfs-tools . + @echo "Done!" + + lxcfs-hook: $(SOURCES) | $(DEPS_LINK) + @echo "Making lxcfs-hook..." +- ${ENV} go build -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/lxcfs-hook ./hooks/lxcfs-hook ++ ${ENV} go build -buildmode=pie -mod=vendor -tags ${TAGS} -ldflags ${GO_LDFLAGS} -o build/lxcfs-hook ./hooks/lxcfs-hook + @echo "Done!" + + clean: +-- +1.8.3.1 + diff --git a/lxcfs-tools.spec b/lxcfs-tools.spec index 1505a3b3cf3b4c7e4382c75a81b22cf8017c79c5..b1595e8ba5efdae2eecabd162d6a4190b3e172d2 100644 --- a/lxcfs-tools.spec +++ b/lxcfs-tools.spec @@ -3,13 +3,15 @@ #Basic Information Name: lxcfs-tools Version: 0.3 -Release: 1 +Release: 24 Summary: toolkit for lxcfs to remount a running isulad License: Mulan PSL v2 URL: https://gitee.com/openeuler/lxcfs-tools -Source0: %{name}-%{version}.tar.gz +Source0: https://gitee.com/openeuler/lxcfs-tools/repository/archive/v%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-root +Patch1: 0001-lxcfs-tools-build-security-option.patch + #Dependency BuildRequires: golang > 1.7 BuildRequires: glibc-static @@ -21,6 +23,7 @@ A toolkit for lxcfs to remount a running isulad when crashes recover #Build sections %prep %setup -n %{name} -q +%patch1 -p1 %build make @@ -90,6 +93,11 @@ rm -rfv %{buildroot} %changelog +* Mon Feb 08 2021 zhangsong234 - 0.3-24 +- update version to 0.3-24 + +* Mon Sep 07 2020 wangkang101 <873229877@qq.com> - 0.3-2 +- modify url of source0 + * Fri Jul 03 2020 Zhangsong - 0.3-1 - release version 0.3 - diff --git a/lxcfs-tools-0.3.tar.gz b/v0.3.tar.gz similarity index 100% rename from lxcfs-tools-0.3.tar.gz rename to v0.3.tar.gz