Skip to content

cp and rm from coreutils 9.1 fail with glibc 2.34 #107

@josch

Description

@josch

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 \

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions