Lines Matching refs:dirfd

114 try_file_ops(int filefd, int dirfd, cap_rights_t rights)  in try_file_ops()  argument
138 REQUIRE(dfd_cap = cap_new(dirfd, rights)); in try_file_ops()
191 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
197 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
202 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
207 ret = openat(dirfd, "cap_fsync", O_CREAT, 0600); in try_file_ops()
234 CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0); in try_file_ops()
239 ret = openat(dirfd, "cap_ftruncate", O_CREAT, 0600); in try_file_ops()
254 CHECK(unlinkat(dirfd, "cap_ftruncate", 0) == 0); in try_file_ops()
260 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
266 CHECK(ret == -1 || unlinkat(dirfd, "cap_create", 0) == 0); in try_file_ops()
268 ret = openat(dirfd, "cap_fsync", O_CREAT, 0600); in try_file_ops()
287 CHECK(unlinkat(dirfd, "cap_fsync", 0) == 0); in try_file_ops()
296 ret = openat(dirfd, "cap_chflagsat", O_CREAT, 0600); in try_file_ops()
301 CHECK(unlinkat(dirfd, "cap_chflagsat", 0) == 0); in try_file_ops()
306 ret = openat(dirfd, "cap_fchownat", O_CREAT, 0600); in try_file_ops()
311 CHECK(unlinkat(dirfd, "cap_fchownat", 0) == 0); in try_file_ops()
316 ret = openat(dirfd, "cap_fchmodat", O_CREAT, 0600); in try_file_ops()
321 CHECK(unlinkat(dirfd, "cap_fchmodat", 0) == 0); in try_file_ops()
333 ret = openat(dirfd, "cap_fstatat", O_CREAT, 0600); in try_file_ops()
338 CHECK(unlinkat(dirfd, "cap_fstatat", 0) == 0); in try_file_ops()
349 ret = openat(dirfd, "cap_futimesat", O_CREAT, 0600); in try_file_ops()
354 CHECK(unlinkat(dirfd, "cap_futimesat", 0) == 0); in try_file_ops()
356 ret = openat(dirfd, "cap_linkat_src", O_CREAT, 0600); in try_file_ops()
359 ret = linkat(dirfd, "cap_linkat_src", dfd_cap, "cap_linkat_dst", 0); in try_file_ops()
361 CHECK(unlinkat(dirfd, "cap_linkat_src", 0) == 0); in try_file_ops()
362 CHECK(ret == -1 || unlinkat(dirfd, "cap_linkat_dst", 0) == 0); in try_file_ops()
366 CHECK(ret == -1 || unlinkat(dirfd, "cap_mkdirat", AT_REMOVEDIR) == 0); in try_file_ops()
370 CHECK(ret == -1 || unlinkat(dirfd, "cap_mkfifoat", 0) == 0); in try_file_ops()
374 CHECK(ret == -1 || unlinkat(dirfd, "cap_mknodat", 0) == 0); in try_file_ops()
380 CHECK(ret == -1 || unlinkat(dirfd, "cap_symlinkat", 0) == 0); in try_file_ops()
382 ret = openat(dirfd, "cap_unlinkat", O_CREAT, 0600); in try_file_ops()
387 CHECK(ret == 0 || unlinkat(dirfd, "cap_unlinkat", 0) == 0); in try_file_ops()
388 ret = mkdirat(dirfd, "cap_unlinkat", 0700); in try_file_ops()
392 CHECK(ret == 0 || unlinkat(dirfd, "cap_unlinkat", AT_REMOVEDIR) == 0); in try_file_ops()
420 success = try_file_ops(filefd, dirfd, (rights)); \
423 try_file_ops(filefd, dirfd, (rights)); \
435 int filefd, dirfd, tmpfd; in test_capabilities() local
447 dirfd = open(dir, O_RDONLY | O_DIRECTORY); in test_capabilities()
448 if (dirfd == -1) { in test_capabilities()