https://bugs.kde.org/show_bug.cgi?id=103331

--- Comment #22 from Ahmad Samir <a.samir...@gmail.com> ---
Git commit de7aff60e81b05239fd3d6c17895c48a985dd27a by Ahmad Samir.
Committed on 19/09/2021 at 10:06.
Pushed by ahmadsamir into branch 'master'.

Fix permissions when copying files

This reverts commit 7863f595991c5, I was wrong :)

Reading the code some more (in copyjob, file_copy and file_unix), the
permissions arg is '-1' when we shouldn't touch the dest permissions at all,
i.e. leave them as the system default permissions for newly created files
(umask ...etc).

The scenarios are:
- calling KIO::copy() A to B, permissions are preserved by default, i.e. the
  job copies A's permissions to the permissions arg when it calls file_copy
- calling KIO::copy() A to B, and calling setDefaultPermissions(true),
  the job sets the permissions arg to '-1' when it calls file_copy
- calling KIO::file_copy() directly, the you have full control, if you want
  to preserve the permissions use A's permissions as the permissions arg,
  otherwise use '-1' to use the system default permissions

ACL attributes are handled implicitly at the moment, which isn't ideal but
can be improved later on.
Related: bug 404777

FIXED-IN: 5.87

M  +4    -6    src/core/filecopyjob.h
M  +15   -22   src/ioslaves/file/file_unix.cpp

https://invent.kde.org/frameworks/kio/commit/de7aff60e81b05239fd3d6c17895c48a985dd27a

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to