aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-04-22 12:47:43 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-04-22 12:53:09 +0000
commit5aa2cfffb609ec798ea84a3a755050d9c2ab914a (patch)
tree56569e2a8735a6ce1a17bebd78e9bede6e650b10 /main/busybox
parenta53f414ea86477a8592aca0843b7fcd9ab60ab2b (diff)
downloadaports-5aa2cfffb609ec798ea84a3a755050d9c2ab914a.tar.bz2
aports-5aa2cfffb609ec798ea84a3a755050d9c2ab914a.tar.xz
main/busybox: use system pwd/grp/shadow instead of busybox
This reduces size of busybox and it should fix the group size limit. fixes #733
Diffstat (limited to 'main/busybox')
-rw-r--r--main/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch69
-rw-r--r--main/busybox/APKBUILD14
-rw-r--r--main/busybox/busyboxconfig4
3 files changed, 80 insertions, 7 deletions
diff --git a/main/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch b/main/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch
new file mode 100644
index 0000000000..9707c95a6c
--- /dev/null
+++ b/main/busybox/0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch
@@ -0,0 +1,69 @@
+From f47fa75ef19a43848dedb4a2bff79368878362bf Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue, 22 Apr 2014 12:41:20 +0000
+Subject: [PATCH] linedit, deluser: use POSIX getpwent instead of getpwent_r
+
+This fixes building with musl libc.
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+---
+ libbb/lineedit.c | 11 ++++-------
+ loginutils/deluser.c | 11 +++++------
+ 2 files changed, 9 insertions(+), 13 deletions(-)
+
+diff --git a/libbb/lineedit.c b/libbb/lineedit.c
+index 8564307..99e6e2c 100644
+--- a/libbb/lineedit.c
++++ b/libbb/lineedit.c
+@@ -672,20 +672,17 @@ static char *username_path_completion(char *ud)
+ */
+ static NOINLINE unsigned complete_username(const char *ud)
+ {
+- /* Using _r function to avoid pulling in static buffers */
+- char line_buff[256];
+- struct passwd pwd;
+- struct passwd *result;
++ struct passwd *pw;
+ unsigned userlen;
+
+ ud++; /* skip ~ */
+ userlen = strlen(ud);
+
+ setpwent();
+- while (!getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) {
++ while ((pw = getpwent())) {
+ /* Null usernames should result in all users as possible completions. */
+- if (/*!userlen || */ strncmp(ud, pwd.pw_name, userlen) == 0) {
+- add_match(xasprintf("~%s/", pwd.pw_name));
++ if (/*!userlen || */ strncmp(ud, pw->pw_name, userlen) == 0) {
++ add_match(xasprintf("~%s/", pw->pw_name));
+ }
+ }
+ endpwent();
+diff --git a/loginutils/deluser.c b/loginutils/deluser.c
+index e39ac55..d7d9b24 100644
+--- a/loginutils/deluser.c
++++ b/loginutils/deluser.c
+@@ -73,14 +73,13 @@ int deluser_main(int argc, char **argv)
+ if (!member) {
+ /* "delgroup GROUP" */
+ struct passwd *pw;
+- struct passwd pwent;
+ /* Check if the group is in use */
+-#define passwd_buf bb_common_bufsiz1
+- while (!getpwent_r(&pwent, passwd_buf, sizeof(passwd_buf), &pw)) {
+- if (pwent.pw_gid == gr->gr_gid)
+- bb_error_msg_and_die("'%s' still has '%s' as their primary group!", pwent.pw_name, name);
++ setpwent();
++ while ((pw = getpwent())) {
++ if (pw->pw_gid == gr->gr_gid)
++ bb_error_msg_and_die("'%s' still has '%s' as their primary group!", pw->pw_name, name);
+ }
+- //endpwent();
++ endpwent();
+ }
+ pfile = bb_path_group_file;
+ if (ENABLE_FEATURE_SHADOWPASSWDS)
+--
+1.9.2
+
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 394f0e76a2..4da71d1ce9 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
pkgver=1.22.1
-pkgrel=3
+pkgrel=4
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
arch="all"
@@ -28,10 +28,11 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
0001-sendmail-make-f-optional-document-its-default-value.patch
0002-sendmail-use-FQDN-in-default-envelope-sender.patch
+ 0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch
busyboxconfig
glibc.patch"
-
+
_sdir="$srcdir"/$pkgname-$pkgver
_staticdir="$srcdir"/build-static
_dyndir="$srcdir"/build-dynamic
@@ -121,7 +122,8 @@ e1c183cbe1ca18a0fa0d9597314076c9 0001-ifupdown-use-x-hostname-NAME-with-udhcpc.
b15c67be5ccb3e523f540d8e218d5c85 0001-ifupdown-support-link-address-family.patch
d372d376820957fd5f2aee158af9867e 0001-sendmail-make-f-optional-document-its-default-value.patch
9d83db6173fe5b0fb8ee6ce741d5bb18 0002-sendmail-use-FQDN-in-default-envelope-sender.patch
-59ead78a0bb2f01afff4147a37c8bd3b busyboxconfig
+239dbe5dae5d36bbf73548b2749a22b1 0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch
+305337cd6f27dec11f318f438195a2cc busyboxconfig
befaac2c59c380e36a452b3f1c1d4a3a glibc.patch"
sha256sums="ae0b029d0a9e4dd71a077a790840e496dd838998e4571b87b60fed7462b6678b busybox-1.22.1.tar.bz2
81957f1fe0c386120dad1c8174ccc1fcfeed98c14d229db7d164d4fb4c938b3d bbsuid.c
@@ -137,7 +139,8 @@ a31ce8bcb8b81b20e80ffa407600a530d085806c6471f4e4249fcb3a491b79ef busybox-uname-
9a41b920dd7ee4746866f9dd4ae42899198cd9b10bfa433f2f5ead8083957da2 0001-ifupdown-support-link-address-family.patch
422ce68917dadf1a49085df2a00ffab670e2d0866dcdb7209ee49318ad195fca 0001-sendmail-make-f-optional-document-its-default-value.patch
7c88ef1d837ec8efb7c21e5b1b16e4ac3060ccde7ad5f698e9e6ef630d412593 0002-sendmail-use-FQDN-in-default-envelope-sender.patch
-8f7cd9baf35ed96ab8d2a7528c6e56dc88407c21676f8d50ec3946390fd53aee busyboxconfig
+ac2cd5fed91bfaec22ed1f2766396d0feb29b9b96f20b2c12d5d8ac8769afae9 0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch
+e3877200295a541c88c977cf510b756c1ab22bf7cad8ff69bcf277ea1ec9fe2f busyboxconfig
c604ef791c31d35a8c5ee4558d21428a46f37a6d762c4a7e29864f4037fc44a0 glibc.patch"
sha512sums="3e99fe373d638f714c3a61e1b02493d85ca532f472df038f7557db518ded38347072882ed568852941be7aac46fc34007257b4287375335ff5a09b60b295ce80 busybox-1.22.1.tar.bz2
16b3dd6a8b76b062d51458351fcb44f84b49eb4bf898584c933df90fb2cb3966f9547865a4d7447589bb20b7c203beb04ff7512f76f85d29138d2cff4eb9ee81 bbsuid.c
@@ -153,5 +156,6 @@ b1a1cc2ada657a3d3364c8c96853575d73784e769cd8768c170c27a3e59abd2beace75dff6d5047c
2dcda497ba3b7c0a7dc9d85e08efa71e51c57e84967fa1a5f06d48f29c9ee9f14a1931c1c2854e9632a5db785c8e72df10bdfb0735a9ecad7a8d390fff74abd1 0001-ifupdown-support-link-address-family.patch
7fde27b1742f641ad1da376d5cf7a96e1f60fef70fb9d382ca47b062df76d1c35d7a7f08cba5350484f818383eb897c772d5469fd515e648023d0a85d0ed640e 0001-sendmail-make-f-optional-document-its-default-value.patch
d466676cd2779ff33f288bb073aa2baa4f3606cf8b96ec514e624a7acb46442a2839ef18c47e19cc18a8234a485de39596773b44e4be2eff39617d7cf677dd38 0002-sendmail-use-FQDN-in-default-envelope-sender.patch
-a7f7d6c5ee710a71313d79490707e1337c7c97c1fbf8a3c5cfa6fd82950ebb0376bfcfd444b65faa32d837e2bac00c67b101555b582a18fabb5ce7f7be7729e7 busyboxconfig
+6781b10ca078296b243373d2c3f2bca2507a9df18a6b06d051e9ce84ed31a238aef3b2bb085daf12b145550be68c07c854272bd78a6f77da9197779b9c7cd9e9 0001-linedit-deluser-use-POSIX-getpwent-instead-of-getpwe.patch
+24f0387ad1de1db4a1919303d0605a708b0d2d1a108776397cd2bc50864a3503c5e4454aa3fde89759c7898cb632ffc92eb644ba67cfe59c6918f7c0e87eaacf busyboxconfig
1d2739379dab1deb3eae7cffd4845300eb7d30f7343b4a1209b21a5680860d55080ad45fdefe098b249ce3040c01951fa7f0a79cd447b2d7b260eb000099d9dc glibc.patch"
diff --git a/main/busybox/busyboxconfig b/main/busybox/busyboxconfig
index 8187a24173..7162f81f96 100644
--- a/main/busybox/busyboxconfig
+++ b/main/busybox/busyboxconfig
@@ -451,8 +451,8 @@ CONFIG_ADD_SHELL=y
CONFIG_REMOVE_SHELL=y
CONFIG_NOLOGIN=y
CONFIG_FEATURE_SHADOWPASSWDS=y
-CONFIG_USE_BB_PWD_GRP=y
-CONFIG_USE_BB_SHADOW=y
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
# CONFIG_USE_BB_CRYPT is not set
# CONFIG_USE_BB_CRYPT_SHA is not set
CONFIG_ADDUSER=y