diff options
author | 2010-10-08 16:30:18 +0100 | |
---|---|---|
committer | 2010-10-08 16:30:18 +0100 | |
commit | 203a470e881a367029d3c82242305795a28b5c3e (patch) | |
tree | a752ed8a1eb420c6572d3c2bafe468c6cea89208 | |
parent | 2856841b1949ab5e1287ba3f31ab4c57e45c0c7b (diff) | |
download | paludis-203a470e881a367029d3c82242305795a28b5c3e.tar.gz paludis-203a470e881a367029d3c82242305795a28b5c3e.tar.xz |
XFS fallocate clobbers set*id bits
-rw-r--r-- | paludis/fs_merger.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/paludis/fs_merger.cc b/paludis/fs_merger.cc index 57413f51e..63fb98ade 100644 --- a/paludis/fs_merger.cc +++ b/paludis/fs_merger.cc @@ -390,11 +390,6 @@ FSMerger::install_file(const FSPath & src, const FSPath & dst_dir, const std::st if (0 != ::fchown(output_fd, src_stat.owner(), src_stat.group())) throw FSMergerError("Cannot fchown '" + stringify(dst) + "': " + stringify(::strerror(errno))); - /* set*id bits */ - if (0 != ::fchmod(output_fd, src_perms)) - throw FSMergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno))); - try_to_copy_xattrs(src, output_fd, result); - #ifdef HAVE_FALLOCATE if (0 != ::fallocate(output_fd, FALLOC_FL_KEEP_SIZE, 0, src_stat.file_size())) switch (errno) @@ -413,6 +408,11 @@ FSMerger::install_file(const FSPath & src, const FSPath & dst_dir, const std::st } #endif + /* set*id bits, after fallocate because xfs is weird */ + if (0 != ::fchmod(output_fd, src_perms)) + throw FSMergerError("Cannot fchmod '" + stringify(dst) + "': " + stringify(::strerror(errno))); + try_to_copy_xattrs(src, output_fd, result); + char buf[4096]; ssize_t count; while ((count = read(input_fd, buf, 4096)) > 0) |