If non-root with CAP_DAC_OVERRIDE: gio/tests/live-g-file.c:778:do_copy_move: 'res' should be FALSE
On !1339 (merged), mcatanzaro writes:
I've given up on trying to merge this. We'll have to try again when CI is in better shape. I've rerun the CI as many times as I care to; it's basically always failing on unrelated tests.
One of those unrelated test failures in job #583337 is this:
174/270 glib:gio / live-g-file FAIL 0.93 s (killed by signal 6 SIGABRT)
--- command ---
GIO_MODULE_DIR='' G_TEST_BUILDDIR='/builds/GNOME/glib/_build/gio/tests' GIO_LAUNCH_DESKTOP='/builds/GNOME/glib/_build/gio/gio-launch-desktop' G_TEST_SRCDIR='/builds/GNOME/glib/gio/tests' /builds/GNOME/glib/_build/gio/tests/live-g-file
--- stdout ---
# random seed: R02S91a178fb2b5c112c0c1178edda605a82
1..13
# Start of live-g-file tests
# GLib-GIO-DEBUG: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
(/builds/GNOME/glib/_build/gio/tests/live-g-file:9002): GLib-GIO-DEBUG: 19:48:12.960: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
ok 1 /live-g-file/prep_clean_structure
ok 2 /live-g-file/create_structure
ok 3 /live-g-file/test_initial_structure
ok 4 /live-g-file/test_traverse_structure
ok 5 /live-g-file/test_enumerate
ok 6 /live-g-file/test_open
ok 7 /live-g-file/test_create
Bail out! GLib-GIO:ERROR:../gio/tests/live-g-file.c:778:do_copy_move: 'res' should be FALSE
--- stderr ---
Cleaning target testing structure in 'testdir_live-g-file'...
Going to create testing structure in 'testdir_live-g-file'...
Creating directory 'dir1'...
Creating directory 'dir1/subdir'...
Creating directory 'dir2'...
Creating directory 'dir-target'...
Creating directory 'dir_no-access'...
Creating directory 'dir_no-write'...
Creating file 'target-file'...
Creating file 'normal_file'...
Creating symlink 'normal_file-symlink' --> 'normal_file'...
Creating file 'executable_file'...
Creating file 'private_file'...
Creating file 'normal_file2'...
Creating file 'readonly_file'...
Creating file 'UTF_pr?i?lis? z'...
Creating directory 'dir_pr?i?lis? z'...
Creating symlink 'lost_symlink' --> 'nowhere'...
Creating directory 'dir_hidden'...
Creating file 'dir_hidden/.a-hidden-file'...
Creating file 'dir_hidden/file-in-.hidden1'...
Creating file 'dir_hidden/file-in-.hidden2'...
Creating pattern file... done.
Testing sample structure in 'testdir_live-g-file'...
Testing file 'dir1'...
Testing file 'dir1/subdir'...
Testing file 'dir2'...
Testing file 'dir-target'...
Testing file 'dir_no-access'...
Testing file 'dir_no-write'...
Testing file 'target-file'...
Testing file 'normal_file'...
Testing file 'normal_file-symlink'...
Testing file 'executable_file'...
Testing file 'private_file'...
Testing file 'normal_file2'...
Testing file 'readonly_file'...
Testing file 'UTF_pr?i?lis? z'...
Testing file 'dir_pr?i?lis? z'...
Testing file 'lost_symlink'...
Testing file 'dir_hidden'...
Testing file 'dir_hidden/.a-hidden-file'...
Testing file 'dir_hidden/file-in-.hidden1'...
Testing file 'dir_hidden/file-in-.hidden2'...
Testing pattern file...
read 65536 bytes, total = 65536 of 65536.
Traversing through the sample structure in 'testdir_live-g-file'...
Found file dir1, relative to root: dir1
Found file subdir, relative to root: dir1/subdir
Found file dir_no-access, relative to root: dir_no-access
Found file dir_no-write, relative to root: dir_no-write
Found file dir2, relative to root: dir2
Found file dir_pr?i?lis? z, relative to root: dir_pr?i?lis? z
Found file dir-target, relative to root: dir-target
Found file target-file, relative to root: target-file
Found file normal_file, relative to root: normal_file
Found file normal_file-symlink, relative to root: normal_file-symlink
Found file executable_file, relative to root: executable_file
Found file private_file, relative to root: private_file
Found file normal_file2, relative to root: normal_file2
Found file readonly_file, relative to root: readonly_file
Found file UTF_pr?i?lis? z, relative to root: UTF_pr?i?lis? z
Found file lost_symlink, relative to root: lost_symlink
Found file dir_hidden, relative to root: dir_hidden
Found file .a-hidden-file, relative to root: dir_hidden/.a-hidden-file
Found file file-in-.hidden1, relative to root: dir_hidden/file-in-.hidden1
Found file .hidden, relative to root: dir_hidden/.hidden
Found file file-in-.hidden2, relative to root: dir_hidden/file-in-.hidden2
Found file pattern_file, relative to root: pattern_file
Test enumerate 'testdir_live-g-file'...
Testing file 'dir_no-access'
Testing file 'normal_file'
Testing file 'normal_file-symlink'
Testing file 'not_exists'
Testing file 'not_exists'
Testing file 'not_exists2'
Testing file 'not_exists3'
Testing file 'not_exists4'
Testing file 'dir_no-execute/file'
test_open: 'dir1'
test_open: 'dir_no-access'
test_open: 'target-file'
test_open: 'normal_file-symlink'
test_open: 'executable_file'
test_open: 'private_file'
test_open: 'readonly_file'
test_open: 'UTF_pr?i?lis? z'
test_open: 'pattern_file'
test_open: 'not_exists'
test_open: 'dir_no-execute/file'
test_open: 'lost_symlink'
test_create: 'dir1'
error code 3 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/dir1?: Is a directory
test_create: 'dir1/subdir'
error code 3 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/dir1/subdir?: Is a directory
test_create: 'dir2'
error code 2 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/dir2?: File exists
test_create: 'normal_file'
error code 2 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/normal_file?: File exists
test_create: 'executable_file'
test_create: 'private_file'
test_create: 'normal_file2'
test_create: 'UTF_pr?i?lis? z'
error code 2 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/UTF_pr?i?lis? z?: File exists
test_create: 'dir_pr?i?lis? z'
error code 2 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/dir_pr?i?lis? z?: File exists
test_create: 'pattern_file'
test_create: 'not_exists2'
test_create: 'not_exists3'
test_create: 'not_exists4'
do_copy_move: 'dir1/subdir' --> 'dir-target'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir1/subdir' --> '.'
res = 0, error code 2 = Target file exists
do_copy_move: 'dir1/subdir' --> 'target-file'
res = 0, error code 4 = Error when getting information for file ?/builds/GNOME/glib/_build/testdir_live-g-file/target-file/dir1/subdir?: Not a directory
do_copy_move: 'dir1/subdir' --> 'not_exists'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir1/subdir' --> 'dir_no-access'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir1/subdir' --> 'dir_no-write'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir2' --> 'dir-target'
do_copy_move: 'dir-target' --> 'dir-target'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir-target' --> '.'
res = 0, error code 2 = Target file exists
do_copy_move: 'dir-target' --> 'target-file'
res = 0, error code 4 = Error when getting information for file ?/builds/GNOME/glib/_build/testdir_live-g-file/target-file/dir-target?: Not a directory
do_copy_move: 'dir-target' --> 'not_exists'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir-target' --> 'dir_no-access'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'dir-target' --> 'dir_no-write'
res = 0, error code 25 = Can?t recursively copy directory
do_copy_move: 'target-file' --> 'dir-target'
do_copy_move: 'target-file' --> '.'
res = 0, error code 2 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/target-file?: File exists
do_copy_move: 'target-file' --> 'target-file'
res = 0, error code 4 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/target-file/target-file?: Not a directory
do_copy_move: 'target-file' --> 'not_exists'
res = 0, error code 1 = Error opening file ?/builds/GNOME/glib/_build/testdir_live-g-file/not_exists/target-file?: No such file or directory
do_copy_move: 'target-file' --> 'dir_no-access'
**
GLib-GIO:ERROR:../gio/tests/live-g-file.c:778:do_copy_move: 'res' should be FALSE
-------
It looks like we are trying to copy target-file
into a directory that has been chmod'd to 0666 (drw-rw-rw-), we are expecting failure, and we get success.
It would probably be good for debugging if this test could be made to run find testdir_live-g-file -ls
before aborting, to check our assumptions.
Edited by Simon McVittie