Home
last modified time | relevance | path

Searched refs:dirfd (Results 1 – 25 of 53) sorted by relevance

123

/systemd-251/src/import/
Dimport-common.c209 if (fstatat(dirfd(d), child, &st, AT_SYMLINK_NOFOLLOW) < 0) in import_mangle_os_tree()
241 cd = xopendirat(dirfd(d), child, O_NOFOLLOW); in import_mangle_os_tree()
252 r = rename_noreplace(dirfd(d), child, dirfd(d), t); in import_mangle_os_tree()
260 r = rename_noreplace(dirfd(cd), de->d_name, dirfd(d), de->d_name); in import_mangle_os_tree()
265 if (unlinkat(dirfd(d), t, AT_REMOVEDIR) < 0) in import_mangle_os_tree()
268 r = futimens(dirfd(d), (struct timespec[2]) { st.st_atim, st.st_mtim }); in import_mangle_os_tree()
272 r = fchmod_and_chown(dirfd(d), st.st_mode, st.st_uid, st.st_gid); in import_mangle_os_tree()
/systemd-251/src/shared/
Dmkdir-label.c10 int mkdirat_label(int dirfd, const char *path, mode_t mode) { in mkdirat_label() argument
15 r = mac_selinux_create_file_prepare_at(dirfd, path, S_IFDIR); in mkdirat_label()
19 r = mkdirat_errno_wrapper(dirfd, path, mode); in mkdirat_label()
24 return mac_smack_fix_at(dirfd, path, 0); in mkdirat_label()
Dclean-ipc.c232 if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { in clean_posix_shm_internal()
244 kid = xopendirat(dirfd(dir), de->d_name, O_NOFOLLOW|O_NOATIME); in clean_posix_shm_internal()
261 if (unlinkat(dirfd(dir), de->d_name, AT_REMOVEDIR) < 0) { in clean_posix_shm_internal()
281 if (unlinkat(dirfd(dir), de->d_name, 0) < 0) { in clean_posix_shm_internal()
334 if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { in clean_posix_mq()
Dcopy.c949 if (fstatat(dirfd(d), de->d_name, &buf, AT_SYMLINK_NOFOLLOW) < 0) { in fd_copy_directory()
989 r = fd_is_mount_point(dirfd(d), de->d_name, 0); in fd_copy_directory()
996 …q = fd_copy_directory(dirfd(d), de->d_name, &buf, fdt, de->d_name, original_device, depth_left-1, … in fd_copy_directory()
998 …q = fd_copy_regular(dirfd(d), de->d_name, &buf, fdt, de->d_name, override_uid, override_gid, copy_… in fd_copy_directory()
1000 …q = fd_copy_symlink(dirfd(d), de->d_name, &buf, fdt, de->d_name, override_uid, override_gid, copy_… in fd_copy_directory()
1002 …q = fd_copy_fifo(dirfd(d), de->d_name, &buf, fdt, de->d_name, override_uid, override_gid, copy_fla… in fd_copy_directory()
1004 …q = fd_copy_node(dirfd(d), de->d_name, &buf, fdt, de->d_name, override_uid, override_gid, copy_fla… in fd_copy_directory()
1025 (void) copy_xattr(dirfd(d), fdt, copy_flags); in fd_copy_directory()
1103 int dirfd, in copy_directory_fd_full() argument
1113 assert(dirfd >= 0); in copy_directory_fd_full()
[all …]
Dcopy.h56 int copy_directory_fd_full(int dirfd, const char *to, CopyFlags copy_flags, copy_progress_path_t pr…
57 static inline int copy_directory_fd(int dirfd, const char *to, CopyFlags copy_flags) { in copy_directory_fd() argument
58 return copy_directory_fd_full(dirfd, to, copy_flags, NULL, NULL, NULL); in copy_directory_fd()
Dinstall-file.c81 static int unlinkat_maybe_dir(int dirfd, const char *pathname) { in unlinkat_maybe_dir() argument
86 if (unlinkat(dirfd, pathname, 0) < 0) { in unlinkat_maybe_dir()
90 if (unlinkat(dirfd, pathname, AT_REMOVEDIR) < 0) in unlinkat_maybe_dir()
Dchown-recursive.c74 path_fd = openat(dirfd(d), de->d_name, O_PATH|O_CLOEXEC|O_NOFOLLOW); in chown_recursive_internal()
103 r = chown_one(dirfd(d), st, uid, gid, mask); in chown_recursive_internal()
Drm-rf.c225 … r = unlinkat_harder(dirfd(todos[n_todo-1].dir), dirname, AT_REMOVEDIR, flags); in rm_rf_children()
236 fd = dirfd(d); /* Retrieve the file descriptor from the DIR object */ in rm_rf_children()
246 … fd = dirfd(d); /* We donated the fd to fdopendir(). Let's make sure we sure we have in rm_rf_children()
Ddiscover-image.c459 if (fstatat(dirfd(d), name, &st, flags) < 0) { in image_find()
469 if (fstatat(dirfd(d), raw, &st, flags) < 0) { in image_find()
479 r = image_make(name, dirfd(d), resolved, raw, &st, ret); in image_find()
485 r = image_make(name, dirfd(d), resolved, name, &st, ret); in image_find()
566 if (fstatat(dirfd(d), de->d_name, &st, flags) < 0) { in image_discover()
596 r = image_make(pretty, dirfd(d), resolved, de->d_name, &st, &image); in image_discover()
Dmkdir-label.h9 int mkdirat_label(int dirfd, const char *path, mode_t mode);
Dsmack-util.h37 int mac_smack_fix_at(int dirfd, const char *path, LabelFixFlags flags);
Dselinux-util.h45 int mac_selinux_create_file_prepare_at(int dirfd, const char *path, mode_t mode);
/systemd-251/src/basic/
Dfs-util.c509 int mkfifoat_atomic(int dirfd, const char *path, mode_t mode) { in mkfifoat_atomic() argument
523 if (mkfifoat(dirfd, t, mode) < 0) in mkfifoat_atomic()
526 if (renameat(dirfd, t, dirfd, path) < 0) { in mkfifoat_atomic()
1013 int open_mkdir_at(int dirfd, const char *path, int flags, mode_t mode) { in open_mkdir_at() argument
1048 parent_fd = openat(dirfd, parent, O_PATH|O_DIRECTORY|O_CLOEXEC); in open_mkdir_at()
1052 dirfd = parent_fd; in open_mkdir_at()
1056 r = RET_NERRNO(mkdirat(dirfd, path, mode)); in open_mkdir_at()
1067 fd = RET_NERRNO(openat(dirfd, path, (flags & ~O_EXCL)|O_DIRECTORY|O_NOFOLLOW)); in open_mkdir_at()
1079 (void) unlinkat(dirfd, path, AT_REMOVEDIR); in open_mkdir_at()
1087 int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, bool *ret_newly_crea… in openat_report_new() argument
[all …]
Dunit-file.c272 int dirfd, in unit_file_resolve_symlink() argument
292 assert(dirfd >= 0 || dirfd == AT_FDCWD); in unit_file_resolve_symlink()
294 r = readlinkat_malloc(dirfd, filename, &target); in unit_file_resolve_symlink()
501 r = readlinkat_malloc(dirfd(d), de->d_name, &target); in unit_file_build_name_map()
547 *dir, dirfd(d), de->d_name, in unit_file_build_name_map()
Dfs-util.h112 int open_mkdir_at(int dirfd, const char *path, int flags, mode_t mode);
114 int openat_report_new(int dirfd, const char *pathname, int flags, mode_t mode, bool *ret_newly_crea…
Dmkdir.c82 int mkdirat_errno_wrapper(int dirfd, const char *pathname, mode_t mode) { in mkdirat_errno_wrapper() argument
83 return RET_NERRNO(mkdirat(dirfd, pathname, mode)); in mkdirat_errno_wrapper()
Dunit-file.h43 int dirfd,
Dmkdir.h12 int mkdirat_errno_wrapper(int dirfd, const char *pathname, mode_t mode);
/systemd-251/src/udev/
Dudevadm-info.c314 if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) < 0) in cleanup_dir()
321 subdir = xopendirat(dirfd(dir), dent->d_name, O_NOFOLLOW); in cleanup_dir()
327 (void) unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR); in cleanup_dir()
329 (void) unlinkat(dirfd(dir), dent->d_name, 0); in cleanup_dir()
347 if (faccessat(dirfd(datadir), dent->d_name, F_OK, AT_SYMLINK_NOFOLLOW) >= 0) in cleanup_dir_after_db_cleanup()
352 (void) unlinkat(dirfd(dir), dent->d_name, 0); in cleanup_dir_after_db_cleanup()
365 if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) < 0) in cleanup_dirs_after_db_cleanup()
370 subdir = xopendirat(dirfd(dir), dent->d_name, O_NOFOLLOW); in cleanup_dirs_after_db_cleanup()
376 (void) unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR); in cleanup_dirs_after_db_cleanup()
378 (void) unlinkat(dirfd(dir), dent->d_name, 0); in cleanup_dirs_after_db_cleanup()
Dudev-watch.c56 r = device_new_from_watch_handle_at(&dev, dirfd(dir), wd); in udev_watch_restore()
67 (void) unlinkat(dirfd(dir), ent->d_name, 0); in udev_watch_restore()
/systemd-251/src/libsystemd/sd-journal/
Djournal-vacuum.c153 if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { in journal_directory_vacuum()
238 r = journal_file_empty(dirfd(d), p); in journal_directory_vacuum()
246 r = unlinkat_deallocate(dirfd(d), p, 0); in journal_directory_vacuum()
259 patch_realtime(dirfd(d), p, &st, &realtime); in journal_directory_vacuum()
290 r = unlinkat_deallocate(dirfd(d), list[i].filename, 0); in journal_directory_vacuum()
/systemd-251/src/coredump/
Dcoredump-vacuum.c160 … if (fstatat(dirfd(d), de->d_name, &st, AT_NO_AUTOMOUNT|AT_SYMLINK_NOFOLLOW) < 0) { in coredump_vacuum()
228 r = vacuum_necessary(dirfd(d), sum, keep_free, max_use); in coredump_vacuum()
232 r = unlinkat_deallocate(dirfd(d), worst->oldest_file, 0); in coredump_vacuum()
/systemd-251/src/nspawn/
Dnspawn-patch-uid.c341 if (fstatat(dirfd(d), de->d_name, &fst, AT_SYMLINK_NOFOLLOW) < 0) { in recurse_fd()
349 …subdir_fd = openat(dirfd(d), de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NO… in recurse_fd()
363 r = patch_fd(dirfd(d), de->d_name, &fst, shift); in recurse_fd()
375 r = patch_fd(d ? dirfd(d) : fd, NULL, st, shift); in recurse_fd()
/systemd-251/src/core/
Dsmack-setup.c78 dfd = dirfd(dir); in write_access2_rules()
143 dfd = dirfd(dir); in write_cipso2_rules()
202 dfd = dirfd(dir); in write_netlabel_rules()
/systemd-251/src/tmpfiles/
Dtmpfiles.c464 static DIR* xopendirat_nomod(int dirfd, const char *path) { in xopendirat_nomod() argument
467 dir = xopendirat(dirfd, path, O_NOFOLLOW|O_NOATIME); in xopendirat_nomod()
471 …log_debug_errno(errno, "Cannot open %sdirectory \"%s\": %m", dirfd == AT_FDCWD ? "" : "sub", path); in xopendirat_nomod()
475 dir = xopendirat(dirfd, path, O_NOFOLLOW); in xopendirat_nomod()
477 …log_debug_errno(errno, "Cannot open %sdirectory \"%s\": %m", dirfd == AT_FDCWD ? "" : "sub", path); in xopendirat_nomod()
591 dirfd(d), de->d_name, in dir_cleanup()
625 q = fd_is_mount_point(dirfd(d), de->d_name, 0); in dir_cleanup()
672 sub_dir = xopendirat_nomod(dirfd(d), de->d_name); in dir_cleanup()
680 if (flock(dirfd(sub_dir), LOCK_EX|LOCK_NB) < 0) { in dir_cleanup()
714 if (unlinkat(dirfd(d), de->d_name, AT_REMOVEDIR) < 0) in dir_cleanup()
[all …]

123