summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch/winbindd_misc.c')
-rw-r--r--source3/nsswitch/winbindd_misc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c
index 6b7ef382dd..d656c3ca4d 100644
--- a/source3/nsswitch/winbindd_misc.c
+++ b/source3/nsswitch/winbindd_misc.c
@@ -26,6 +26,19 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND
+/************************************************************************
+ Routine to get the trust account password for a domain
+************************************************************************/
+static BOOL _get_trust_account_password(const char *domain, unsigned char *ret_pwd,
+ time_t *pass_last_set_time)
+{
+ if (!secrets_fetch_trust_account_password(domain, ret_pwd, pass_last_set_time)) {
+ return False;
+ }
+
+ return True;
+}
+
/* Check the machine account password is valid */
enum winbindd_result winbindd_check_machine_acct(struct winbindd_cli_state *state)
@@ -39,8 +52,8 @@ enum winbindd_result winbindd_check_machine_acct(struct winbindd_cli_state *stat
/* Get trust account password */
again:
- if (!secrets_fetch_trust_account_password(
- lp_workgroup(), trust_passwd, NULL)) {
+ if (!_get_trust_account_password(lp_workgroup(), trust_passwd,
+ NULL)) {
result = NT_STATUS_INTERNAL_ERROR;
goto done;
}
@@ -100,11 +113,7 @@ enum winbindd_result winbindd_list_trusted_domains(struct winbindd_cli_state
have changed since we last looked. There may be a sequence
number or something we should use but I haven't found it yet. */
- if (!init_domain_list()) {
- DEBUG(1, ("winbindd_list_trusted_domains: could not "
- "refresh trusted domain list\n"));
- return WINBINDD_ERROR;
- }
+ init_domain_list();
for(domain = domain_list(); domain; domain = domain->next) {