Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-130486 / 13.3 / Fix another case where incorrect passdb path used #14159

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/middlewared/middlewared/plugins/smb_/passdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from middlewared.service import Service, job, private
from middlewared.service_exception import CallError
from middlewared.utils import Popen, run
from middlewared.plugins.smb import SMBCmd
from middlewared.plugins.smb import SMBCmd, SMBPath

import os
import subprocess
Expand Down Expand Up @@ -35,7 +35,7 @@ async def passdb_list(self, verbose=False):
local users in an AD environment. Immediately return in ldap enviornment.
"""
pdbentries = []
private_dir = await self.middleware.call('smb.getparm', 'privatedir', 'global')
private_dir = SMBPath.PASSDB_DIR.path
if not os.path.exists(f'{private_dir}/passdb.tdb'):
return pdbentries

Expand Down Expand Up @@ -146,9 +146,7 @@ async def passdb_reinit(self, conf_users):
`conf_users` contains results of `user.query`. Since users will receive new
SID values, we will need to flush samba's cache to ensure consistency.
"""
private_dir = await self.middleware.call('smb.getparm',
'private dir',
'global')
private_dir = SMBPath.PASSDB_DIR.path
ts = int(time.time())
old_path = f'{private_dir}/passdb.tdb'
new_path = f'{private_dir}/passdb.{ts}.corrupted'
Expand Down
Loading