Skip to content
Snippets Groups Projects
Commit 4c9055ac authored by Colin Walters's avatar Colin Walters
Browse files

Merge branch 'pr/glnx-no-chown' into 'master'

glnx_file_copy_at: Add GLNX_FILE_COPY_NOCHOWN

See merge request GNOME/libglnx!22
parents 900caea6 1345882d
No related branches found
No related tags found
No related merge requests found
......@@ -1000,8 +1000,11 @@ glnx_file_copy_at (int src_dfd,
if (glnx_regfile_copy_bytes (src_fd, tmp_dest.fd, (off_t) -1) < 0)
return glnx_throw_errno_prefix (error, "regfile copy");
if (fchown (tmp_dest.fd, src_stbuf->st_uid, src_stbuf->st_gid) != 0)
return glnx_throw_errno_prefix (error, "fchown");
if (!(copyflags & GLNX_FILE_COPY_NOCHOWN))
{
if (fchown (tmp_dest.fd, src_stbuf->st_uid, src_stbuf->st_gid) != 0)
return glnx_throw_errno_prefix (error, "fchown");
}
if (!(copyflags & GLNX_FILE_COPY_NOXATTRS))
{
......
......@@ -189,7 +189,8 @@ glnx_regfile_copy_bytes (int fdf, int fdt, off_t max_bytes);
typedef enum {
GLNX_FILE_COPY_OVERWRITE = (1 << 0),
GLNX_FILE_COPY_NOXATTRS = (1 << 1),
GLNX_FILE_COPY_DATASYNC = (1 << 2)
GLNX_FILE_COPY_DATASYNC = (1 << 2),
GLNX_FILE_COPY_NOCHOWN = (1 << 3)
} GLnxFileCopyFlags;
gboolean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment