summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--0001-Fix-compile-with-Werror-format-security.patch36
-rw-r--r--PKGBUILD29
3 files changed, 58 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9fd4bbd8770f..672856591f40 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,15 @@
pkgbase = log4c
pkgdesc = Logging FrameWork for C, as Log4j or Log4Cpp
pkgver = 1.2.4
- pkgrel = 1
+ pkgrel = 4
url = http://log4c.sourceforge.net/
arch = i686
arch = x86_64
license = LGPL
depends = expat
- options = !libtool
source = http://prdownloads.sourceforge.net/log4c/log4c-1.2.4.tar.gz
+ source = 0001-Fix-compile-with-Werror-format-security.patch
sha256sums = 5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea
+ sha256sums = f85bdfa6525739569ddb1c1f4bbf90de399dc3c95b24b964c8773fa89d17e47f
pkgname = log4c
-
diff --git a/0001-Fix-compile-with-Werror-format-security.patch b/0001-Fix-compile-with-Werror-format-security.patch
new file mode 100644
index 000000000000..34bac8f2fa02
--- /dev/null
+++ b/0001-Fix-compile-with-Werror-format-security.patch
@@ -0,0 +1,36 @@
+From 7fb2aed4607ff31a89841ac1dded72f9817b0bcc Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Fri, 24 Sep 2021 14:17:39 +0200
+Subject: [PATCH] Fix compile with -Werror=format-security
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In file included from helloworld1.c:8:
+mylog.h: In function ‘mylog_msg’:
+mylog.h:42:9: error: format not a string literal and no format arguments [-Werror=format-security]
+ 42 | log4c_category_log(log4c_category_get(catName), a_priority, msg);
+ | ^~~~~~~~~~~~~~~~~~
+---
+ examples/helloworld1/mylog.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/examples/helloworld1/mylog.h b/examples/helloworld1/mylog.h
+index 280f3dc..f8e0c81 100644
+--- a/examples/helloworld1/mylog.h
++++ b/examples/helloworld1/mylog.h
+@@ -39,9 +39,9 @@ static LOG4C_INLINE int mylog_fini(){
+
+ static LOG4C_INLINE void mylog_msg(char *catName,int a_priority, char *msg){
+ #ifndef WITHOUT_LOG4C
+- log4c_category_log(log4c_category_get(catName), a_priority, msg);
++ log4c_category_log(log4c_category_get(catName), a_priority, "%s", msg);
+ #else
+- printf(msg);
++ printf("%s", msg);
+ #endif
+ }
+
+--
+2.33.0
+
diff --git a/PKGBUILD b/PKGBUILD
index a0ad70bc8cb4..e84b9b5845a2 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,17 +1,26 @@
-# Maintainer: Arthur Țițeică arthur.titeica/gmail/com
-# Contributor: rockerzz <rockerzz@gmail.com>
-#
+# Maintainer: dreieck (https://aur.archlinux.org/account/dreieck)
+# Contributor: xiretza
+# Contributor: Arthur Țițeică
+# Contributor: rockerzz
+
pkgname=log4c
pkgver=1.2.4
-pkgrel=1
-pkgdesc="Logging FrameWork for C, as Log4j or Log4Cpp"
-url="http://log4c.sourceforge.net/"
+pkgrel=4
+pkgdesc='Logging FrameWork for C, as Log4j or Log4Cpp'
+url='http://log4c.sourceforge.net/'
arch=('i686' 'x86_64')
-license="LGPL"
+license=('LGPL')
depends=('expat')
-source=(http://prdownloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz)
-sha256sums=('5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea')
-options=('!libtool')
+source=("http://prdownloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ "0001-Fix-compile-with-Werror-format-security.patch")
+sha256sums=('5991020192f52cc40fa852fbf6bbf5bd5db5d5d00aa9905c67f6f0eadeed48ea'
+ 'f85bdfa6525739569ddb1c1f4bbf90de399dc3c95b24b964c8773fa89d17e47f')
+
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ patch -p1 < "$srcdir/0001-Fix-compile-with-Werror-format-security.patch"
+}
build() {
cd "$srcdir/$pkgname-$pkgver"