mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
test: Skip sandbox/stat_filename where "stat64" syscall defined
On 32-bit architectures where Linux provides the "stat64" system call, including i386, the sandbox is unable to filter calls to stat() as glibc uses this system call itself internally and the sandbox must allow it without restriction. Update the sandbox unit tests to skip the "sandbox/stat_filename" test on systems where the "stat64" system call is defined and the test is certain to fail. Also reorder the "#if" statement's clauses to correspond with the comment preceding it, for clarity.
This commit is contained in:
parent
f5980e60ed
commit
d59f63f1c4
@ -331,13 +331,13 @@ struct testcase_t sandbox_tests[] = {
|
|||||||
SANDBOX_TEST_IN_SANDBOX(rename_filename),
|
SANDBOX_TEST_IN_SANDBOX(rename_filename),
|
||||||
|
|
||||||
/* Currently the sandbox is unable to filter stat() calls on systems where
|
/* Currently the sandbox is unable to filter stat() calls on systems where
|
||||||
* glibc implements this function using the legacy "stat" system call, or where
|
* glibc implements this function using either of the legacy "stat" or "stat64"
|
||||||
* glibc version 2.33 or later is in use and the newer "newfstatat" syscall is
|
* system calls, or where glibc version 2.33 or later is in use and the newer
|
||||||
* available.
|
* "newfstatat" syscall is available.
|
||||||
*
|
*
|
||||||
* Skip testing sandbox_cfg_allow_stat_filename() if it seems the likely the
|
* Skip testing sandbox_cfg_allow_stat_filename() if it seems the likely the
|
||||||
* function will have no effect and the test will therefore not succeed. */
|
* function will have no effect and the test will therefore not succeed. */
|
||||||
#if !defined(__NR_newfstatat) && (!defined(__NR_stat) || defined(__NR_stat64))
|
#if !defined(__NR_stat) && !defined(__NR_stat64) && !defined(__NR_newfstatat)
|
||||||
SANDBOX_TEST_IN_SANDBOX(stat_filename),
|
SANDBOX_TEST_IN_SANDBOX(stat_filename),
|
||||||
#else
|
#else
|
||||||
SANDBOX_TEST_SKIPPED(stat_filename),
|
SANDBOX_TEST_SKIPPED(stat_filename),
|
||||||
|
Loading…
Reference in New Issue
Block a user