[Pkg-owncloud-commits] [owncloud-client] 103/470: Downloads: Preserve group ownership #4330
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu May 12 16:24:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit c554f5383c9b418b057f1ae81b55c2e62a930b04
Author: Christian Kamm <mail at ckamm.de>
Date: Thu Mar 3 11:50:06 2016 +0100
Downloads: Preserve group ownership #4330
---
src/libsync/propagatedownload.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp
index 5e58a09..73f999c 100644
--- a/src/libsync/propagatedownload.cpp
+++ b/src/libsync/propagatedownload.cpp
@@ -637,6 +637,16 @@ static void handleRecallFile(const QString &fn)
FileSystem::uncheckedRenameReplace(fpath, rpath, &error);
}
}
+
+static void preserveGroupOwnership(const QString& fileName, const QFileInfo& fi)
+{
+#ifdef Q_OS_UNIX
+ chown(fileName.toLocal8Bit().constData(), -1, fi.groupId());
+#else
+ Q_UNUSED(fileName);
+ Q_UNUSED(fi);
+#endif
+}
} // end namespace
void PropagateDownloadFileQNAM::downloadFinished(const QByteArray& transportChecksumType,
@@ -682,6 +692,7 @@ void PropagateDownloadFileQNAM::downloadFinished(const QByteArray& transportChec
if (existingFile.permissions() != _tmpFile.permissions()) {
_tmpFile.setPermissions(existingFile.permissions());
}
+ preserveGroupOwnership(_tmpFile.fileName(), existingFile);
// Check whether the existing file has changed since the discovery
// phase by comparing size and mtime to the previous values. This
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list