diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-07-12 02:28:27 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-07-12 02:28:27 +0000 |
commit | fe1e6233c6f0a5654bcc3ab34f65bb570efc69b1 (patch) | |
tree | 44704e581e82b6e3c43f3b118dbd93f6c5609fa4 /source/libads/ldap.c | |
parent | d3fdce07ab5955abd1f923127ae9eb5006aea505 (diff) | |
download | samba-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.c | 6 |
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); |