Skip to content

Commit

Permalink
fix: [smb] Not show smb default domain.
Browse files Browse the repository at this point in the history
Get the smb default domain from smb.conf, and show it.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-263539.html
  • Loading branch information
GongHeng2017 authored and liyigang1 committed Sep 3, 2024
1 parent 861bb5a commit b815baf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dfm-mount/private/dnetworkmounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static constexpr char kLoginDomain[] { "domain" };
static constexpr char kLoginPasswd[] { "passwd" };
static constexpr char kLoginTimeout[] { "timeout" };
static constexpr char kMountFsType[] { "fsType" };
static constexpr char kSmbConfigPath[] { "/etc/samba/smb.conf" };

static constexpr char kDaemonMountRetKeyMpt[] { "mountPoint" };
static constexpr char kDaemonMountRetKeyErrno[] { "errno" };
Expand Down Expand Up @@ -240,9 +241,9 @@ void DNetworkMounter::mountByDaemon(const QString &address, GetMountPassInfo get
{
auto requestLoginInfo = [address, getPassInfo] {
if (getPassInfo) {
QSettings settings("/etc/samba/smb.conf", QSettings::IniFormat);
QSettings setting(kSmbConfigPath, QSettings::IniFormat);
return getPassInfo(QObject::tr("need authorization to access %1").arg(address),
Utils::currentUser(), settings.value("global/workgroup", "WORKGROUP").toString());
Utils::currentUser(), setting.value("global/workgroup", "WORKGROUP").toString());
}
return MountPassInfo();
};
Expand Down

0 comments on commit b815baf

Please sign in to comment.