From: Zhihao Cheng <chengzhihao1@huawei.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: <darrick.wong@oracle.com>, <ebiggers@google.com>,
<yi.zhang@huawei.com>, <fstests@vger.kernel.org>
Subject: Re: [PATCH xfstests v3] fstests: Add path $here before src/<file>
Date: Thu, 24 Oct 2019 09:48:45 +0800 [thread overview]
Message-ID: <fe2e358e-3ea7-e1e3-f3e4-49a090e19ccc@huawei.com> (raw)
In-Reply-To: <20191023152024.GC2543@desktop>
You're right.
I did a test. If xfstests-dev is installed in the root directory, there will be a problem in executing 'su regular_user -c CMD' (If the CMD contains an absolute path, /root does not provide read permission to other users).
I checked the place where 'su' and 'user_do' were called. After joining my patch, the following usecases did use absolute path in 'su regular_user -c CMD'.
generic/093 generic/125 generic/462
Thanks for your review.
在 2019/10/23 23:20, Eryu Guan 写道:
> On Mon, Oct 21, 2019 at 09:35:46PM +0800, Zhihao Cheng wrote:
>> Calling src/<file> without path '$here' may cause the problem that the
>> file cannot be found.
>> For example, Running generic/192 with overlayfs(Let ubifs as base fs)
>> yields the following output:
>>
>> generic/192 - output mismatch
>> QA output created by 192
>> sleep for 5 seconds
>> test
>> +./common/rc: line 316: src/t_dir_type: No such file or directory
>> delta1 is in range
>> delta2 is in range
>> ...
>>
>> When the use case fails, the call stack in generic/192 is:
>>
>> local unknowns=$(src/t_dir_type $dir u | wc -l) common/rc
>> _supports_filetype common/rc
>> _overlay_mount common/overlay
>> _overlay_test_mount common/overlay
>> _test_mount common/rc
>> _test_cycle_mount generic/192
>>
>> Before _test_cycle_mount() being invoked, generic/192 executed 'cd /'
>> to change work dir from 'xfstests-dev' to '/', so src/t_dir_type was not
>> found.
>>
>> Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
> Thanks a lot for the work!
>
> I found that some tests started to fail after applying this patch, they
> are
>
> generic/093 generic/125 generic/462
>
> as these tests run the test binary as a regular user (either via su or
> _user_do helper), and "$here" may contain path component that a regular
> user can't access, e.g. /root. So I skip adding $here prefix in above
> tests and add comments accordingly.
>
> Thanks,
> Eryu
>
> .
prev parent reply other threads:[~2019-10-24 1:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 13:35 [PATCH xfstests v3] fstests: Add path $here before src/<file> Zhihao Cheng
2019-10-23 15:20 ` Eryu Guan
2019-10-24 1:48 ` Zhihao Cheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe2e358e-3ea7-e1e3-f3e4-49a090e19ccc@huawei.com \
--to=chengzhihao1@huawei.com \
--cc=darrick.wong@oracle.com \
--cc=ebiggers@google.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox