diff -Nru fakeroot-1.32.2/config.h.in fakeroot-1.33/config.h.in --- fakeroot-1.32.2/config.h.in 2023-11-06 12:07:02.000000000 +0000 +++ fakeroot-1.33/config.h.in 2024-01-21 16:53:27.000000000 +0000 @@ -144,6 +144,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 + /* have the semun union */ #undef HAVE_SEMUN_DEF diff -Nru fakeroot-1.32.2/configure fakeroot-1.33/configure --- fakeroot-1.32.2/configure 2023-11-06 12:07:01.000000000 +0000 +++ fakeroot-1.33/configure 2024-01-21 16:53:27.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for fakeroot 1.32.2. +# Generated by GNU Autoconf 2.71 for fakeroot 1.33. # # Report bugs to . # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='fakeroot' PACKAGE_TARNAME='fakeroot' -PACKAGE_VERSION='1.32.2' -PACKAGE_STRING='fakeroot 1.32.2' +PACKAGE_VERSION='1.33' +PACKAGE_STRING='fakeroot 1.33' PACKAGE_BUGREPORT='clint@debian.org' PACKAGE_URL='' @@ -1370,7 +1370,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures fakeroot 1.32.2 to adapt to many kinds of systems. +\`configure' configures fakeroot 1.33 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1442,7 +1442,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of fakeroot 1.32.2:";; + short | recursive ) echo "Configuration of fakeroot 1.33:";; esac cat <<\_ACEOF @@ -1560,7 +1560,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -fakeroot configure 1.32.2 +fakeroot configure 1.33 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1968,7 +1968,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by fakeroot $as_me 1.32.2, which was +It was created by fakeroot $as_me 1.33, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3355,7 +3355,7 @@ # Define the identity of the package. PACKAGE='fakeroot' - VERSION='1.32.2' + VERSION='1.33' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -14181,6 +14181,12 @@ printf "%s\n" "#define HAVE_RENAMEAT 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "renameat2" "ac_cv_func_renameat2" +if test "x$ac_cv_func_renameat2" = xyes +then : + printf "%s\n" "#define HAVE_RENAMEAT2 1" >>confdefs.h + +fi ac_fn_c_check_func "$LINENO" "unlinkat" "ac_cv_func_unlinkat" if test "x$ac_cv_func_unlinkat" = xyes then : @@ -15464,7 +15470,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by fakeroot $as_me 1.32.2, which was +This file was extended by fakeroot $as_me 1.33, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15532,7 +15538,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -fakeroot config.status 1.32.2 +fakeroot config.status 1.33 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -Nru fakeroot-1.32.2/configure.ac fakeroot-1.33/configure.ac --- fakeroot-1.32.2/configure.ac 2023-11-06 12:06:41.000000000 +0000 +++ fakeroot-1.33/configure.ac 2024-01-21 16:55:13.000000000 +0000 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([fakeroot],[1.32.2],[clint@debian.org],[fakeroot]) +AC_INIT([fakeroot],[1.33],[clint@debian.org],[fakeroot]) AC_PREREQ([2.71]) AC_CONFIG_MACRO_DIR([build-aux]) LT_PREREQ(2.1a) @@ -360,7 +360,7 @@ ],[ AC_MSG_RESULT([no]) ]) -AC_CHECK_FUNCS(fchmodat fchownat fstatat mkdirat mknodat openat renameat unlinkat lchmod fgetattrlist) +AC_CHECK_FUNCS(fchmodat fchownat fstatat mkdirat mknodat openat renameat renameat2 unlinkat lchmod fgetattrlist) save_LIBS="$LIBS" # Linux diff -Nru fakeroot-1.32.2/debian/changelog fakeroot-1.33/debian/changelog --- fakeroot-1.32.2/debian/changelog 2023-11-06 12:15:47.000000000 +0000 +++ fakeroot-1.33/debian/changelog 2024-01-21 16:56:06.000000000 +0000 @@ -1,3 +1,11 @@ +fakeroot (1.33-1) unstable; urgency=medium + + * New upstream version. + - Patch from Samuel Thibault to add renameat2 support. + closes: #1061257. + + -- Clint Adams Sun, 21 Jan 2024 11:56:06 -0500 + fakeroot (1.32.2-1) unstable; urgency=medium * New upstream version. diff -Nru fakeroot-1.32.2/libfakeroot.c fakeroot-1.33/libfakeroot.c --- fakeroot-1.32.2/libfakeroot.c 2023-07-10 13:14:18.000000000 +0000 +++ fakeroot-1.33/libfakeroot.c 2024-01-21 16:55:13.000000000 +0000 @@ -1382,6 +1382,29 @@ return 0; } #endif /* HAVE_RENAMEAT */ +#ifdef HAVE_RENAMEAT2 +int renameat2(int olddir_fd, const char *oldpath, + int newdir_fd, const char *newpath, unsigned int flags){ + int r,s; + INT_STRUCT_STAT st; + + /* If newpath points to an existing file, that file will be + unlinked. Make sure we tell the faked daemon about this! */ + + /* we need the st_new struct in order to inform faked about the + (possible) unlink of the file */ + + r=INT_NEXT_FSTATAT(newdir_fd, newpath, &st, AT_SYMLINK_NOFOLLOW); + + s=next_renameat2(olddir_fd, oldpath, newdir_fd, newpath, flags); + if(s) + return -1; + if(!r) + INT_SEND_STAT(&st,unlink_func); + + return 0; +} +#endif /* HAVE_RENAMEAT2 */ #endif /* HAVE_FSTATAT */ diff -Nru fakeroot-1.32.2/wrapdef.h fakeroot-1.33/wrapdef.h --- fakeroot-1.32.2/wrapdef.h 2023-11-06 12:07:08.000000000 +0000 +++ fakeroot-1.33/wrapdef.h 2024-01-21 16:55:24.000000000 +0000 @@ -177,6 +177,9 @@ #ifdef HAVE_RENAMEAT int (*next_renameat)(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath)=tmp_renameat; #endif /* HAVE_RENAMEAT */ +#ifdef HAVE_RENAMEAT2 +int (*next_renameat2)(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath, unsigned int flags)=tmp_renameat2; +#endif /* HAVE_RENAMEAT2 */ #ifdef HAVE_UNLINKAT int (*next_unlinkat)(int dir_fd, const char *pathname, int flags)=tmp_unlinkat; #endif /* HAVE_UNLINKAT */ diff -Nru fakeroot-1.32.2/wrapfunc.inp fakeroot-1.33/wrapfunc.inp --- fakeroot-1.32.2/wrapfunc.inp 2023-07-12 15:32:34.000000000 +0000 +++ fakeroot-1.33/wrapfunc.inp 2024-01-21 16:55:13.000000000 +0000 @@ -203,6 +203,9 @@ #ifdef HAVE_RENAMEAT renameat;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath);(olddir_fd, oldpath, newdir_fd, newpath) #endif /* HAVE_RENAMEAT */ +#ifdef HAVE_RENAMEAT2 +renameat2;int;(int olddir_fd, const char *oldpath, int newdir_fd, const char *newpath, unsigned int flags);(olddir_fd, oldpath, newdir_fd, newpath, flags) +#endif /* HAVE_RENAMEAT2 */ #ifdef HAVE_UNLINKAT unlinkat;int;(int dir_fd, const char *pathname, int flags);(dir_fd, pathname, flags) #endif /* HAVE_UNLINKAT */ diff -Nru fakeroot-1.32.2/wrapstruct.h fakeroot-1.33/wrapstruct.h --- fakeroot-1.32.2/wrapstruct.h 2023-11-06 12:07:08.000000000 +0000 +++ fakeroot-1.33/wrapstruct.h 2024-01-21 16:55:24.000000000 +0000 @@ -178,6 +178,9 @@ #ifdef HAVE_RENAMEAT {(void(*))&next_renameat, "renameat"}, #endif /* HAVE_RENAMEAT */ +#ifdef HAVE_RENAMEAT2 + {(void(*))&next_renameat2, "renameat2"}, +#endif /* HAVE_RENAMEAT2 */ #ifdef HAVE_UNLINKAT {(void(*))&next_unlinkat, "unlinkat"}, #endif /* HAVE_UNLINKAT */