summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-10-07 10:43:53 +0200
committerGünther Deschner <gd@samba.org>2009-10-07 11:18:11 +0200
commit7b3501200c55d7844c4d697456dbfa2b86cfdcc8 (patch)
tree807f372ca35335c70c678b4322f3e0f085f9dee6 /nsswitch
parent2df47b0a54ad0a973b81911ee507ab50555b24a6 (diff)
downloadsamba-7b3501200c55d7844c4d697456dbfa2b86cfdcc8.tar.gz
samba-7b3501200c55d7844c4d697456dbfa2b86cfdcc8.tar.bz2
samba-7b3501200c55d7844c4d697456dbfa2b86cfdcc8.zip
wbinfo: allow to check trusts via "wbinfo -t --domain DOMAINNAME".
Guenther
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/wbinfo.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c
index a80b69f2b6..7410a744f3 100644
--- a/nsswitch/wbinfo.c
+++ b/nsswitch/wbinfo.c
@@ -724,15 +724,23 @@ static bool wbinfo_dsgetdcname(const char *domain_name, uint32_t flags)
/* Check trust account password */
-static bool wbinfo_check_secret(void)
+static bool wbinfo_check_secret(const char *domain)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
struct wbcAuthErrorInfo *error = NULL;
+ const char *domain_name;
- wbc_status = wbcCheckTrustCredentials(NULL, &error);
+ if (domain) {
+ domain_name = domain;
+ } else {
+ domain_name = get_winbind_domain();
+ }
- d_printf("checking the trust secret via RPC calls %s\n",
- WBC_ERROR_IS_OK(wbc_status) ? "succeeded" : "failed");
+ wbc_status = wbcCheckTrustCredentials(domain_name, &error);
+
+ d_printf("checking the trust secret for domain %s via RPC calls %s\n",
+ domain_name,
+ WBC_ERROR_IS_OK(wbc_status) ? "succeeded" : "failed");
if (wbc_status == WBC_ERR_AUTH_ERROR) {
d_fprintf(stderr, "error code was %s (0x%x)\n",
@@ -1950,7 +1958,7 @@ int main(int argc, char **argv, char **envp)
}
break;
case 't':
- if (!wbinfo_check_secret()) {
+ if (!wbinfo_check_secret(opt_domain_name)) {
d_fprintf(stderr, "Could not check secret\n");
goto done;
}