busybox: do not try to chown() files when running crontab -e

Issue https://github.com/termux/termux-packages/issues/4837.
This commit is contained in:
Leonid Pliushch 2020-01-29 23:26:18 +02:00
parent 90d949021f
commit f07ef24007
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
diff -uNr busybox-1.31.1/miscutils/crontab.c busybox-1.31.1.mod/miscutils/crontab.c
--- busybox-1.31.1/miscutils/crontab.c 2019-06-10 13:50:53.000000000 +0300
+++ busybox-1.31.1.mod/miscutils/crontab.c 2019-11-11 22:08:19.115118798 +0200
+++ busybox-1.31.1.mod/miscutils/crontab.c 2020-01-29 23:25:22.817488323 +0200
@@ -53,10 +53,12 @@
/* CHILD - change user and run editor */
@ -14,7 +14,15 @@ diff -uNr busybox-1.31.1/miscutils/crontab.c busybox-1.31.1.mod/miscutils/cronta
ptr = getenv("VISUAL");
if (!ptr) {
ptr = getenv("EDITOR");
@@ -167,7 +169,8 @@
@@ -158,7 +160,6 @@
/* No O_EXCL: we don't want to be stuck if earlier crontabs
* were killed, leaving stale temp file behind */
src_fd = xopen3(tmp_fname, O_RDWR|O_CREAT|O_TRUNC, 0600);
- fchown(src_fd, pas->pw_uid, pas->pw_gid);
fd = open(pas->pw_name, O_RDONLY);
if (fd >= 0) {
bb_copyfd_eof(fd, src_fd);
@@ -167,7 +168,8 @@
}
close_on_exec_on(src_fd); /* don't want editor to see this fd */
edit_file(pas, tmp_fname);

View File

@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://busybox.net/
TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a single small executable"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.31.1
TERMUX_PKG_REVISION=4
TERMUX_PKG_REVISION=5
TERMUX_PKG_SRCURL=https://busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=d0f940a72f648943c1f2211e0e3117387c31d765137d92bd8284a3fb9752a998
TERMUX_PKG_BUILD_IN_SRC=true