Add warning for failed chown in libsync/propagatedownload.cpp
authorMichael Schuster <michael@schuster.ms>
Mon, 16 Sep 2019 18:26:18 +0000 (20:26 +0200)
committerMichael Schuster <michael@schuster.ms>
Mon, 16 Sep 2019 18:26:18 +0000 (20:26 +0200)
In addition to PR 1409 generate warnings if chown fails.

See: https://github.com/nextcloud/desktop/pull/1409

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/libsync/propagatedownload.cpp

index a0d1bd6bccfee73ebb323b084883a88b1e65c798..56b3b1162c8d1209eb3008ad203d71c83acb22e2 100644 (file)
@@ -800,7 +800,8 @@ namespace { // Anonymous namespace for the recall feature
 #ifdef Q_OS_UNIX
         int chownErr = chown(fileName.toLocal8Bit().constData(), -1, fi.groupId());
         if (chownErr) {
-            // TODO: Error handling!
+            // TODO: Consider further error handling!
+            qCWarning(lcPropagateDownload) << QString("preserveGroupOwnership: chown error %1: setting group %2 failed on file %3").arg(chownErr).arg(fi.groupId()).arg(fileName);
         }
 #else
         Q_UNUSED(fileName);