diff options
author | Ariadne Conill <ariadne@dereferenced.org> | 2020-03-31 07:02:36 +0000 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2020-03-31 07:03:39 +0000 |
commit | 3ace36cce861ff67da54a1a691b6aa8bd21c95ae (patch) | |
tree | 0b922df16f4f1f046a7dff00c5af5720d2acb813 /main/musl | |
parent | aa2688c4e362eab663253e190993b269356e3d66 (diff) | |
download | aports-3ace36cce861ff67da54a1a691b6aa8bd21c95ae.tar.bz2 aports-3ace36cce861ff67da54a1a691b6aa8bd21c95ae.tar.xz |
main/musl: fix remaining direct use of stat syscalls outside fstatat.c
this fixes timezones on MIPS64
Diffstat (limited to 'main/musl')
-rw-r--r-- | main/musl/APKBUILD | 4 | ||||
-rw-r--r-- | main/musl/fix-remaining-direct-use-of-stat-syscalls-outside.patch | 118 |
2 files changed, 121 insertions, 1 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index 6d95cd5a77..1f8b4555c3 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.24 -pkgrel=4 +pkgrel=5 pkgdesc="the musl c library (libc) implementation" url="https://musl.libc.org/" arch="all" @@ -29,6 +29,7 @@ source="https://musl.libc.org/releases/musl-$pkgver.tar.gz improve-strerror-speed.patch ppc-pt_regs.patch ppc64-fpregset_t.patch + fix-remaining-direct-use-of-stat-syscalls-outside.patch ldconfig __stack_chk_fail_local.c @@ -181,6 +182,7 @@ sha512sums="8987f1e194ea616f34f4f21fe9def28fb7f81d7060e38619206c6349f79db3bbb76b 4875efd7249613f696b4c470fb0aedf9968f1260cf35ef640666897d9ef2f3032588ac4c37659928ed45c1c010848ec2b19414ba5406f3bd7d745288b8b105d4 improve-strerror-speed.patch e7133ce2f0b172e2da03567e41f03bef58b6ff8eaac614494751228bcc102c39cbe312f0beb567c5f1c47c76feeff1e8d3b16284842c599029add4ad6d1d70ec ppc-pt_regs.patch 3de8e50519e33a55d2cc737b56011a7178d1c83230477d46e11e67195e08e74bff735c6013de6ff170bb2390e89bfca9919cc8728c064b3eeaab2035dd7e5c08 ppc64-fpregset_t.patch +d277e45af78ed2bd9f556ae30636783fc401b4d0a339d6e37b77f18ed1486f48fc631e3455f8764ddbc7d9aba41a270ab345ec3495955dfd22b27a306441ba2a fix-remaining-direct-use-of-stat-syscalls-outside.patch 8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c 0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c diff --git a/main/musl/fix-remaining-direct-use-of-stat-syscalls-outside.patch b/main/musl/fix-remaining-direct-use-of-stat-syscalls-outside.patch new file mode 100644 index 0000000000..12c68fd015 --- /dev/null +++ b/main/musl/fix-remaining-direct-use-of-stat-syscalls-outside.patch @@ -0,0 +1,118 @@ +From c9ebff4736128186121424364c1c62224b02aee3 Mon Sep 17 00:00:00 2001 +From: Rich Felker <dalias@aerifal.cx> +Date: Wed, 12 Feb 2020 17:23:29 -0500 +Subject: fix remaining direct use of stat syscalls outside fstatat.c + +because struct stat is no longer assumed to correspond to the +structure used by the stat-family syscalls, it's not valid to make any +of these syscalls directly using a buffer of type struct stat. + +commit 9493892021eac4edf1776d945bcdd3f7a96f6978 moved all logic around +this change for stat-family functions into fstatat.c, making the +others wrappers for it. but a few other direct uses of the syscall +were overlooked. the ones in tmpnam/tempnam are harmless since the +syscalls are just used to test for file existence. however, the uses +in fchmodat and __map_file depend on getting accurate file properties, +and these functions may actually have been broken one or more mips +variants due to removal of conversion hacks from syscall_arch.h. + +as a low-risk fix, simply use struct kstat in place of struct stat in +the affected places. +--- + src/stat/fchmodat.c | 3 ++- + src/stdio/tempnam.c | 5 +++-- + src/stdio/tmpnam.c | 5 +++-- + src/time/__map_file.c | 3 ++- + 4 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c +index be61bdf3..4ee00b0a 100644 +--- a/src/stat/fchmodat.c ++++ b/src/stat/fchmodat.c +@@ -2,6 +2,7 @@ + #include <fcntl.h> + #include <errno.h> + #include "syscall.h" ++#include "kstat.h" + + int fchmodat(int fd, const char *path, mode_t mode, int flag) + { +@@ -10,7 +11,7 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag) + if (flag != AT_SYMLINK_NOFOLLOW) + return __syscall_ret(-EINVAL); + +- struct stat st; ++ struct kstat st; + int ret, fd2; + char proc[15+3*sizeof(int)]; + +diff --git a/src/stdio/tempnam.c b/src/stdio/tempnam.c +index 84f91978..565df6b6 100644 +--- a/src/stdio/tempnam.c ++++ b/src/stdio/tempnam.c +@@ -6,6 +6,7 @@ + #include <string.h> + #include <stdlib.h> + #include "syscall.h" ++#include "kstat.h" + + #define MAXTRIES 100 + +@@ -37,10 +38,10 @@ char *tempnam(const char *dir, const char *pfx) + for (try=0; try<MAXTRIES; try++) { + __randname(s+l-6); + #ifdef SYS_lstat +- r = __syscall(SYS_lstat, s, &(struct stat){0}); ++ r = __syscall(SYS_lstat, s, &(struct kstat){0}); + #else + r = __syscall(SYS_fstatat, AT_FDCWD, s, +- &(struct stat){0}, AT_SYMLINK_NOFOLLOW); ++ &(struct kstat){0}, AT_SYMLINK_NOFOLLOW); + #endif + if (r == -ENOENT) return strdup(s); + } +diff --git a/src/stdio/tmpnam.c b/src/stdio/tmpnam.c +index 6c7c253a..d667a836 100644 +--- a/src/stdio/tmpnam.c ++++ b/src/stdio/tmpnam.c +@@ -5,6 +5,7 @@ + #include <string.h> + #include <stdlib.h> + #include "syscall.h" ++#include "kstat.h" + + #define MAXTRIES 100 + +@@ -17,10 +18,10 @@ char *tmpnam(char *buf) + for (try=0; try<MAXTRIES; try++) { + __randname(s+12); + #ifdef SYS_lstat +- r = __syscall(SYS_lstat, s, &(struct stat){0}); ++ r = __syscall(SYS_lstat, s, &(struct kstat){0}); + #else + r = __syscall(SYS_fstatat, AT_FDCWD, s, +- &(struct stat){0}, AT_SYMLINK_NOFOLLOW); ++ &(struct kstat){0}, AT_SYMLINK_NOFOLLOW); + #endif + if (r == -ENOENT) return strcpy(buf ? buf : internal, s); + } +diff --git a/src/time/__map_file.c b/src/time/__map_file.c +index 9d376222..d3cefa82 100644 +--- a/src/time/__map_file.c ++++ b/src/time/__map_file.c +@@ -2,10 +2,11 @@ + #include <fcntl.h> + #include <sys/stat.h> + #include "syscall.h" ++#include "kstat.h" + + const char unsigned *__map_file(const char *pathname, size_t *size) + { +- struct stat st; ++ struct kstat st; + const unsigned char *map = MAP_FAILED; + int fd = sys_open(pathname, O_RDONLY|O_CLOEXEC|O_NONBLOCK); + if (fd < 0) return 0; +-- +cgit v1.2.1 + |