Index: src/ioslaves/file/file.cpp =================================================================== --- src/ioslaves/file/file.cpp +++ src/ioslaves/file/file.cpp @@ -752,8 +752,11 @@ if (_mode != -1 && !(_flags & KIO::Resume)) { if (!QFile::setPermissions(dest_orig, modeToQFilePermissions(_mode))) { // couldn't chmod. Eat the error if the filesystem apparently doesn't support it. - if (tryChangeFileAttr(CHMOD, {dest_orig, _mode}, errno)) { - warning(i18n("Could not change permissions for\n%1", dest_orig)); + KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(dest_orig); + if (mp && mp->testFileSystemFlag(KMountPoint::SupportsChmod)) { + if (tryChangeFileAttr(CHMOD, {dest_orig, _mode}, errno)) { + warning(i18n("Could not change permissions for\n%1", dest_orig)); + } } } } Index: src/ioslaves/file/file_unix.cpp =================================================================== --- src/ioslaves/file/file_unix.cpp +++ src/ioslaves/file/file_unix.cpp @@ -351,8 +351,13 @@ || (acl && acl_set_file(_dest.data(), ACL_TYPE_ACCESS, acl) != 0) #endif ) { - if (tryChangeFileAttr(CHMOD, {_dest, _mode}, errno)) { - warning(i18n("Could not change permissions for '%1'", dest)); + const int errCode = errno; + KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(dest); + // Eat the error if the filesystem apparently doesn't support chmod. + if (mp && mp->testFileSystemFlag(KMountPoint::SupportsChmod)) { + if (tryChangeFileAttr(CHMOD, {_dest, _mode}, errCode)) { + warning(i18n("Could not change permissions for '%1'", dest)); + } } } #if HAVE_POSIX_ACL @@ -789,14 +794,6 @@ return PrivilegeOperationReturnValue::failure(errcode); } - if (action == CHMOD || action == CHOWN || action == UTIME) { - KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath(args.first().toString()); - // Test for chmod and utime will return the same result as test for chown. - if (mp && !mp->testFileSystemFlag(KMountPoint::SupportsChown)) { - return PrivilegeOperationReturnValue::failure(errcode); - } - } - QByteArray helperArgs; QDataStream out(&helperArgs, QIODevice::WriteOnly); out << action;