diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2016-12-15 13:23:55 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2016-12-15 13:24:39 +0000 |
commit | 046ea077c13ac73c895db3922eeff71a031f0775 (patch) | |
tree | 9edf0755204ede0007f5b80218d1938f87c7b7fc | |
parent | 79af21f75abc0a58db04f803a5615d92e33676b0 (diff) | |
download | alpine_aports-046ea077c13ac73c895db3922eeff71a031f0775.tar.bz2 alpine_aports-046ea077c13ac73c895db3922eeff71a031f0775.tar.xz alpine_aports-046ea077c13ac73c895db3922eeff71a031f0775.zip |
testing/libuser: new aport
-rw-r--r-- | testing/libuser/0001-Check-for-issetugid.patch | 62 | ||||
-rw-r--r-- | testing/libuser/0002-remove-unused-execinfo.h.patch | 27 | ||||
-rw-r--r-- | testing/libuser/APKBUILD | 53 |
3 files changed, 142 insertions, 0 deletions
diff --git a/testing/libuser/0001-Check-for-issetugid.patch b/testing/libuser/0001-Check-for-issetugid.patch new file mode 100644 index 0000000000..79756b9a07 --- /dev/null +++ b/testing/libuser/0001-Check-for-issetugid.patch | |||
@@ -0,0 +1,62 @@ | |||
1 | From d0537cb7f2dc5877700ad78dfd191515379d4edc Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 7 Jan 2016 02:22:51 +0000 | ||
4 | Subject: [PATCH 1/2] Check for issetugid() | ||
5 | |||
6 | If secure version of getenv is not there then we can use | ||
7 | issetugid() as aid to call getenv() | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | Upstream-Status: Pending | ||
12 | |||
13 | configure.ac | 1 + | ||
14 | lib/config.c | 12 +++++++++++- | ||
15 | 2 files changed, 12 insertions(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/configure.ac b/configure.ac | ||
18 | index 1ded1a2..ee19e1f 100644 | ||
19 | --- a/configure.ac | ||
20 | +++ b/configure.ac | ||
21 | @@ -125,6 +125,7 @@ AC_TYPE_OFF_T | ||
22 | AC_TYPE_SIZE_T | ||
23 | |||
24 | AC_CHECK_FUNCS([__secure_getenv secure_getenv]) | ||
25 | +AC_CHECK_FUNCS([issetugid]) | ||
26 | |||
27 | # Modify CFLAGS after all tests are run (some of them could fail because | ||
28 | # of the -Werror). | ||
29 | diff --git a/lib/config.c b/lib/config.c | ||
30 | index 29e7120..30f9daf 100644 | ||
31 | --- a/lib/config.c | ||
32 | +++ b/lib/config.c | ||
33 | @@ -44,8 +44,10 @@ | ||
34 | # define safe_getenv(string) secure_getenv(string) | ||
35 | #elif defined(HAVE___SECURE_GETENV) | ||
36 | # define safe_getenv(string) __secure_getenv(string) | ||
37 | +#elif defined(HAVE_ISSETUGID) | ||
38 | +# define safe_getenv(string) safe_getenv_issetugid(string) | ||
39 | #else | ||
40 | -# error Neither secure_getenv not __secure_getenv are available | ||
41 | +# error None of secure_getenv, __secure_getenv, or issetugid is available | ||
42 | #endif | ||
43 | |||
44 | struct config_config { | ||
45 | @@ -59,6 +61,14 @@ struct config_key { | ||
46 | GList *values; | ||
47 | }; | ||
48 | |||
49 | +static const char* | ||
50 | +safe_getenv_issetugid(const char* name) | ||
51 | +{ | ||
52 | + if (issetugid ()) | ||
53 | + return 0; | ||
54 | + return getenv (name); | ||
55 | +} | ||
56 | + | ||
57 | /* Compare two section names */ | ||
58 | static int | ||
59 | compare_section_names(gconstpointer a, gconstpointer b) | ||
60 | -- | ||
61 | 2.7.0 | ||
62 | |||
diff --git a/testing/libuser/0002-remove-unused-execinfo.h.patch b/testing/libuser/0002-remove-unused-execinfo.h.patch new file mode 100644 index 0000000000..4bc0219f19 --- /dev/null +++ b/testing/libuser/0002-remove-unused-execinfo.h.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 4b2f81f307ffeac12956e5c16e894e5ebb937ea5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 7 Jan 2016 02:26:00 +0000 | ||
4 | Subject: [PATCH 2/2] remove unused execinfo.h | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | --- | ||
8 | Upstream-Status: Pending | ||
9 | |||
10 | lib/error.c | 1 - | ||
11 | 1 file changed, 1 deletion(-) | ||
12 | |||
13 | diff --git a/lib/error.c b/lib/error.c | ||
14 | index a5ec30a..443e601 100644 | ||
15 | --- a/lib/error.c | ||
16 | +++ b/lib/error.c | ||
17 | @@ -18,7 +18,6 @@ | ||
18 | #include <config.h> | ||
19 | #include <sys/types.h> | ||
20 | #include <errno.h> | ||
21 | -#include <execinfo.h> | ||
22 | #include <libintl.h> | ||
23 | #include <stdarg.h> | ||
24 | #include <stdlib.h> | ||
25 | -- | ||
26 | 2.7.0 | ||
27 | |||
diff --git a/testing/libuser/APKBUILD b/testing/libuser/APKBUILD new file mode 100644 index 0000000000..cdacfe5b81 --- /dev/null +++ b/testing/libuser/APKBUILD | |||
@@ -0,0 +1,53 @@ | |||
1 | # Contributor: Francesco Colista <fcolista@alpinelinux.org> | ||
2 | # Maintainer: Francesco Colista <fcolista@alpinelinux.org> | ||
3 | pkgname=libuser | ||
4 | pkgver=0.62 | ||
5 | pkgrel=0 | ||
6 | pkgdesc="A standardized interface for manipulating and administering user and group accounts" | ||
7 | url="https://fedorahosted.org/libuser" | ||
8 | arch="all" | ||
9 | license="LGPL" | ||
10 | depends="python2" | ||
11 | makedepends="python2-dev glib-dev popt-dev libexecinfo-dev linux-pam-dev | ||
12 | autoconf automake libtool" | ||
13 | subpackages="$pkgname-dev $pkgname-doc $pkgname-lang py2-$pkgname:_py" | ||
14 | source="https://fedorahosted.org/releases/l/i/$pkgname/$pkgname-$pkgver.tar.xz | ||
15 | 0001-Check-for-issetugid.patch | ||
16 | 0002-remove-unused-execinfo.h.patch" | ||
17 | builddir="$srcdir/$pkgname-$pkgver" | ||
18 | |||
19 | build() { | ||
20 | cd "$builddir" | ||
21 | ./configure \ | ||
22 | --prefix=/usr \ | ||
23 | --sysconfdir=/etc \ | ||
24 | --sbindir=/usr/bin \ | ||
25 | --with-python \ | ||
26 | --disable-gtk-doc-html \ | ||
27 | --disable-rpath | ||
28 | sed -i 's/SUBDIRS = po docs/SUBDIRS = po/' Makefile | ||
29 | make || return 1 | ||
30 | } | ||
31 | |||
32 | package() { | ||
33 | cd "$builddir" | ||
34 | make DESTDIR="$pkgdir" install | ||
35 | } | ||
36 | |||
37 | _py() { | ||
38 | cd "$builddir" | ||
39 | pkgdesc="Python2 bindings for $pkgname" | ||
40 | depends="$pkgname" | ||
41 | mkdir -p "$subpkgdir"/usr/lib | ||
42 | mv "$pkgdir""/usr/lib/python2.7" "$subpkgdir"/usr/lib | ||
43 | } | ||
44 | |||
45 | md5sums="63e5e5c551e99dc5302b40b80bd6d4f2 libuser-0.62.tar.xz | ||
46 | 867b1b35a9c029f935a4da70b3f41722 0001-Check-for-issetugid.patch | ||
47 | 0b2fef5a319978f6428e14866fd2bd2d 0002-remove-unused-execinfo.h.patch" | ||
48 | sha256sums="a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b libuser-0.62.tar.xz | ||
49 | da99b8200a6e5b23fb288262300cefcfc4e16a1577cdb617aff8a4d4a19550c5 0001-Check-for-issetugid.patch | ||
50 | facbdb7d01ce05f0eea539dba5379b1ca0976b226ef3962d567832966d01ce4f 0002-remove-unused-execinfo.h.patch" | ||
51 | sha512sums="bc2f68456eae5912ac236192e97a3d66d5fa782520eff48d44d391c1ade590e001d821d7a93499e2391d0310cf03f60e4411f045f6ee3301af4e174d9ddc8450 libuser-0.62.tar.xz | ||
52 | 544f5124bf9a78daa99cf6d3f5b89c8519d7385aa7d1da9384fe29fea7285e61d7c91a865303258669232c3ed0590c8143e8acad66a6e1bc87069444e4af40b1 0001-Check-for-issetugid.patch | ||
53 | b7da24da834b7e00e3449ab49c2187b0d8993079888b0900b62ec418db8fc025a22ee4b779715cc6ca327b614d97dd1fbf0a33f4f22fedade06782a3ba11f599 0002-remove-unused-execinfo.h.patch" | ||