diff --git a/0003-add-fs-secure-compile-options.patch b/0003-add-fs-secure-compile-options.patch new file mode 100644 index 0000000000000000000000000000000000000000..35ae8e66f21d99d2a5d8c4ca991f0d06616805c0 --- /dev/null +++ b/0003-add-fs-secure-compile-options.patch @@ -0,0 +1,26 @@ +From 8fe3775c701ddf68fdbc7e3cc8d403bc350a8b1b Mon Sep 17 00:00:00 2001 +From: Li Feng +Date: Tue, 16 Mar 2021 09:30:01 +0800 +Subject: [PATCH] add fs secure compile options + +Signed-off-by: Li Feng +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 822a041..afcc3cc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -353,7 +353,7 @@ set(LWS_LIBRARY_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}) + + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/") + +-set(CMAKE_C_FLAGS "-Wl,-z,now ${CMAKE_C_FLAGS}") ++set(CMAKE_C_FLAGS "-Wl,-z,now -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2 -O2 -Wall -rdynamic ${CMAKE_C_FLAGS}") + + message(STATUS "CMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE}'") + +-- +2.25.1 + diff --git a/libwebsockets.spec b/libwebsockets.spec index fa8016745fe0924701ec69ce8b43d6924bb5fac7..6e6c3fa8571b7a7984f7ca904318cbe501269de3 100644 --- a/libwebsockets.spec +++ b/libwebsockets.spec @@ -1,13 +1,14 @@ Name: libwebsockets Version: 4.0.20 -Release: 4 +Release: 5 Summary: A lightweight C library for Websockets License: LGPLv2 and Public Domain and BSD and MIT and zlib URL: https://libwebsockets.org Source0: https://github.com/warmcat/libwebsockets/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -Patch9000: 0001-add-secure-compile-option-in-Makefile.patch -Patch9001: 0002-cmake-remove-unused-headfile-directory.patch +Patch9000: 0001-add-secure-compile-option-in-Makefile.patch +Patch9001: 0002-cmake-remove-unused-headfile-directory.patch +Patch9002: 0003-add-fs-secure-compile-options.patch BuildRequires: cmake openssl-devel zlib-devel libev-devel git @@ -97,6 +98,12 @@ find %{buildroot} -name '*_static.pc' -exec rm -f {} ';' %doc changelog README.md READMEs/ %changelog +* Tue 16 Mar 2021 lifeng - 4.0.20-5 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: add secure compile options + * Fri 19 Feb 2021 lifeng - 4.0.20-4 - Type:bugfix - ID:NA