Do not leak the local user in the device name.

Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
This commit is contained in:
Albert Vaca Cintora 2020-09-24 17:01:03 +02:00
parent f183b5447b
commit b279c52101

View file

@ -90,13 +90,7 @@ KdeConnectConfig::KdeConnectConfig()
QString KdeConnectConfig::name() QString KdeConnectConfig::name()
{ {
QString username; QString defaultName = QHostInfo::localHostName();
#ifdef Q_OS_WIN
username = QString::fromLatin1(qgetenv("USERNAME"));
#else
username = QString::fromLatin1(qgetenv("USER"));
#endif
QString defaultName = username + QStringLiteral("@") + QHostInfo::localHostName();
QString name = d->m_config->value(QStringLiteral("name"), defaultName).toString(); QString name = d->m_config->value(QStringLiteral("name"), defaultName).toString();
return name; return name;
} }