Subject: [alpine-aports] [PATCH] main/ca-certificates: fix build with musl 1.1.20

From: alpine-edge-patches <[email-masked]>
Date: Sun, 16 Sep 2018 01:07:14 +0300 (MSK)

musl 1.1.20 no longer defines SYMLINK_MAX. Even if _POSIX_SYMLINK_MAX means
nothing on linux, it has exactly the same value as the removed constant.

This is essentially a bug report, the fix should go directly
to ca-certificates repo.

---
 main/ca-certificates/APKBUILD          |  6 ++++--
 main/ca-certificates/symlink_max.patch | 11 +++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 main/ca-certificates/symlink_max.patch

diff --git a/main/ca-certificates/APKBUILD b/main/ca-certificates/APKBUILD
index 775f3e32ca..e80c82f8a4 100644
--- a/main/ca-certificates/APKBUILD
+++ b/main/ca-certificates/APKBUILD
@@ -16,7 +16,8 @@ replaces="libcrypto1.0 openssl openssl1.0"
 options="!fhs !check"
 triggers="ca-certificates.trigger=/usr/share/ca-certificates:/usr/local/share/ca-certificates:/etc/ssl/certs:/etc/ca-certificates/update.d"
 install="$pkgname.post-deinstall"
-source="https://git.alpinelinux.org/cgit/ca-certificates/snapshot/ca-certificates-$pkgver.tar.bz2"
+source="https://git.alpinelinux.org/cgit/ca-certificates/snapshot/ca-certificates-$pkgver.tar.bz2
+	symlink_max.patch"
 builddir="$srcdir/ca-certificates-$pkgver"
 
 build() {
@@ -50,4 +51,5 @@ package() {
 	chmod +x "$pkgdir"/etc/ca-certificates/update.d/certhash
 }
 
-sha512sums="bbb05049fb01be101ec9959504b90add1a034e8b0485901828b535e56cef6cbb50d4aa4649fc4c46b9869a21d3f77f6aa210e947a29c4ba36fc1d552125a248e  ca-certificates-20171114.tar.bz2"
+sha512sums="bbb05049fb01be101ec9959504b90add1a034e8b0485901828b535e56cef6cbb50d4aa4649fc4c46b9869a21d3f77f6aa210e947a29c4ba36fc1d552125a248e  ca-certificates-20171114.tar.bz2
+dbb9158cb899515cfe2b5d22560fea5e9fe5cc2f063f32820b41bb453f860549410446fea4852a1362f61951c1e46b59e2c485e4c338143c8b68e7d62447677c  symlink_max.patch"
diff --git a/main/ca-certificates/symlink_max.patch b/main/ca-certificates/symlink_max.patch
new file mode 100644
index 0000000000..5fce125f72
--- /dev/null
+++ b/main/ca-certificates/symlink_max.patch
@@ -0,0 +1,11 @@
+--- a/update-ca.c
++++ b/update-ca.c
+@@ -196,7 +196,7 @@
+ 
+ static void proc_etccertsdir(const char* fullpath, struct hash* h, int tmpfile_fd)
+ {
+-	char linktarget[SYMLINK_MAX];
++	char linktarget[_POSIX_SYMLINK_MAX];
+ 	ssize_t linklen;
+ 
+ 	linklen = readlink(fullpath, linktarget, sizeof(linktarget)-1);
-- 
2.19.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---