cp and rm from coreutils 9.1 fail with glibc 2.34
Steps to reproduce (inside the fakechroot):
$ mkdir foo
$ touch foo/bar
$ rm -r foo
rm: cannot remove '/foo': Is a directory
$ echo foo > bar
$ cp -dp bar baz
cp: cannot stat '/bar': No such file or directory
The latter is already checked in test/t/cp.t which will fail if one builds fakechroot on a system with glibc 2.34. The former can be checked by adding a new test:
--- /dev/null
+++ b/test/t/rm.t
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+srcdir=${srcdir:-.}
+. $srcdir/common.inc.sh
+
+prepare 2
+
+for chroot in chroot fakechroot; do
+
+ if [ $chroot = "chroot" ] && ! is_root; then
+ skip $(( $tap_plan / 2 )) "not root"
+ else
+
+ mkdir -p $testtree/dir-$chroot
+ echo 'something' > $testtree/dir-$chroot/file
+
+ $srcdir/$chroot.sh $testtree /bin/sh -c "rm -r /dir-$chroot"
+ test -e $testtree/dir-$chroot && not
+ ok "$chroot rm -r /dir-$chroot:" $t
+
+ fi
+
+done
+
+cleanup
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -29,6 +29,7 @@ TESTS = \
t/pwd.t \
t/readlink.t \
t/realpath.t \
+ t/rm.t \
t/socket-af_unix.t \
t/statfs.t \
t/statvfs.t \
ah , I also hit this issue, "cp -d" make test fails removing -d option make test pass https://bugzilla.redhat.com/show_bug.cgi?id=2171766
ah , I also hit this issue, "cp -d" make test fails removing -d option make test pass https://bugzilla.redhat.com/show_bug.cgi?id=2171766
note that t/cp.t is falling again with glibc-2.37 ( which is available on Fedora 38 beta)
FAIL: t/cp.t
============
1..4
ok 1 # SKIP not root
ok 2 # SKIP not root
ok 3 fakechroot cp -dp /file-fakechroot /file2-fakechroot: something
not ok 4 fakechroot cp -dp /symlink-fakechroot /symlink2-fakechroot: Makefile Makefile.am Makefile.in archlinux.sh bin chroot.sh common.inc.sh debootstrap.sh fakechroot.sh java seq.inc.sh src t tap.inc.sh testtree-chroot testtree-cp testtree-dladdr testtree-execlp testtree-execve-elfloader testtree-execve-null-envp testtree.sh touch.inc.sh buffer overflow detected ***: terminated cat: /symlink2-fakechroot: No such file or directory
FAIL t/cp.t (exit status: 1)
@sergiomb2 this issue is fixed by #108. Can you open a separate issue about this new bug with glibc 2.37? Thanks!