History

selftests: openat2: add RESOLVE_ conflict test

Now that we reject conflicting RESOLVE_ flags, add a selftest to avoid regressions.

Aleksa Sarai committed 6 years ago

Commit 4e62d551 parent 398840f1 file · +7 −1Browse files

Unified · Split

tools/testing/selftests/openat2/openat2_test.c+7−1
@@ -155,7 +155,7 @@ struct flag_test { · 154 unmodified lines
155 int err;155 int err;
156};156};
157 157
158#define NUM_OPENAT2_FLAG_TESTS 23158#define NUM_OPENAT2_FLAG_TESTS 24
159 159
160void test_openat2_flags(void)160void test_openat2_flags(void)
161{161{
@@ -210,6 +210,12 @@ void test_openat2_flags(void) · 48 unmodified lines
210 .how.flags = O_TMPFILE | O_RDWR,210 .how.flags = O_TMPFILE | O_RDWR,
211 .how.mode = 0x0000A00000000000ULL, .err = -EINVAL },211 .how.mode = 0x0000A00000000000ULL, .err = -EINVAL },
212 212
213 /* ->resolve flags must not conflict. */
214 { .name = "incompatible resolve flags (BENEATH | IN_ROOT)",
215 .how.flags = O_RDONLY,
216 .how.resolve = RESOLVE_BENEATH | RESOLVE_IN_ROOT,
217 .err = -EINVAL },
218
213 /* ->resolve must only contain RESOLVE_* flags. */219 /* ->resolve must only contain RESOLVE_* flags. */
214 { .name = "invalid how.resolve and O_RDONLY",220 { .name = "invalid how.resolve and O_RDONLY",
215 .how.flags = O_RDONLY,221 .how.flags = O_RDONLY,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t