pam_winbind: use libwbclient for WINBINDD_INFO.
authorGünther Deschner <gd@samba.org>
Thu, 14 Aug 2008 16:17:00 +0000 (18:17 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 26 Nov 2008 09:13:35 +0000 (10:13 +0100)
Guenther
(cherry picked from commit 9c11f1a9d174d800696640671894e7071292444f)

source/nsswitch/pam_winbind.c

index f708014b0453fcfcb7789becbbd9a52cd6c3810d..2c491c5c95a39f7a24e6b2f70fc777e4ee2bbd61 100644 (file)
@@ -803,8 +803,6 @@ static int pam_winbind_request_log(struct pwb_context *ctx,
                /* Otherwise, the authentication looked good */
 #if 0
                switch (req_type) {
-                       case WINBINDD_INFO:
-                               break;
                        case WINBINDD_PAM_AUTH:
                                _pam_log(ctx, LOG_NOTICE,
                                         "user '%s' granted access", user);
@@ -2071,20 +2069,25 @@ static int get_warn_pwd_expire_from_config(struct pwb_context *ctx)
 
 static char winbind_get_separator(struct pwb_context *ctx)
 {
-       struct winbindd_request request;
-       struct winbindd_response response;
+       wbcErr wbc_status;
+       static struct wbcInterfaceDetails *details = NULL;
 
-       ZERO_STRUCT(request);
-       ZERO_STRUCT(response);
+       wbc_status = wbcInterfaceDetails(&details);
+       if (!WBC_ERROR_IS_OK(wbc_status)) {
+               _pam_log(ctx, LOG_ERR,
+                        "Could not retrieve winbind interface details: %s",
+                        wbcErrorString(wbc_status));
+               return '\0';
+       }
 
-       if (pam_winbind_request_log(ctx, WINBINDD_INFO,
-                                   &request, &response, NULL)) {
+       if (!details) {
                return '\0';
        }
 
-       return response.data.info.winbind_separator;
+       return details->winbind_separator;
 }
 
+
 /**
  * Convert a upn to a name.
  *