1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

samba-tool: Fix domain machinepassword name search

Append '$' to name provided by user to search for a machine account
when necessary
This commit is contained in:
Giampaolo Lauria 2011-11-01 15:25:31 -04:00 committed by Andrew Tridgell
parent 46723aa2da
commit ec5afae292

View File

@ -351,6 +351,8 @@ class cmd_domain_machinepassword(Command):
url = os.path.join(path, name)
if not os.path.exists(url):
raise CommandError("secret database not found at %s " % url)
if not secret.endswith('$'):
secret += '$'
secretsdb = Ldb(url=url, session_info=system_session(),
credentials=creds, lp=lp)
result = secretsdb.search(attrs=["secret"],