Commit 51c00963 authored by David Faure's avatar David Faure

NTFS doesn't support chmod, so ignore chmod errors when copying files.

FUSE doesn't make it easy to detect NTFS mounts, though...
In this code we have to hardcode "fuseblk" and hope that more recent versions
of FUSE indeed show "fuseblk.ntfs-3g" instead, as a bug report suggested.

But even worse: I want to replace this code with KFileSystemType which
uses statvfs(), which is much faster and less code, but on linux that method
returns the same number (FUSE_SUPER_MAGIC, 0x65735546) for all fuse filesystems :(

Also add SMB/CIFS mounts to the list of filsystems "made by microsoft and therefore
doesn't support chown, chmod, utime, nor proper symlinks".

FIXED-IN: 4.9.1
BUG: 206500
parent 73ea8cee
......@@ -529,12 +529,17 @@ bool KMountPoint::probablySlow() const
bool KMountPoint::testFileSystemFlag(FileSystemFlag flag) const
const bool isMsDos = ( d->mountType == QLatin1String("msdos") || d->mountType == QLatin1String("fat") || d->mountType == QLatin1String("vfat") );
const bool isNtfs = d->mountType.contains(QLatin1String("fuse.ntfs")) || d->mountType.contains(QLatin1String("fuseblk.ntfs"))
// fuseblk could really be anything. But its most common use is for NTFS mounts, these days.
|| d->mountType == QLatin1String("fuseblk");
const bool isSmb = d->mountType == QLatin1String("cifs") || d->mountType == QLatin1String("smbfs");
switch (flag) {
case SupportsChmod:
case SupportsChown:
case SupportsUTime:
case SupportsSymlinks:
return !isMsDos; // it's amazing the number of things FAT doesn't support :)
return !isMsDos && !isNtfs && !isSmb; // it's amazing the number of things Microsoft filesystems don't support :)
case CaseInsensitive:
return isMsDos;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment