*/
#include "includes.h"
-#include "winbind_client.h"
#include "libwbclient/wbclient.h"
+#include "winbind_struct_protocol.h"
+#include "libwbclient/wbclient_internal.h"
#include "../libcli/auth/libcli_auth.h"
#include "lib/cmdline/cmdline.h"
#include "lib/afs/afs_settoken.h"
/* Get a foreign DC's name */
static bool wbinfo_getdcname(const char *domain_name)
{
+ wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
struct winbindd_request request;
struct winbindd_response response;
/* Send request */
- if (winbindd_request_response(NULL, WINBINDD_GETDCNAME, &request,
- &response) != NSS_STATUS_SUCCESS) {
+ wbc_status = wbcRequestResponse(NULL, WINBINDD_GETDCNAME,
+ &request, &response);
+ if (!WBC_ERROR_IS_OK(wbc_status)) {
d_fprintf(stderr, "Could not get dc name for %s\n",domain_name);
return false;
}
static bool wbinfo_klog(char *username)
{
+ wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
struct winbindd_request request;
struct winbindd_response response;
- NSS_STATUS result;
char *p;
/* Send off request */
request.flags |= WBFLAG_PAM_AFS_TOKEN;
- result = winbindd_request_response(NULL, WINBINDD_PAM_AUTH, &request,
- &response);
+ wbc_status = wbcRequestResponse(NULL, WINBINDD_PAM_AUTH,
+ &request, &response);
/* Display response */
d_printf("plaintext password authentication %s\n",
- (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed");
+ WBC_ERROR_IS_OK(wbc_status) ? "succeeded" : "failed");
if (response.data.auth.nt_status)
d_fprintf(stderr,
response.data.auth.nt_status,
response.data.auth.error_string);
- if (result != NSS_STATUS_SUCCESS)
+ if (!WBC_ERROR_IS_OK(wbc_status))
return false;
if (response.extra_data.data == NULL) {
}
if (!afs_settoken_str((char *)response.extra_data.data)) {
+ winbindd_free_response(&response);
d_fprintf(stderr, "Could not set token\n");
return false;
}
+ winbindd_free_response(&response);
d_printf("Successfully created AFS token\n");
return true;
}