Hi, On Tue, 25 Sep 2018 23:05:45 +0200 Johannes 'josch' Schauer <jo...@debian.org> wrote: > fakechroot currently doesn't support the renameat2 system call. This means > that the 'mv' from coreutils in current Debian unstable and testing will not > work. This in turn doesn't make fakechroot very useful for using it with > Debian unstable and testing. Older Debian releases still work though. > > I will leave the decision whether you consider the lack of 'mv' inside > fakechroot an RC bug or not up to you.
attached patch fixes the problem. I could NMU fakechroot with the patch. Would that be okay for you? Thanks! cheers, josch
--- a/config.h.in +++ b/config.h.in @@ -526,6 +526,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 `revoke' function. */ #undef HAVE_REVOKE --- a/configure.ac +++ b/configure.ac @@ -252,6 +252,7 @@ AC_CHECK_FUNCS(m4_normalize([ removexattr rename renameat + renameat2 revoke rmdir scandir --- a/src/Makefile.am +++ b/src/Makefile.am @@ -135,6 +135,7 @@ libfakechroot_la_SOURCES = \ removexattr.c \ rename.c \ renameat.c \ + renameat2.c \ revoke.c \ rmdir.c \ rpl_lstat.c \ --- /dev/null +++ b/src/renameat2.c @@ -0,0 +1,42 @@ +/* + libfakechroot -- fake chroot environment + Copyright (c) 2010, 2013 Piotr Roszatycki <dex...@debian.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include <config.h> + +#ifdef HAVE_RENAMEAT2 + +#define _ATFILE_SOURCE +#include "libfakechroot.h" + + +wrapper(renameat2, int, (int olddirfd, const char * oldpath, int newdirfd, const char * newpath, unsigned int flags)) +{ + char tmp[FAKECHROOT_PATH_MAX]; + debug("renameat2(%d, \"%s\", %d, \"%s\", %d)", olddirfd, oldpath, newdirfd, newpath, flags); + expand_chroot_path_at(olddirfd, oldpath); + strcpy(tmp, oldpath); + oldpath = tmp; + expand_chroot_path_at(newdirfd, newpath); + return nextcall(renameat2)(olddirfd, oldpath, newdirfd, newpath, flags); +} + +#else +typedef int empty_translation_unit; +#endif
signature.asc
Description: signature