summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorGiampaolo Lauria <lauria2@yahoo.com>2011-06-28 12:19:08 -0400
committerAndrew Tridgell <tridge@samba.org>2011-07-21 10:32:23 +1000
commitc049b14dc19c01393d6837532e5bf4f2faeb4bbe (patch)
treea6e08092cb835ac54901c9d4a988310613ca41cb /source4/scripting/python
parenteb259a676db27ff43fc8d59f05a7f6698b8adec7 (diff)
downloadsamba-c049b14dc19c01393d6837532e5bf4f2faeb4bbe.tar.gz
samba-c049b14dc19c01393d6837532e5bf4f2faeb4bbe.tar.bz2
samba-c049b14dc19c01393d6837532e5bf4f2faeb4bbe.zip
samba-tool: moved export to domain dumpkeys
This is part of the samba-tool work to fit the object-action model Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index e021694ea6..d13f87e798 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -27,6 +27,7 @@ import samba.getopt as options
import ldb
import os
from samba import Ldb
+from samba.net import Net
from samba.auth import system_session
from samba.samdb import SamDB
from samba.dcerpc.samr import DOMAIN_PASSWORD_COMPLEX, DOMAIN_PASSWORD_STORE_CLEARTEXT
@@ -47,6 +48,27 @@ from samba.dsdb import (
+class cmd_domain_dumpkeys(Command):
+ """Dumps kerberos keys of the domain into a keytab"""
+ synopsis = "%prog domain dumpkeys <keytab>"
+
+ takes_optiongroups = {
+ "sambaopts": options.SambaOptions,
+ "credopts": options.CredentialsOptions,
+ "versionopts": options.VersionOptions,
+ }
+
+ takes_options = [
+ ]
+
+ takes_args = ["keytab"]
+
+ def run(self, keytab, credopts=None, sambaopts=None, versionopts=None):
+ lp = sambaopts.get_loadparm()
+ net = Net(None, lp, server=credopts.ipaddress)
+ net.export_keytab(keytab=keytab)
+
+
class cmd_domain_level(Command):
"""Raises domain and forest function levels"""
@@ -444,6 +466,7 @@ class cmd_domain(SuperCommand):
"""Domain management"""
subcommands = {}
+ subcommands["dumpkeys"] = cmd_domain_dumpkeys()
subcommands["level"] = cmd_domain_level()
subcommands["machinepassword"] = cmd_domain_machinepassword()
subcommands["passwordsettings"] = cmd_domain_passwordsettings()