diff options
author | PÁLI Gábor János <pali.gabor@gmail.com> | 2024-03-16 13:33:00 +0100 |
---|---|---|
committer | PÁLI Gábor János <pali.gabor@gmail.com> | 2024-03-16 13:44:13 +0100 |
commit | d7e702dd5529860e3d97a84e387bad95573f5894 (patch) | |
tree | e4c8bff35d942fadd35d2cd76a93ca4994fb55cb /aports/busybox/0032-install-Fix-chown-resetting-suid-sgid-bits-from-chmo.patch | |
parent | f9967eae7a169b920daedecbc176c792d516f471 (diff) | |
download | freebsd-wifibox-alpine-d7e702dd5529860e3d97a84e387bad95573f5894.zip |
Update to Linux 6.6 & 6.8, and Alpine 3.19
- Update dhcpcd to 10.0.5
- Update iptables to 1.8.10
- Update linux-lts to 6.6.22
- Update linux-edge to 6.8.1
- Update openrc 0.52.1
- Update mDNSResponder to 2200.80.16
- Update rtl8821ce to snapshot of 20240120
- Update rtw88 to snapshot of 20231024
- Resolve driver conflict between rtw88 and rtl8821ce
- Update rtw89 to snapshot of 20240310
- Update socat to 1.8.0.0
- Import security fixes for wpa_supplicant
Diffstat (limited to 'aports/busybox/0032-install-Fix-chown-resetting-suid-sgid-bits-from-chmo.patch')
-rw-r--r-- | aports/busybox/0032-install-Fix-chown-resetting-suid-sgid-bits-from-chmo.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/aports/busybox/0032-install-Fix-chown-resetting-suid-sgid-bits-from-chmo.patch b/aports/busybox/0032-install-Fix-chown-resetting-suid-sgid-bits-from-chmo.patch new file mode 100644 index 0000000..795275f --- /dev/null +++ b/aports/busybox/0032-install-Fix-chown-resetting-suid-sgid-bits-from-chmo.patch @@ -0,0 +1,53 @@ +From 6d22c9abc29d43e919e819ff004fcd84a90de60b Mon Sep 17 00:00:00 2001 +From: Nero <nero@w1r3.net> +Date: Sat, 23 Sep 2023 11:50:04 +0000 +Subject: [PATCH] install: Fix chown resetting suid/sgid bits from chmod +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Since Linux 2.2.13, chown(2) resets the suid/gid bits for all users. +This patch changes the ordering so that chmod gets called after chown. + +This behavior follows GNU coreutils. + +Signed-off-by: Nero <nero@w1r3.net> +Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> +--- + coreutils/install.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/coreutils/install.c b/coreutils/install.c +index c0f1c538a..00f8be87e 100644 +--- a/coreutils/install.c ++++ b/coreutils/install.c +@@ -244,6 +244,15 @@ int install_main(int argc, char **argv) + } + } + ++ /* Set the user and group id */ ++ /* (must be before chmod, or else chown may clear suid/gid bits) */ ++ 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 +263,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); |