libsmb: Allow change of BDC trust account password
authorAndrew Bartlett <abartlet@samba.org>
Wed, 22 Oct 2014 23:28:48 +0000 (12:28 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 11 Dec 2014 18:14:06 +0000 (19:14 +0100)
This account is otherwise just like the workstation trust acocunt, so use that code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10891

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/trusts_util.c

index bb2e977cc55c3e3b58a6c72820b684b79cee187b..7503ef09975be012cf793b9f2e7a23fa689cfbf5 100644 (file)
@@ -111,6 +111,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
 
        switch (sec_channel_type) {
        case SEC_CHAN_WKSTA:
+       case SEC_CHAN_BDC:
                pwd = secrets_fetch_machine_password(domain,
                                                     &pass_last_set_time,
                                                     NULL);
@@ -188,6 +189,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
        switch (sec_channel_type) {
 
        case SEC_CHAN_WKSTA:
+       case SEC_CHAN_BDC:
                if (!secrets_store_machine_password(new_trust_passwd, domain, sec_channel_type)) {
                        TALLOC_FREE(frame);
                        return NT_STATUS_INTERNAL_DB_CORRUPTION;
@@ -206,6 +208,7 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context,
                break;
 
        default:
+               smb_panic("Unsupported secure channel type");
                break;
        }