Skip to content

Commit

Permalink
fix: Obtain domain name when mounting SMB
Browse files Browse the repository at this point in the history
Obtain domain name from configuration file

Log: Get workgroups under the specified configuration file
  • Loading branch information
yang233000 committed Jul 2, 2024
1 parent f13e1e6 commit 0dec1f8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/dfm-mount/private/dnetworkmounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ QList<QVariantMap> DNetworkMounter::loginPasswd(const QString &address)
auto info = static_cast<QVariantMap *>(vm);
if (!info)
return;
info->insert(static_cast<char *>(k), static_cast<char *>(v));
info->insert(static_cast<char *>(k), QString(static_cast<char *>(v)));
qInfo() << "found saved login info:" << *info;
},
&attr);
Expand Down Expand Up @@ -214,9 +214,11 @@ void DNetworkMounter::mountByDaemon(const QString &address, GetMountPassInfo get
DeviceOperateCallbackWithMessage mountResult, int secs)
{
auto requestLoginInfo = [address, getPassInfo] {
if (getPassInfo)
if (getPassInfo) {
QSettings settings("/etc/samba/smb.conf", QSettings::IniFormat);
return getPassInfo(QObject::tr("need authorization to access %1").arg(address),
Utils::currentUser(), "WORKGROUP");
Utils::currentUser(), settings.value("global/workgroup", "WORKGROUP").toString());
}
return MountPassInfo();
};
auto checkThread = [] {
Expand Down

0 comments on commit 0dec1f8

Please sign in to comment.