aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-10-28 11:51:12 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-10-28 11:59:50 +0300
commit39bfeece257a70de085fbbadf918fa26d3812212 (patch)
treeba6f1ba83b71fa97694e76e1044c0f9029bd0577 /main/musl
parent270482be202256d47c16aa0f16f87fe3f205d458 (diff)
downloadaports-39bfeece257a70de085fbbadf918fa26d3812212.tar.bz2
aports-39bfeece257a70de085fbbadf918fa26d3812212.tar.xz
main/musl: fix glob regression
likely fixes #8009
Diffstat (limited to 'main/musl')
-rw-r--r--main/musl/0002-fix-regression-in-glob-with-literal-.-or-.-path-comp.patch44
-rw-r--r--main/musl/APKBUILD5
2 files changed, 47 insertions, 2 deletions
diff --git a/main/musl/0002-fix-regression-in-glob-with-literal-.-or-.-path-comp.patch b/main/musl/0002-fix-regression-in-glob-with-literal-.-or-.-path-comp.patch
new file mode 100644
index 0000000000..d7ea51e11d
--- /dev/null
+++ b/main/musl/0002-fix-regression-in-glob-with-literal-.-or-.-path-comp.patch
@@ -0,0 +1,44 @@
+From ec04d122f1182aeb91f39b0e80ae40c68e4d9605 Mon Sep 17 00:00:00 2001
+From: Rich Felker <dalias@aerifal.cx>
+Date: Sat, 21 Oct 2017 12:17:49 -0400
+Subject: [PATCH] fix regression in glob with literal . or .. path component
+
+commit 8c4be3e2209d2a1d3874b8bc2b474668fcbbbac6 was written to
+preclude the GLOB_PERIOD extension from matching these directory
+entries, but also precluded literal matches.
+
+adjust the check that excludes . and .. to check whether the
+GLOB_PERIOD flag is in effect, so that it cannot alter behavior in
+cases governed by the standard, and also don't exclude . or .. in any
+case where normal glob behavior (fnmatch's FNM_PERIOD flag) would have
+included one or both of them (patterns such as ".*").
+
+it's still not clear whether this is the preferred behavior for
+GLOB_PERIOD, but at least it's clear that it can no longer break
+applications which are not relying on quirks of a nonstandard feature.
+---
+ src/regex/glob.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/regex/glob.c b/src/regex/glob.c
+index 6f8425ca..85671985 100644
+--- a/src/regex/glob.c
++++ b/src/regex/glob.c
+@@ -100,9 +100,11 @@ static int match_in_dir(const char *d, const char *p, int flags, int (*errfunc)(
+ continue;
+ if (p2 && de->d_type && !S_ISDIR(de->d_type<<12) && !S_ISLNK(de->d_type<<12))
+ continue;
+- if (p2 && de->d_name[0]=='.' && !de->d_name[1])
+- continue;
+- if (p2 && de->d_name[0]=='.' && de->d_name[1]=='.' && !de->d_name[2])
++ /* With GLOB_PERIOD, don't allow matching . or .. unless
++ * fnmatch would match them with FNM_PERIOD rules in effect. */
++ if (p2 && (flags & GLOB_PERIOD) && de->d_name[0]=='.'
++ && (!de->d_name[1] || de->d_name[1]=='.' && !de->d_name[2])
++ && fnmatch(p, de->d_name, fnm_flags | FNM_PERIOD))
+ continue;
+ if (*d) {
+ memcpy(name, d, l);
+--
+2.14.3
+
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD
index 1938bbb3ca..3ebfd72bff 100644
--- a/main/musl/APKBUILD
+++ b/main/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.17
-pkgrel=1
+pkgrel=2
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -17,8 +17,8 @@ nolibc) ;;
*) subpackages="$subpackages $pkgname-utils";;
esac
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
-
0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch
+ 0002-fix-regression-in-glob-with-literal-.-or-.-path-comp.patch
1000-implement-strftime-GNU-extension-padding-specifiers-.patch
2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
3002-stdio-implement-fopencookie-3.patch
@@ -146,6 +146,7 @@ compat() {
sha512sums="bc99c7d58d64116c03e68fe77141a1f2938e0c01ba027937587a060d435b4b00b8b1f18c63fb8ed445ef36f377974e02a7b4821c793e4292041e31e66f145428 musl-1.1.17.tar.gz
0ccf3dc82ab5556c001a0cc4209f4263eb3670f188e1ca0e649593f4dca0bd1107f1985f608b30c4eb0ef8b0a76d31434fb9ecc3c82fed2bb5f1860016d5057c 0001-posix_spawn-use-larger-stack-to-cover-worst-case-in-.patch
+3e03977cacd24434aefba5f457a96d956f4264f2e53197a1616d11d52d65884e0411fc2395c6ffaec4ca4b21da3563327b1823169391f53a8d137f8202f88b38 0002-fix-regression-in-glob-with-literal-.-or-.-path-comp.patch
7e4c703e57a3564cd3ee1d5334b806cbe654355179ba55d4d25361dfc555eb4a7d081d80d64fdaff8476949afd04558d278b124d1fb108080beaa5ba2f8ce2b9 1000-implement-strftime-GNU-extension-padding-specifiers-.patch
2c8e1dde1834238097b2ee8a7bfb53471a0d9cff4a5e38b55f048b567deff1cdd47c170d0578a67b1a039f95a6c5fbb8cff369c75b6a3e4d7ed171e8e86ebb8c 2000-pthread-internals-increase-DEFAULT_GUARD_SIZE-to-2-p.patch
0053e16cbac968b50dee98e3b36d29a497aaca6d9d0e120556273c9d0cd8360310eb7b7ab3c1e416217210fdd071e98268eaca54f3a0e9a22408ed8701dc54c1 3002-stdio-implement-fopencookie-3.patch