diff options
Diffstat (limited to 'source4/auth/credentials')
-rw-r--r-- | source4/auth/credentials/credentials.c | 23 | ||||
-rw-r--r-- | source4/auth/credentials/credentials.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c index 0e37fdc4a6..0ea2a01ea1 100644 --- a/source4/auth/credentials/credentials.c +++ b/source4/auth/credentials/credentials.c @@ -57,6 +57,8 @@ struct cli_credentials *cli_credentials_init(TALLOC_CTX *mem_ctx) cred->machine_account = False; cred->gensec_list = NULL; + cred->bind_dn = NULL; + return cred; } @@ -104,6 +106,23 @@ BOOL cli_credentials_set_username_callback(struct cli_credentials *cred, return False; } +BOOL cli_credentials_set_bind_dn(struct cli_credentials *cred, + const char *bind_dn) +{ + cred->bind_dn = talloc_strdup(cred, bind_dn); + return True; +} + +/** + * Obtain the BIND DN for this credentials context. + * @param cred credentials context + * @retval The username set on this context. + * @note Return value will be NULL if not specified explictly + */ +const char *cli_credentials_get_bind_dn(struct cli_credentials *cred) +{ + return cred->bind_dn; +} /** @@ -171,6 +190,10 @@ BOOL cli_credentials_set_principal_callback(struct cli_credentials *cred, BOOL cli_credentials_authentication_requested(struct cli_credentials *cred) { + if (cred->bind_dn) { + return True; + } + if (cred->machine_account_pending) { cli_credentials_set_machine_account(cred); } diff --git a/source4/auth/credentials/credentials.h b/source4/auth/credentials/credentials.h index 027cf4469d..c8a95e2b51 100644 --- a/source4/auth/credentials/credentials.h +++ b/source4/auth/credentials/credentials.h @@ -61,6 +61,8 @@ struct cli_credentials { const char *principal; const char *salt_principal; + const char *bind_dn; + struct samr_Password *nt_hash; struct ccache_container *ccache; |