summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-11-29 12:47:40 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-11-29 09:20:54 +0100
commit2bff209128b85bd870ad36fa00ffcc92edbbab08 (patch)
tree751e775ca78eda99455f88f9e8057611150f76c5 /source4/scripting/python
parent8eef716598fa30b216ba144c74bcf5dfcfa870fd (diff)
downloadsamba-2bff209128b85bd870ad36fa00ffcc92edbbab08.tar.gz
samba-2bff209128b85bd870ad36fa00ffcc92edbbab08.tar.bz2
samba-2bff209128b85bd870ad36fa00ffcc92edbbab08.zip
s4-samba-tool: Add --principal argument to samba-tool domain exportkeytab
This allows only a particular principal to be exported to the keytab. This is useful when setting up unix servers in a Samba controlled domain. Based on a request by Gémes Géza <geza@kzsdabas.hu> Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Nov 29 09:20:55 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/netcmd/domain.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py
index a41a9d6734..88d0d70320 100644
--- a/source4/scripting/python/samba/netcmd/domain.py
+++ b/source4/scripting/python/samba/netcmd/domain.py
@@ -66,14 +66,15 @@ class cmd_domain_export_keytab(Command):
synopsis = "%prog <keytab> [options]"
takes_options = [
+ Option("--principal", help="extract only this principal", type=str),
]
takes_args = ["keytab"]
- def run(self, keytab, credopts=None, sambaopts=None, versionopts=None):
+ def run(self, keytab, credopts=None, sambaopts=None, versionopts=None, principal=None):
lp = sambaopts.get_loadparm()
- net = Net(None, lp, server=credopts.ipaddress)
- net.export_keytab(keytab=keytab)
+ net = Net(None, lp)
+ net.export_keytab(keytab=keytab, principal=principal)
class cmd_domain_info(Command):
"""Print basic info about a domain and the DC passed as parameter"""