Lines Matching refs:dirfd

112 try_file_ops(int filefd, int dirfd, cap_rights_t rights)  in try_file_ops()  argument
136 REQUIRE(dfd_cap = cap_new(dirfd, rights)); in try_file_ops()
189 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
195 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
200 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
205 ret = openat(dirfd, "cap_fsync", O_CREAT, 0600); in try_file_ops()
232 CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0); in try_file_ops()
237 ret = openat(dirfd, "cap_ftruncate", O_CREAT, 0600); in try_file_ops()
252 CHECK(unlinkat(dirfd, "cap_ftruncate", 0) == 0); in try_file_ops()
258 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
264 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
266 ret = openat(dirfd, "cap_fsync", O_CREAT, 0600); in try_file_ops()
285 CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0); in try_file_ops()
294 ret = openat(dirfd, "cap_chflagsat", O_CREAT, 0600); in try_file_ops()
299 CHECK(unlinkat(dirfd, "cap_chflagsat", 0) == 0); in try_file_ops()
304 ret = openat(dirfd, "cap_fchownat", O_CREAT, 0600); in try_file_ops()
309 CHECK(unlinkat(dirfd, "cap_fchownat", 0) == 0); in try_file_ops()
314 ret = openat(dirfd, "cap_fchmodat", O_CREAT, 0600); in try_file_ops()
319 CHECK(unlinkat(dirfd, "cap_fchmodat", 0) == 0); in try_file_ops()
331 ret = openat(dirfd, "cap_fstatat", O_CREAT, 0600); in try_file_ops()
336 CHECK(unlinkat(dirfd, "cap_fstatat", 0) == 0); in try_file_ops()
347 ret = openat(dirfd, "cap_futimesat", O_CREAT, 0600); in try_file_ops()
352 CHECK(unlinkat(dirfd, "cap_futimesat", 0) == 0); in try_file_ops()
354 ret = openat(dirfd, "cap_linkat_src", O_CREAT, 0600); in try_file_ops()
357 ret = linkat(dirfd, "cap_linkat_src", dfd_cap, "cap_linkat_dst", 0); in try_file_ops()
359 CHECK(unlinkat(dirfd, "cap_linkat_src", 0) == 0); in try_file_ops()
360 CHECK(ret == -1 || unlinkat(dirfd, "cap_linkat_dst", 0) == 0); in try_file_ops()
364 CHECK(ret == -1 || unlinkat(dirfd, "cap_mkdirat", AT_REMOVEDIR) == 0); in try_file_ops()
368 CHECK(ret == -1 || unlinkat(dirfd, "cap_mkfifoat", 0) == 0); in try_file_ops()
372 CHECK(ret == -1 || unlinkat(dirfd, "cap_mknodat", 0) == 0); in try_file_ops()
378 CHECK(ret == -1 || unlinkat(dirfd, "cap_symlinkat", 0) == 0); in try_file_ops()
380 ret = openat(dirfd, "cap_unlinkat", O_CREAT, 0600); in try_file_ops()
385 CHECK(ret == 0 || unlinkat(dirfd, "cap_unlinkat", 0) == 0); in try_file_ops()
386 ret = mkdirat(dirfd, "cap_unlinkat", 0700); in try_file_ops()
390 CHECK(ret == 0 || unlinkat(dirfd, "cap_unlinkat", AT_REMOVEDIR) == 0); in try_file_ops()
418 success = try_file_ops(filefd, dirfd, (rights)); \
421 try_file_ops(filefd, dirfd, (rights)); \
433 int filefd, dirfd, tmpfd; in test_capabilities() local
445 dirfd = open(dir, O_RDONLY | O_DIRECTORY); in test_capabilities()
446 if (dirfd == -1) { in test_capabilities()