Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > e80bd2e078075aac54a10812bcdc4bc6 > files > 26

kdelibs4-4.6.5-1.7.mga1.src.rpm

commit 51c00963ce4d27b016cf11f71a96dea7a9da02af
Author: David Faure <faure@kde.org>
Date:   Mon Aug 20 20:51:59 2012 +0200

    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

diff --git a/kdecore/io/kmountpoint.cpp b/kdecore/io/kmountpoint.cpp
index 8e53dd1..aa7a6b1 100644
--- a/kdecore/io/kmountpoint.cpp
+++ b/kdecore/io/kmountpoint.cpp
@@ -529,12 +529,19 @@
 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;
     }