samba-tool: Fix domain machinepassword name search
authorGiampaolo Lauria <lauria2@yahoo.com>
Tue, 1 Nov 2011 19:25:31 +0000 (15:25 -0400)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Nov 2011 03:24:21 +0000 (14:24 +1100)
Append '$' to name provided by user to search for a machine account
when necessary

source4/scripting/python/samba/netcmd/domain.py

index 10bcfda7eb8bde254cd985fadd56e945903fd27d..9aaecd563c455a92ffe0f6fdfdf0aef046eaeaef 100644 (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"],