This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/5] io: Add io/tst-lchmod covering lchmod and fchmodat
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org, Florian Weimer <fweimer at redhat dot com>
- Date: Wed, 12 Feb 2020 15:52:05 -0300
- Subject: Re: [PATCH 4/5] io: Add io/tst-lchmod covering lchmod and fchmodat
- References: <cover.1579723048.git.fweimer@redhat.com> <e2d83306b7898deac80e42279d4e175553241320.1579723048.git.fweimer@redhat.com> <87a75pjga5.fsf@oldenburg2.str.redhat.com>
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