From 82c171aa558c6b9ea0455915c9a2a2286498b8ea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 17 Aug 2010 15:20:11 +1000 Subject: 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 --- source4/scripting/python/samba/netcmd/setpassword.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4') 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) -- cgit