Control: tag -1 + patch

Hi,

On Mon, 31 Dec 2018 16:34:51 +0100 Johannes Schauer <jo...@debian.org> wrote:
> 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?

I uploaded a NMU to DELAYED/10. Debdiff attached. Please cancel this upload in
case you don't like it. :)

Thanks!

cheers, josch
diff -Nru fakechroot-2.19/debian/changelog fakechroot-2.19/debian/changelog
--- fakechroot-2.19/debian/changelog	2016-11-29 21:05:31.000000000 +0100
+++ fakechroot-2.19/debian/changelog	2019-01-01 08:05:21.000000000 +0100
@@ -1,3 +1,10 @@
+fakechroot (2.19-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * add support for wrapping renameat2 (closes: #909612)
+
+ -- Johannes 'josch' Schauer <jo...@debian.org>  Tue, 01 Jan 2019 08:05:21 +0100
+
 fakechroot (2.19-3) unstable; urgency=high
 
   * Correct autoconf variables for configure. The paths should be
diff -Nru fakechroot-2.19/debian/patches/renameat2.patch fakechroot-2.19/debian/patches/renameat2.patch
--- fakechroot-2.19/debian/patches/renameat2.patch	1970-01-01 01:00:00.000000000 +0100
+++ fakechroot-2.19/debian/patches/renameat2.patch	2019-01-01 08:05:21.000000000 +0100
@@ -0,0 +1,81 @@
+From: Johannes 'josch' Schauer <jo...@debian.org>
+Date: Tue, 01 Jan 2019 08:05:21 +0100
+Subject: add support for renameat2 system call
+
+--- 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
diff -Nru fakechroot-2.19/debian/patches/series fakechroot-2.19/debian/patches/series
--- fakechroot-2.19/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ fakechroot-2.19/debian/patches/series	2019-01-01 08:05:21.000000000 +0100
@@ -0,0 +1 @@
+renameat2.patch

Attachment: signature.asc
Description: signature

Reply via email to