summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-04-17 00:17:06 +0200
committerStefan Metzmacher <metze@samba.org>2008-04-17 00:32:03 +0200
commitb666ead6e4131e07d83aa17c2feed5b828984b3c (patch)
tree62cc9e80d7940e234d1db4282220466e635cbd12 /source3/nsswitch
parent2d0a36f0a5f45760927f05e514a9e63ea5d43785 (diff)
downloadsamba-b666ead6e4131e07d83aa17c2feed5b828984b3c.tar.gz
samba-b666ead6e4131e07d83aa17c2feed5b828984b3c.tar.bz2
samba-b666ead6e4131e07d83aa17c2feed5b828984b3c.zip
wbinfo: use wbcCheckTrustCredentials()
metze (This used to be commit 2cbe5a006a6df79c38f4aaa68d498cd6d5a34dba)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wbinfo.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index 186ab98717..1e943a5eee 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -591,22 +591,24 @@ static bool wbinfo_dsgetdcname(const char *domain_name, uint32_t flags)
static bool wbinfo_check_secret(void)
{
- struct winbindd_response response;
- NSS_STATUS result;
-
- ZERO_STRUCT(response);
+ wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
+ struct wbcAuthErrorInfo *error = NULL;
- result = winbindd_request_response(WINBINDD_CHECK_MACHACC, NULL, &response);
+ wbc_status = wbcCheckTrustCredentials(NULL, &error);
d_printf("checking the trust secret via RPC calls %s\n",
- (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed");
+ WBC_ERROR_IS_OK(wbc_status) ? "succeeded" : "failed");
- if (result != NSS_STATUS_SUCCESS)
+ if (wbc_status == WBC_ERR_AUTH_ERROR) {
d_fprintf(stderr, "error code was %s (0x%x)\n",
- response.data.auth.nt_status_string,
- response.data.auth.nt_status);
+ error->nt_string, error->nt_status);
+ wbcFreeMemory(error);
+ }
+ if (!WBC_ERROR_IS_OK(wbc_status)) {
+ return false;
+ }
- return result == NSS_STATUS_SUCCESS;
+ return true;
}
/* Convert uid to sid */