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@xxxxxxxxxx> > 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 > > .