From 695b346ab5123c9b4de4951a01add884795ede89 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Jul 2002 02:28:27 +0000 Subject: 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!) (This used to be commit fe1e6233c6f0a5654bcc3ab34f65bb570efc69b1) --- source3/libads/ldap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 0f41269e3a..9d15c4e33c 100644 --- a/source3/libads/ldap.c +++ b/source3/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); -- cgit