coreutils should use renameat2 from libc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
coreutils (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This bug is fixed in coreutils 8.30-3 so please update the version from Debian buster.
Patch from Debian:
$ cat prefer-
From: Johannes 'josch' Schauer <email address hidden>
Date: Tue, 4 Dec 2018 20:57:48 +0100
X-Dgit-Generated: 8.30-1.1 2474a66055eceaf
Subject: Prefer renameat2 from glibc over syscall if available
This is necessary for fakechroot to be able to overwrite renameat2 which
is used by mv(1) from coreutils. See #909612
This patch is based on a patch by Andreas Henriksson <email address hidden>
which was accepted in gnulib git:
https:/
---
--- coreutils-
+++ coreutils-
@@ -2069,6 +2069,9 @@
/* Define to 1 if you have the `renameat' function. */
#undef HAVE_RENAMEAT
+/* Define to 1 if you have the `renameat2' function. */
+#undef HAVE_RENAMEAT2
+
/* Define to 1 if you have the `rewinddir' function. */
#undef HAVE_REWINDDIR
--- coreutils-
+++ coreutils-
@@ -77,7 +77,10 @@ renameat2 (int fd1, char const *src, int
int ret_val = -1;
int err = EINVAL;
-#ifdef SYS_renameat2
+#if HAVE_RENAMEAT2
+ ret_val = renameat2 (fd1, src, fd2, dst, flags);
+ err = errno;
+#elif defined SYS_renameat2
ret_val = syscall (SYS_renameat2, fd1, src, fd2, dst, flags);
err = errno;
#elif defined RENAME_EXCL
--- coreutils-
+++ coreutils-
@@ -15,7 +15,7 @@ AC_DEFUN(
AC_REQUIRE(
AC_REQUIRE(
AC_CHECK_
- AC_CHECK_
+ AC_CHECK_
if test $ac_cv_
HAVE_
elif test $REPLACE_RENAME = 1; then
ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: coreutils 8.30-1ubuntu1
ProcVersionSign
Uname: Linux 5.0.0-7-generic x86_64
ApportVersion: 2.20.10-0ubuntu23
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Mar 28 10:57:32 2019
InstallationDate: Installed on 2019-03-16 (11 days ago)
InstallationMedia: Ubuntu 19.04 "Disco Dingo" - Alpha amd64 (20190305.1)
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in coreutils (Ubuntu): | |
status: | New → Fix Released |
The bug breaks fakechroot command because mv command doesn't work with fake chroot environment anymore.