summaryrefslogtreecommitdiffstats
path: root/source/libads/ldap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-12 02:28:27 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-12 02:28:27 +0000
commitfe1e6233c6f0a5654bcc3ab34f65bb570efc69b1 (patch)
tree44704e581e82b6e3c43f3b118dbd93f6c5609fa4 /source/libads/ldap.c
parentd3fdce07ab5955abd1f923127ae9eb5006aea505 (diff)
downloadsamba-fe1e6233c6f0a5654bcc3ab34f65bb570efc69b1.tar.gz
samba-fe1e6233c6f0a5654bcc3ab34f65bb570efc69b1.tar.xz
samba-fe1e6233c6f0a5654bcc3ab34f65bb570efc69b1.zip
fix setting machine passwords in the case where a user account of the
same name as the machine name exists. (we ended up setting the users password, not the machines password!)
Diffstat (limited to 'source/libads/ldap.c')
-rw-r--r--source/libads/ldap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index 0f41269e3ae..9d15c4e33cc 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -1231,7 +1231,11 @@ ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
strlower(host);
- asprintf(&principal, "%s@%s", host, ads->realm);
+ /*
+ we need to use the '$' form of the name here, as otherwise the
+ server might end up setting the password for a user instead
+ */
+ asprintf(&principal, "%s$@%s", host, ads->realm);
status = krb5_set_password(ads->kdc_server, principal, password);