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

This commit is contained in:
Jean-Francois Dockes 2013-06-17 11:52:04 +02:00
parent 9d25a0475f
commit e515b9a9f9

View File

@ -134,11 +134,18 @@ string mimetype(const string &fn, const struct stat *stp,
// Extended attribute has priority on everything, as per:
// http://freedesktop.org/wiki/CommonExtendedAttributes
if (pxattr::get(fn, "mime_type", &mtype)) {
return 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) // ?!?
if (cfg == 0) {
LOGERR(("Mimetype: null config ??\n"));
return mtype;
}
if (cfg->inStopSuffixes(fn)) {
LOGDEB(("mimetype: fn [%s] in stopsuffixes\n", fn.c_str()));