summaryrefslogtreecommitdiff
path: root/source3/libads/ldap.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-20 03:54:52 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-20 03:54:52 +0000
commit6c7e9dfb293f1243d9d8d8a2ac50ef12d738198e (patch)
tree06d8b7089381fa14e9c353a0a6a5d2c4b80ac082 /source3/libads/ldap.c
parent2fe6d5d5a1025007a3e67d6040c1962734cbb6ea (diff)
downloadsamba-6c7e9dfb293f1243d9d8d8a2ac50ef12d738198e.tar.gz
samba-6c7e9dfb293f1243d9d8d8a2ac50ef12d738198e.tar.bz2
samba-6c7e9dfb293f1243d9d8d8a2ac50ef12d738198e.zip
net ads password and net ads chostpass commands from Remus Koos
(This used to be commit 412e79c448bf02e3097b5c14a36fe0172d8d2895)
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 3452614315..d2b9f74c4d 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -3,6 +3,8 @@
Version 3.0
ads (active directory) utility library
Copyright (C) Andrew Tridgell 2001
+ Copyright (C) Remus Koos 2001
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -442,9 +444,17 @@ ADS_STATUS ads_set_machine_password(ADS_STRUCT *ads,
{
ADS_STATUS status;
char *host = strdup(hostname);
+ char *principal;
+
strlower(host);
- status = krb5_set_password(ads->kdc_server, host, ads->realm, password);
+
+ asprintf(&principal, "%s@%s", host, ads->realm);
+
+ status = krb5_set_password(ads->kdc_server, principal, password);
+
free(host);
+ free(principal);
+
return status;
}