summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-08-17 15:20:11 +1000
committerAndrew Tridgell <tridge@samba.org>2010-08-17 21:21:51 +1000
commit82c171aa558c6b9ea0455915c9a2a2286498b8ea (patch)
tree190cd1c6b89d158f10fabf7d3d6acc8dbdeb9de7 /source4/scripting
parent896f10301cc3db10793cac115bcbca0f58f0f010 (diff)
downloadsamba-82c171aa558c6b9ea0455915c9a2a2286498b8ea.tar.gz
samba-82c171aa558c6b9ea0455915c9a2a2286498b8ea.tar.bz2
samba-82c171aa558c6b9ea0455915c9a2a2286498b8ea.zip
s4-net: use an encrypted ldap session when setting passwords
this allows for "net setpassword -H ldap://server -Uusername%password USERNAME" to set a password remotely on a windows DC Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/netcmd/setpassword.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/netcmd/setpassword.py b/source4/scripting/python/samba/netcmd/setpassword.py
index d4451d4d8f..e01fa23ab9 100644
--- a/source4/scripting/python/samba/netcmd/setpassword.py
+++ b/source4/scripting/python/samba/netcmd/setpassword.py
@@ -25,6 +25,7 @@ from samba.netcmd import Command, CommandError, Option
from getpass import getpass
from samba.auth import system_session
from samba.samdb import SamDB
+from samba import gensec
class cmd_setpassword(Command):
"""(Re)sets the password on a user account"""
@@ -64,6 +65,8 @@ class cmd_setpassword(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
+ creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
+
samdb = SamDB(url=H, session_info=system_session(),
credentials=creds, lp=lp)