1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

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>
This commit is contained in:
Andrew Tridgell 2010-08-17 15:20:11 +10:00
parent 896f10301c
commit 82c171aa55

View File

@ -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)