-unix_set_owner_and_group(int fd, const char *path, uid_t uid, gid_t gid)
-{
- if (fd >= 0 && !fchown(fd, uid, gid))
- return 0;
- if (fd < 0 && !lchown(path, uid, gid))
- return 0;
- return WIMLIB_ERR_SET_SECURITY;
-}
-
-static int
-unix_set_mode(int fd, const char *path, mode_t mode)
-{
- if (fd >= 0 && !fchmod(fd, mode))
- return 0;
- if (fd < 0 && !chmod(path, mode))
- return 0;
- return WIMLIB_ERR_SET_SECURITY;
-}
-
-/*
- * Set metadata on an extracted file.
- *
- * @fd is an open file descriptor to the extracted file, or -1. @path is the
- * path to the extracted file, or NULL. If valid, this function uses @fd.
- * Otherwise, if valid, it uses @path. Otherwise, it calculates the path to one
- * alias of the extracted file and uses it.
- */
-static int
-unix_set_metadata(int fd, const struct wim_inode *inode,
- const char *path, struct unix_apply_ctx *ctx)