diff options
author | Cem Keylan <cem@ckyln.com> | 2020-04-23 00:35:57 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-04-23 00:35:57 +0300 |
commit | 4d00567bf269b7e5cd2bc53b45c9282a726eaaa1 (patch) | |
tree | 9653616716f9add193e2c0399e378dd99983506c /core | |
parent | 6685001a647c8810802c4fdab3279909a7d58ef1 (diff) | |
download | repository-4d00567bf269b7e5cd2bc53b45c9282a726eaaa1.tar.gz |
busybox: apply patches
Diffstat (limited to 'core')
-rwxr-xr-x | core/busybox/build | 4 | ||||
-rw-r--r-- | core/busybox/checksums | 5 | ||||
-rw-r--r-- | core/busybox/patches/adduser-no-setgid.patch | 12 | ||||
-rw-r--r-- | core/busybox/patches/fsck-resolve-uuid.patch | 56 | ||||
-rw-r--r-- | core/busybox/patches/install-fix-chown.patch | 36 | ||||
-rw-r--r-- | core/busybox/patches/modprobe-kernel-version.patch | 71 | ||||
-rw-r--r-- | core/busybox/patches/print-unicode.patch | 22 | ||||
-rw-r--r-- | core/busybox/sources | 5 | ||||
-rw-r--r-- | core/busybox/version | 2 |
9 files changed, 212 insertions, 1 deletions
diff --git a/core/busybox/build b/core/busybox/build index 7ea1dafc..af6445af 100755 --- a/core/busybox/build +++ b/core/busybox/build @@ -1,5 +1,9 @@ #!/bin/sh -e +for patch in *.patch; do + patch -p1 < "$patch" +done + # Build and install regular busybox. # This excludes utilities which require 'suid' to function. make CC="${CC:-gcc}" diff --git a/core/busybox/checksums b/core/busybox/checksums index 3a1ea062..0fae4ad5 100644 --- a/core/busybox/checksums +++ b/core/busybox/checksums @@ -7,3 +7,8 @@ c8b3502bf493336542247683f8d291753130141e5b20ecfda7077936751e83a7 inittab 3999bb8986a55b14389196ad70f810c9333ebdf5e03c0fbca2d100a6e8ba3d7e ntpd.run 4a5981f4b0d791fe9b84b0b2e01ae905f6565c8245b3cd603e6decf34ddad71a syslogd.run 2c6012579f669ea790785bb522a879a2005aad0d7977f96863918d3ed3cb03dd ntp.conf +8d84b1719dca2a751c09072c20cd782a3c47f119a68d35316f89d851daf67b88 fsck-resolve-uuid.patch +0f54301a73af461e8066bc805b48d991cfed513d08a2f036e015b19f97cb424a modprobe-kernel-version.patch +09c2f601fec4e5c10664c22f787dafb9424efe219bf826727c356da90dfd60d5 adduser-no-setgid.patch +f0e17fefc0af6b10205d72b242b6ef7481a58ff07726c62890ebc5893b96a396 install-fix-chown.patch +68e0c7d5e96902d3b890e89d9b018ae11d53ed3104bfedd624a1485df58b11cb print-unicode.patch diff --git a/core/busybox/patches/adduser-no-setgid.patch b/core/busybox/patches/adduser-no-setgid.patch new file mode 100644 index 00000000..613c2adb --- /dev/null +++ b/core/busybox/patches/adduser-no-setgid.patch @@ -0,0 +1,12 @@ +diff --git a/loginutils/adduser.c b/loginutils/adduser.c +index 850c810..68db3cb 100644 +--- a/loginutils/adduser.c ++++ b/loginutils/adduser.c +@@ -299,7 +299,6 @@ int adduser_main(int argc UNUSED_PARAM, char **argv) + } + if ((mkdir_err != 0 && errno != EEXIST) + || chown(pw.pw_dir, pw.pw_uid, pw.pw_gid) != 0 +- || chmod(pw.pw_dir, 02755) != 0 /* set setgid bit on homedir */ + ) { + bb_simple_perror_msg(pw.pw_dir); + } diff --git a/core/busybox/patches/fsck-resolve-uuid.patch b/core/busybox/patches/fsck-resolve-uuid.patch new file mode 100644 index 00000000..fd2503e7 --- /dev/null +++ b/core/busybox/patches/fsck-resolve-uuid.patch @@ -0,0 +1,56 @@ +From 2e673aac06d661038001286fd389d1b45c511c66 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Tue, 28 Nov 2017 13:23:17 +0100 +Subject: [PATCH] fsck: resolve LABEL=.../UUID=... spec to device + +--- + e2fsprogs/fsck.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c +index f5aa3dbe4..e2edc9747 100644 +--- a/e2fsprogs/fsck.c ++++ b/e2fsprogs/fsck.c +@@ -60,6 +60,7 @@ + //usage: "\n -t TYPE List of filesystem types to check" + + #include "libbb.h" ++#include "volume_id.h" + #include "common_bufsiz.h" + + /* "progress indicator" code is somewhat buggy and ext[23] specific. +@@ -524,12 +525,13 @@ static int wait_many(int flags) + * Execute a particular fsck program, and link it into the list of + * child processes we are waiting for. + */ +-static void execute(const char *type, const char *device, ++static void execute(const char *type, const char *spec, + const char *mntpt /*, int interactive */) + { + int i; + struct fsck_instance *inst; + pid_t pid; ++ char *device = (char *)spec; + + G.args[0] = xasprintf("fsck.%s", type); + +@@ -544,7 +546,8 @@ static void execute(const char *type, const char *device, + } + #endif + +- G.args[G.num_args - 2] = (char*)device; ++ resolve_mount_spec(&device); ++ G.args[G.num_args - 2] = device; + /* G.args[G.num_args - 1] = NULL; - already is */ + + if (G.verbose || G.noexecute) { +@@ -973,9 +976,6 @@ int fsck_main(int argc UNUSED_PARAM, char **argv) + + /* "/dev/blk" or "/path" or "UUID=xxx" or "LABEL=xxx" */ + if ((arg[0] == '/' && !opts_for_fsck) || strchr(arg, '=')) { +-// FIXME: must check that arg is a blkdev, or resolve +-// "/path", "UUID=xxx" or "LABEL=xxx" into block device name +-// ("UUID=xxx"/"LABEL=xxx" can probably shifted to fsck.auto duties) + devices = xrealloc_vector(devices, 2, num_devices); + devices[num_devices++] = arg; + continue; diff --git a/core/busybox/patches/install-fix-chown.patch b/core/busybox/patches/install-fix-chown.patch new file mode 100644 index 00000000..31ecd3c8 --- /dev/null +++ b/core/busybox/patches/install-fix-chown.patch @@ -0,0 +1,36 @@ +chown must precede chmod because on some systems, +chown clears the set[ug]id bits for non-superusers, +resulting in incorrect permissions. +diff --git a/coreutils/install.c b/coreutils/install.c +index 8270490..0256aeb 100644 +--- a/coreutils/install.c ++++ b/coreutils/install.c +@@ -244,6 +244,14 @@ int install_main(int argc, char **argv) + } + } + ++ /* Set the user and group id */ ++ if ((opts & (OPT_OWNER|OPT_GROUP)) ++ && lchown(dest, uid, gid) == -1 ++ ) { ++ bb_perror_msg("can't change %s of %s", "ownership", dest); ++ ret = EXIT_FAILURE; ++ } ++ + /* Set the file mode (always, not only with -m). + * GNU coreutils 6.10 is not affected by umask. */ + if (chmod(dest, mode) == -1) { +@@ -254,13 +262,6 @@ int install_main(int argc, char **argv) + if (use_default_selinux_context) + setdefaultfilecon(dest); + #endif +- /* Set the user and group id */ +- if ((opts & (OPT_OWNER|OPT_GROUP)) +- && lchown(dest, uid, gid) == -1 +- ) { +- bb_perror_msg("can't change %s of %s", "ownership", dest); +- ret = EXIT_FAILURE; +- } + next: + if (ENABLE_FEATURE_CLEAN_UP && isdir) + free(dest); diff --git a/core/busybox/patches/modprobe-kernel-version.patch b/core/busybox/patches/modprobe-kernel-version.patch new file mode 100644 index 00000000..2d4274ad --- /dev/null +++ b/core/busybox/patches/modprobe-kernel-version.patch @@ -0,0 +1,71 @@ +diff --git a/modutils/modprobe.c b/modutils/modprobe.c +index 0a372a049..ecb29a8fd 100644 +--- a/modutils/modprobe.c ++++ b/modutils/modprobe.c +@@ -111,7 +111,7 @@ + //usage: " from the command line\n" + //usage: + //usage:#define modprobe_trivial_usage +-//usage: "[-alrqvsD" IF_FEATURE_MODPROBE_BLACKLIST("b") "]" ++//usage: "[-alrqvsD" IF_FEATURE_MODPROBE_BLACKLIST("b") "]" " [-S VERSION]" + //usage: " MODULE" IF_FEATURE_CMDLINE_MODULE_OPTIONS(" [SYMBOL=VALUE]...") + //usage:#define modprobe_full_usage "\n\n" + //usage: " -a Load multiple MODULEs" +@@ -121,6 +121,7 @@ + //usage: "\n -v Verbose" + //usage: "\n -s Log to syslog" + //usage: "\n -D Show dependencies" ++//usage: "\n -S Set kernel version" + //usage: IF_FEATURE_MODPROBE_BLACKLIST( + //usage: "\n -b Apply blacklist to module names too" + //usage: ) +@@ -131,7 +132,7 @@ + * Note2: -b is always accepted, but if !FEATURE_MODPROBE_BLACKLIST, + * it is a no-op. + */ +-#define MODPROBE_OPTS "alrDb" ++#define MODPROBE_OPTS "alrDS:b" + /* -a and -D _are_ in fact compatible */ + #define MODPROBE_COMPLEMENTARY "q-v:v-q:l--arD:r--alD:a--lr:D--rl" + //#define MODPROBE_OPTS "acd:lnrt:C:b" +@@ -147,7 +148,8 @@ enum { + //OPT_VERONLY = (INSMOD_OPT_UNUSED << x), /* V */ + //OPT_CONFIGFILE = (INSMOD_OPT_UNUSED << x), /* C */ + OPT_SHOW_DEPS = (INSMOD_OPT_UNUSED << 3), /* D */ +- OPT_BLACKLIST = (INSMOD_OPT_UNUSED << 4) * ENABLE_FEATURE_MODPROBE_BLACKLIST, ++ OPT_KERNEL = (INSMOD_OPT_UNUSED << 4), /* S */ ++ OPT_BLACKLIST = (INSMOD_OPT_UNUSED << 5) * ENABLE_FEATURE_MODPROBE_BLACKLIST, + }; + #if ENABLE_LONG_OPTS + static const char modprobe_longopts[] ALIGN1 = +@@ -560,6 +562,7 @@ int modprobe_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; + int modprobe_main(int argc UNUSED_PARAM, char **argv) + { + int rc; ++ char *kernel; + unsigned opt; + struct module_entry *me; + +@@ -567,13 +570,20 @@ int modprobe_main(int argc UNUSED_PARAM, char **argv) + + opt = getopt32long(argv, "^" INSMOD_OPTS MODPROBE_OPTS "\0" MODPROBE_COMPLEMENTARY, + modprobe_longopts +- INSMOD_ARGS ++ INSMOD_ARGS, ++ &kernel + ); + argv += optind; + ++ /* Set user specified kernel version */ ++ if (opt & OPT_KERNEL) { ++ safe_strncpy(G.uts.release, kernel, sizeof(G.uts.release)); ++ } else { ++ uname(&G.uts); ++ } ++ + /* Goto modules location */ + xchdir(CONFIG_DEFAULT_MODULES_DIR); +- uname(&G.uts); + xchdir(G.uts.release); + + if (opt & OPT_LIST_ONLY) {
\ No newline at end of file diff --git a/core/busybox/patches/print-unicode.patch b/core/busybox/patches/print-unicode.patch new file mode 100644 index 00000000..178fb938 --- /dev/null +++ b/core/busybox/patches/print-unicode.patch @@ -0,0 +1,22 @@ +diff --git a/libbb/printable_string.c b/libbb/printable_string.c +index a814fd0..f4c7b00 100644 +--- a/libbb/printable_string.c ++++ b/libbb/printable_string.c +@@ -28,8 +28,6 @@ const char* FAST_FUNC printable_string2(uni_stat_t *stats, const char *str) + } + if (c < ' ') + break; +- if (c >= 0x7f) +- break; + s++; + } + +@@ -42,7 +40,7 @@ const char* FAST_FUNC printable_string2(uni_stat_t *stats, const char *str) + unsigned char c = *d; + if (c == '\0') + break; +- if (c < ' ' || c >= 0x7f) ++ if (c < ' ') + *d = '?'; + d++; + } diff --git a/core/busybox/sources b/core/busybox/sources index d54591c8..ef06436e 100644 --- a/core/busybox/sources +++ b/core/busybox/sources @@ -7,3 +7,8 @@ files/inittab files/ntpd.run files/syslogd.run files/ntp.conf +patches/fsck-resolve-uuid.patch +patches/modprobe-kernel-version.patch +patches/adduser-no-setgid.patch +patches/install-fix-chown.patch +patches/print-unicode.patch diff --git a/core/busybox/version b/core/busybox/version index 2915ceba..f2dfc4bd 100644 --- a/core/busybox/version +++ b/core/busybox/version @@ -1 +1 @@ -1.31.1 16 +1.31.1 17 |