summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-08-28 14:53:08 +0200
committerGünther Deschner <gd@samba.org>2013-08-29 16:57:51 +0200
commit77d7e2ad5a88dbe4c16e8b829d5bd0a2a5aea9bc (patch)
tree6e358255ff2c16cf2a5bd91220073be64e94a790 /source3
parentb66ce754a327a5bdb7600fb67ffb7aaac03cb7db (diff)
downloadsamba-77d7e2ad5a88dbe4c16e8b829d5bd0a2a5aea9bc.tar.gz
samba-77d7e2ad5a88dbe4c16e8b829d5bd0a2a5aea9bc.tar.bz2
samba-77d7e2ad5a88dbe4c16e8b829d5bd0a2a5aea9bc.zip
s3-winbindd: use get_trust_pw_clear() wrapper for AD connection code.
This avoids calling secrets functions directly. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/winbindd_ads.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index fc44158211..c33b1bc3bf 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -27,7 +27,6 @@
#include "../librpc/gen_ndr/ndr_netlogon_c.h"
#include "../libds/common/flags.h"
#include "ads.h"
-#include "secrets.h"
#include "../libcli/ldap/ldap_ndr.h"
#include "../libcli/security/security.h"
#include "../libds/common/flag_mapping.h"
@@ -209,20 +208,18 @@ static ADS_STRUCT *ads_cached_connection(struct winbindd_domain *domain)
/* the machine acct password might have change - fetch it every time */
+ if (!get_trust_pw_clear(domain->name, &password, NULL, NULL)) {
+ return NULL;
+ }
+
if ( IS_DC ) {
- if ( !pdb_get_trusteddom_pw( domain->name, &password, NULL,
- NULL ) ) {
- return NULL;
- }
realm = SMB_STRDUP(domain->alt_name);
}
else {
struct winbindd_domain *our_domain = domain;
- password = secrets_fetch_machine_password(lp_workgroup(), NULL,
- NULL);
/* always give preference to the alt_name in our
primary domain if possible */