Commits

medoc committed 9b7e47f

Ignore empty mime_type extended attribute returned by bug in CIFS linux kernel module (samba mounts)

Comments (0)

Files changed (1)

src/index/mimetype.cpp

     // Extended attribute has priority on everything, as per:
     // http://freedesktop.org/wiki/CommonExtendedAttributes
     if (pxattr::get(fn, "mime_type", &mtype)) {
+	LOGDEB0(("Mimetype: 'mime_type' xattr : [%s]\n", mtype.c_str()));
+	if (mtype.empty()) {
+	    LOGDEB0(("Mimetype: getxattr() returned empty mime type !\n"));
+	} else {
+	    return mtype;
+	}
+    }
+
+    if (cfg == 0)  {
+	LOGERR(("Mimetype: null config ??\n"));
 	return mtype;
     }
 
-    if (cfg == 0) // ?!?
-	return mtype;
-
     if (cfg->inStopSuffixes(fn)) {
 	LOGDEB(("mimetype: fn [%s] in stopsuffixes\n", fn.c_str()));
 	return mtype;