[PATCH 4/5] io: Add io/tst-lchmod covering lchmod and fchmodat
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Feb 12 18:52:00 GMT 2020
On 11/02/2020 12:27, Florian Weimer wrote:
> * Florian Weimer:
>
>> + /* Without AT_SYMLINK_NOFOLLOW, changing the permissions should
>> + work as before. */
>> + arg = select_path (do_relative_path, path_file, "file");
>> + TEST_COMPARE (chmod_func (fd, arg, 3, 0), 0);
>> + xstat (path_file, &st);
>> + TEST_COMPARE (st.st_mode & 0777, 3);
>> + /* But with AT_SYMLINK_NOFOLLOW, even if we originally had
>> + support, we may have lost it. */
>> + ret = chmod_func (fd, arg, 2, 0);
>
> The last line misses AT_SYMLINK_NOFOLLOW. The version below (which I'm
> going to commit) fixes this and adds another check.
I am seeing the following failures on ext2/ext3 on both powerpc64le
(4.18.0-80.7.2.el7.ppc64le) and aarch64 (4.12.13).
info: testing lchmod
info: AT_SYMLINK_NOFOLLOW support in /tmp/tst-lchmod-mBFJ8Q
tst-lchmod.c:142: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
tst-lchmod.c:183: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
tst-lchmod.c:183: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
info: testing fchmodat with AT_FDCWD
info: AT_SYMLINK_NOFOLLOW support in /tmp/tst-lchmod-GGO6WR
tst-lchmod.c:142: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
tst-lchmod.c:183: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
tst-lchmod.c:183: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
info: testing fchmodat with relative path
info: AT_SYMLINK_NOFOLLOW support in /tmp/tst-lchmod-blKDQP
tst-lchmod.c:142: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
tst-lchmod.c:183: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
tst-lchmod.c:183: numeric comparison failure
left: -1 (0xffffffff); from: ret
right: 0 (0x0); from: 0
info: re-running tests (after trying to empty /proc)
info: testing lchmod
info: no AT_SYMLINK_NOFOLLOW support in /tmp/tst-lchmod-CJrdjQ
info: testing fchmodat with AT_FDCWD
info: no AT_SYMLINK_NOFOLLOW support in /tmp/tst-lchmod-JKBC6P
info: testing fchmodat with relative path
info: no AT_SYMLINK_NOFOLLOW support in /tmp/tst-lchmod-qaG1BP
error: 9 test failures
More information about the Libc-alpha
mailing list