summaryrefslogtreecommitdiff
path: root/system/musl
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-20 22:09:12 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-01-20 22:09:12 +0000
commit10e77220b55e60fe4a2ab726091c5c120f153aa7 (patch)
tree05a32cb16aa081361648359f370d9572f3cea05b /system/musl
parent66153ac5644682bc3868bceb3c25f0d6e9b9ccd3 (diff)
downloadpackages-10e77220b55e60fe4a2ab726091c5c120f153aa7.tar.gz
packages-10e77220b55e60fe4a2ab726091c5c120f153aa7.tar.bz2
packages-10e77220b55e60fe4a2ab726091c5c120f153aa7.tar.xz
packages-10e77220b55e60fe4a2ab726091c5c120f153aa7.zip
system/musl: add highly experimental fgetspent_r module
'If we only have a few hours between writing and shipping, we are well and truly doomed.' --laura@, Netscape
Diffstat (limited to 'system/musl')
-rw-r--r--system/musl/APKBUILD4
-rw-r--r--system/musl/fgetspent_r.patch65
2 files changed, 68 insertions, 1 deletions
diff --git a/system/musl/APKBUILD b/system/musl/APKBUILD
index dbbfe640c..df828a90e 100644
--- a/system/musl/APKBUILD
+++ b/system/musl/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=musl
pkgver=1.1.20
-pkgrel=5
+pkgrel=6
pkgdesc="System library (libc) implementation"
url="http://www.musl-libc.org/"
arch="all"
@@ -33,6 +33,7 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
getaddrinfo-regression.patch
ppc64-atomic.patch
dynamic-binary-stack-size.patch
+ fgetspent_r.patch
ldconfig
getent.c
@@ -129,6 +130,7 @@ a08d1b170356beea333ace1da12f8a8399ca80c5d9c32ff2fcd8562537a670214f566e4b1219a11b
e3953a3a73ef11696dd3eb216e18b152ae35198d8bff686d157e27bc90fb558f9a0be518025a90534e9afd6ea1bf731ffdb6fcb202bb9368f2c8eec7ca886141 getaddrinfo-regression.patch
aae9110eccb8cd7dcd3c957fcb01ed524598f79f7fa1a16b9993af40793545d1ec211e7e6aeabe7af7715d94cc26a473ea0acf6d6e66019bf65f03d4b8e24a4b ppc64-atomic.patch
654f76c96ed0e69e19b1a20569e83751bb207a8c181b26742f505638095dde3f4dd3f785deb92c49a603bd15cd8d4932129f567de8cd2edffdd8551c4dfd6976 dynamic-binary-stack-size.patch
+ded41235148930f8cf781538f7d63ecb0c65ea4e8ce792565f3649ee2523592a76b2a166785f0b145fc79f5852fd1fb1729a7a09110b3b8f85cba3912e790807 fgetspent_r.patch
cce2f1eeb61e55674469c26871a573cce61d739c3defe9c8f56f2b774f6ba5435849ad542a6714120efddc98c297098e9c98a1a424ac593df2243d4aa479f9a9 ldconfig
378d70e65bcc65bb4e1415354cecfa54b0c1146dfb24474b69e418cdbf7ad730472cd09f6f103e1c99ba6c324c9560bccdf287f5889bbc3ef0bdf0e08da47413 getent.c
9d42d66fb1facce2b85dad919be5be819ee290bd26ca2db00982b2f8e055a0196290a008711cbe2b18ec9eee8d2270e3b3a4692c5a1b807013baa5c2b70a2bbf iconv.c"
diff --git a/system/musl/fgetspent_r.patch b/system/musl/fgetspent_r.patch
new file mode 100644
index 000000000..360aa8fe1
--- /dev/null
+++ b/system/musl/fgetspent_r.patch
@@ -0,0 +1,65 @@
+From 3489f9e5ef055c80464252fe640fead8aeb1068e Mon Sep 17 00:00:00 2001
+From: Markus Wichmann <nullplan@gmx.net>
+Date: Sun, 20 Jan 2019 16:31:34 +0100
+Subject: [PATCH 5/5] Add fgetspent_r().
+
+Interface was defined by glibc, and seems to have been adopted by
+Solaris. Some freedesktop software appears to require it, and it adds
+little bloat.
+
+Added without feature test macros, since no other interface in shadow.h
+requires it, even the ones documented to have required it in the past.
+---
+ include/shadow.h | 1 +
+ src/passwd/fgetspent_r.c | 27 +++++++++++++++++++++++++++
+ 2 files changed, 28 insertions(+)
+ create mode 100644 src/passwd/fgetspent_r.c
+
+diff --git a/include/shadow.h b/include/shadow.h
+index 2b1be413..4edc90db 100644
+--- a/include/shadow.h
++++ b/include/shadow.h
+@@ -33,6 +33,7 @@ int putspent(const struct spwd *, FILE *);
+
+ struct spwd *getspnam(const char *);
+ int getspnam_r(const char *, struct spwd *, char *, size_t, struct spwd **);
++int fgetspent_r(FILE *f, struct spwd* sp, char *line, size_t size, struct spwd **spret);
+
+ int lckpwdf(void);
+ int ulckpwdf(void);
+diff --git a/src/passwd/fgetspent_r.c b/src/passwd/fgetspent_r.c
+new file mode 100644
+index 00000000..643637de
+--- /dev/null
++++ b/src/passwd/fgetspent_r.c
+@@ -0,0 +1,27 @@
++#include "pwf.h"
++#include <pthread.h>
++#include <limits.h>
++#include <stdio.h>
++
++int fgetspent_r(FILE *f, struct spwd *sp, char *line, size_t size, struct spwd **spret)
++{
++ int res = EIO;
++ int cs;
++ *spret = 0;
++ if (size > INT_MAX)
++ size = INT_MAX; //2GB ought to be enough for anyone
++ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
++ if (!fgets(line, size, f))
++ goto out;
++ res = ERANGE;
++ if (line[strlen(line) - 1] != '\n')
++ goto out;
++ res = EILSEQ;
++ if ( __parsespent(line, sp) < 0)
++ goto out;
++ *spret = sp;
++ res = 0;
++out:
++ pthread_setcancelstate(cs, 0);
++ return res;
++}
+--
+2.19.1
+