From f057cb4f84f0aafd8c1ecc046b8c92f2fb812f87 Mon Sep 17 00:00:00 2001 From: Giampaolo Lauria Date: Fri, 11 Nov 2011 10:37:39 -0500 Subject: samba-tool: Remove "domain machinepassword" command As per Andrew Bartlett's comment: "we should remove it. This was originally a script to support some interactions between samba3 and samba4, when they were in distinct build systems. We now can call between the two systems without difficulty at runtime, so this command has no value." Signed-off-by: Amitay Isaacs --- source4/scripting/python/samba/netcmd/domain.py | 28 ------------------------- 1 file changed, 28 deletions(-) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index 35e9d29f2c..f1ebf7e2ba 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -336,33 +336,6 @@ class cmd_domain_level(Command): -class cmd_domain_machinepassword(Command): - """Gets a machine password out of our SAM""" - - synopsis = "%prog [options]" - - takes_args = ["accountname"] - - def run(self, accountname, sambaopts=None, credopts=None, versionopts=None): - lp = sambaopts.get_loadparm() - creds = credopts.get_credentials(lp, fallback_machine=True) - url = lp.private_path("secrets.ldb") - if not os.path.exists(url): - raise CommandError("secrets database not found at %s " % url) - if not accountname.endswith('$'): - accountname += '$' - secretsdb = Ldb(url=url, session_info=system_session(), - credentials=creds, lp=lp) - result = secretsdb.search(attrs=["secret"], - expression="(&(objectclass=primaryDomain)(samaccountname=%s))" % ldb.binary_encode(accountname)) - - if len(result) != 1: - raise CommandError("search returned %d records, expected 1" % len(result)) - - self.outf.write("%s\n" % result[0]["secret"]) - - - class cmd_domain_passwordsettings(Command): """Sets password settings @@ -640,6 +613,5 @@ class cmd_domain(SuperCommand): subcommands["exportkeytab"] = cmd_domain_export_keytab() subcommands["join"] = cmd_domain_join() subcommands["level"] = cmd_domain_level() - subcommands["machinepassword"] = cmd_domain_machinepassword() subcommands["passwordsettings"] = cmd_domain_passwordsettings() subcommands["samba3upgrade"] = cmd_domain_samba3upgrade() -- cgit