summaryrefslogtreecommitdiff
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
commit695b346ab5123c9b4de4951a01add884795ede89 (patch)
treec9258117db4da6d1df515128512d0872031c3119
parent669358c05f8300dc14cc462a0d00eab86dc0e84a (diff)
downloadsamba-695b346ab5123c9b4de4951a01add884795ede89.tar.gz
samba-695b346ab5123c9b4de4951a01add884795ede89.tar.bz2
samba-695b346ab5123c9b4de4951a01add884795ede89.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!) (This used to be commit fe1e6233c6f0a5654bcc3ab34f65bb570efc69b1)
-rw-r--r--source3/libads/ldap.c6
1 files changed, 5 insertions, 1 deletions
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);