/* Authenticate a user with a plaintext password */
-static bool wbinfo_pam_logon(char *username)
+static bool wbinfo_pam_logon(char *username, bool verbose)
{
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
struct wbcLogonUserParams params;
+ struct wbcLogonUserInfo *info = NULL;
struct wbcAuthErrorInfo *error = NULL;
char *s = NULL;
char *p = NULL;
return false;
}
- wbc_status = wbcLogonUser(¶ms, NULL, &error, NULL);
+ wbc_status = wbcLogonUser(¶ms, &info, &error, NULL);
+
+ if (verbose && (info != NULL)) {
+ struct wbcAuthUserInfo *i = info->info;
+ uint32_t j;
+
+ if (i->account_name != NULL) {
+ d_printf("account_name: %s\n", i->account_name);
+ }
+ if (i->user_principal != NULL) {
+ d_printf("user_principal: %s\n", i->user_principal);
+ }
+ if (i->full_name != NULL) {
+ d_printf("full_name: %s\n", i->full_name);
+ }
+ if (i->domain_name != NULL) {
+ d_printf("domain_name: %s\n", i->domain_name);
+ }
+ if (i->dns_domain_name != NULL) {
+ d_printf("dns_domain_name: %s\n", i->dns_domain_name);
+ }
+ if (i->logon_server != NULL) {
+ d_printf("logon_server: %s\n", i->logon_server);
+ }
+ if (i->logon_script != NULL) {
+ d_printf("logon_script: %s\n", i->logon_script);
+ }
+ if (i->profile_path != NULL) {
+ d_printf("profile_path: %s\n", i->profile_path);
+ }
+ if (i->home_directory != NULL) {
+ d_printf("home_directory: %s\n", i->home_directory);
+ }
+ if (i->home_drive != NULL) {
+ d_printf("home_drive: %s\n", i->home_drive);
+ }
+
+ d_printf("sids:");
+
+ for (j=0; j<i->num_sids; j++) {
+ char buf[WBC_SID_STRING_BUFLEN];
+ wbcSidToStringBuf(&i->sids[j].sid, buf, sizeof(buf));
+ d_printf(" %s", buf);
+ }
+ d_printf("\n");
+
+ wbcFreeMemory(info);
+ info = NULL;
+ }
wbcFreeMemory(params.blobs);
break;
}
case OPT_PAM_LOGON:
- if (!wbinfo_pam_logon(string_arg)) {
+ if (!wbinfo_pam_logon(string_arg, verbose)) {
d_fprintf(stderr, "pam_logon failed for %s\n",
string_arg);
goto done;