]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libwbclient: add error WBC_ERR_NOT_MAPPED
authorRalph Boehme <slow@samba.org>
Fri, 16 Feb 2024 15:33:57 +0000 (16:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 26 Jul 2024 10:06:31 +0000 (10:06 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
nsswitch/krb5_plugin/winbind_krb5_localauth.c
nsswitch/libwbclient/wbclient.c
nsswitch/libwbclient/wbclient.h
nsswitch/pam_winbind.c

index f610b0cdf8cbce1e79351d46cdf350b4a8aa3316..80a35de412f2660f128be9c364dca5dd04ac0652 100644 (file)
@@ -113,6 +113,7 @@ static krb5_error_code winbind_userok(krb5_context context,
        /* match other insane libwbclient return codes */
        case WBC_ERR_WINBIND_NOT_AVAILABLE:
        case WBC_ERR_DOMAIN_NOT_FOUND:
+       case WBC_ERR_NOT_MAPPED:
                code = KRB5_PLUGIN_NO_HANDLE;
                break;
        default:
@@ -136,6 +137,7 @@ static krb5_error_code winbind_userok(krb5_context context,
        /* match other insane libwbclient return codes */
        case WBC_ERR_WINBIND_NOT_AVAILABLE:
        case WBC_ERR_DOMAIN_NOT_FOUND:
+       case WBC_ERR_NOT_MAPPED:
                code = KRB5_PLUGIN_NO_HANDLE;
                break;
        default:
@@ -219,6 +221,7 @@ static krb5_error_code winbind_an2ln(krb5_context context,
        /* match other insane libwbclient return codes */
        case WBC_ERR_WINBIND_NOT_AVAILABLE:
        case WBC_ERR_DOMAIN_NOT_FOUND:
+       case WBC_ERR_NOT_MAPPED:
                code = KRB5_LNAME_NOTRANS;
                break;
        default:
index 4562046a9fe98229a30c54aa4f2437a85aea863b..b6816ccd57090b28e52a32828cbeaf573b3d8841 100644 (file)
@@ -176,6 +176,8 @@ const char *wbcErrorString(wbcErr error)
                return "WBC_ERR_AUTH_ERROR";
        case WBC_ERR_PWD_CHANGE_FAILED:
                return "WBC_ERR_PWD_CHANGE_FAILED";
+       case WBC_ERR_NOT_MAPPED:
+               return "WBC_ERR_NOT_MAPPED";
        }
 
        return "unknown wbcErr value";
index 3ff1fe6d7b9452894edf2eafd36e3f3062993617..b7786266074358a54e145477197458ddb611648f 100644 (file)
@@ -47,7 +47,8 @@ enum _wbcErrType {
        WBC_ERR_AUTH_ERROR,        /**< Authentication failed **/
        WBC_ERR_UNKNOWN_USER,      /**< User account cannot be found */
        WBC_ERR_UNKNOWN_GROUP,     /**< Group account cannot be found */
-       WBC_ERR_PWD_CHANGE_FAILED  /**< Password Change has failed */
+       WBC_ERR_PWD_CHANGE_FAILED, /**< Password Change has failed */
+       WBC_ERR_NOT_MAPPED         /**< Translation function failed on some element **/
 };
 
 typedef enum _wbcErrType wbcErr;
index 5e5cf0af8b89158d8bfe391f514667929861d885..968a72bccc0a5560d3be879b3b4a88dd03bde33a 100644 (file)
@@ -40,6 +40,7 @@ static int wbc_error_to_pam_error(wbcErr status)
                case WBC_ERR_WINBIND_NOT_AVAILABLE:
                        return PAM_AUTHINFO_UNAVAIL;
                case WBC_ERR_DOMAIN_NOT_FOUND:
+               case WBC_ERR_NOT_MAPPED:
                        return PAM_AUTHINFO_UNAVAIL;
                case WBC_ERR_INVALID_RESPONSE:
                        return PAM_BUF_ERR;
@@ -2143,6 +2144,7 @@ static int valid_user(struct pwb_context *ctx,
                /* match other insane libwbclient return codes */
                case WBC_ERR_WINBIND_NOT_AVAILABLE:
                case WBC_ERR_DOMAIN_NOT_FOUND:
+               case WBC_ERR_NOT_MAPPED:
                        return 1;
                case WBC_ERR_SUCCESS:
                        return 0;