Commit a4aefbbd authored by Harald Sitter's avatar Harald Sitter 🎶

smb: accurately attempt to resolve the correct WSD host

this previously was the wrong variable. m_current_url is only set after
url checking while kurl would be the current url under check. this lead
to state confusion was implicit stat() calls from dolphin on host foo would
evaluate the previous host (e.g. bar) for the wsd suffix. this meant we'll
let a foo with suffix pass through the check, and that just mustn't ever
happen.

BUG: 420578
FIXED-IN: 20.04.1
parent d1ab6518
......@@ -234,8 +234,8 @@ QUrl SMBSlave::checkURL(const QUrl &kurl_) const
// NB: smbc has no way to resolve a name without also triggering auth etc.: we must
// rely on the system's ability to resolve DNSSD for this check.
const QLatin1String wsdSuffix(".kio-discovery-wsd");
if (m_current_url.host().endsWith(wsdSuffix)) {
QString host = m_current_url.host();
if (kurl.host().endsWith(wsdSuffix)) {
QString host = kurl.host();
host.chop(wsdSuffix.size());
const QString dnssd(host + ".local");
auto dnssdHost = QHostInfo::fromName(dnssd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment