SU_(auth.password.invalid,
"Username and password validation failed for '%s': "
"%s"),
- userName, VGAuth_GetErrorText(err, NULL));
+ userName, VGAuth_GetLocaleErrorText(err));
}
return err;
/*********************************************************
- * Copyright (C) 2011-2016 VMware, Inc. All rights reserved.
+ * Copyright (c) 2011-2025 Broadcom. All Rights Reserved.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* Error descriptions.
*/
-#include "VGAuthCommon.h"
+#include "VGAuthInt.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
{
return VGAuthGetErrorInfo(errCode)->name;
}
+
+#define ERRMSGID(id) MSGID(id)
+
+
+/*
+ ******************************************************************************
+ * VGAuth_GetErrCodeToErrMsgId -- */ /**
+ *
+ * Returns error message id for an error code. This returns a reference
+ * to a static global string, do not free it.
+ *
+ * @remark Can be called by any user.
+ *
+ * @param[in] errCode The VGAuthError code.
+ *
+ * @return An error message id with type const char *.
+ *
+ ******************************************************************************
+ */
+
+static const char *
+VGAuth_ErrCodeToErrMsgId(VGAuthError errCode)
+{
+ switch (errCode) {
+ case VGAUTH_E_OK:
+ return ERRMSGID(vgauth.errcode.ok) "The operation was successful";
+ case VGAUTH_E_INVALID_ARGUMENT:
+ return ERRMSGID(vgauth.errcode.invalid_argument) "One of the parameters was invalid";
+ case VGAUTH_E_INVALID_CERTIFICATE:
+ return ERRMSGID(vgauth.errcode.invalid_certificate) "The certificate is not a well-formed x509 document";
+ case VGAUTH_E_PERMISSION_DENIED:
+ return ERRMSGID(vgauth.errcode.permission_denied) "Insufficient permissions";
+ case VGAUTH_E_OUT_OF_MEMORY:
+ return ERRMSGID(vgauth.errcode.out_of_memory) "Out of memory";
+ case VGAUTH_E_COMM:
+ return ERRMSGID(vgauth.errcode.comm) "Internal communication error between library and service";
+ case VGAUTH_E_NOTIMPLEMENTED:
+ return ERRMSGID(vgauth.errcode.notimplemented) "Not implemented";
+ case VGAUTH_E_NOT_CONNECTED:
+ return ERRMSGID(vgauth.errcode.not_connected) "Not connected to the service";
+ case VGAUTH_E_VERSION_MISMATCH:
+ return ERRMSGID(vgauth.errcode.version_mismatch) "Service/library version mismatch";
+ case VGAUTH_E_SECURITY_VIOLATION:
+ return ERRMSGID(vgauth.errcode.security_violation) "Potential security violation detected";
+ case VGAUTH_E_CERT_ALREADY_EXISTS:
+ return ERRMSGID(vgauth.errcode.cert_already_exists) "The certificate already exists";
+ case VGAUTH_E_AUTHENTICATION_DENIED:
+ return ERRMSGID(vgauth.errcode.authentication_denied) "Authentication denied";
+ case VGAUTH_E_INVALID_TICKET:
+ return ERRMSGID(vgauth.errcode.invalid_ticket) "Invalid ticket";
+ case VGAUTH_E_MULTIPLE_MAPPINGS:
+ return ERRMSGID(vgauth.errcode.multiple_mappings)
+ "The certificate was found associated with more than one user, or a chain contained multiple matches against the mapping file";
+ case VGAUTH_E_ALREADY_IMPERSONATING:
+ return ERRMSGID(vgauth.errcode.already_impersonating) "The context is already impersonating";
+ case VGAUTH_E_NO_SUCH_USER:
+ return ERRMSGID(vgauth.errcode.no_such_user) "User cannot be found";
+ case VGAUTH_E_SERVICE_NOT_RUNNING:
+ return ERRMSGID(vgauth.errcode.service_not_running) "Service not running";
+ case VGAUTH_E_SYSTEM_ERRNO:
+ return ERRMSGID(vgauth.errcode.system_errno) "An OS-specific operation failed";
+ case VGAUTH_E_SYSTEM_WINDOWS:
+ return ERRMSGID(vgauth.errcode.system_windows) "An OS-specific operation failed";
+ case VGAUTH_E_TOO_MANY_CONNECTIONS:
+ return ERRMSGID(vgauth.errcode.too_many_connections) "The user exceeded its max number of connections";
+ case VGAUTH_E_UNSUPPORTED:
+ return ERRMSGID(vgauth.errcode.unsupported) "The operation is not supported";
+ }
+ return ERRMSGID(vgauth.errcode.fail) "Unknown error";
+}
+
+
+/*
+ ******************************************************************************
+ * VGAuth_GetLocaleErrorText -- */ /**
+ *
+ * Returns explanatory text for an error code. This returns a reference
+ * to a string in hash table, do not free it.
+ *
+ * @remark Can be called by any user.
+ *
+ * @param[in] errCode The VGAuthError code.
+ *
+ * @return A description of @a errCode.
+ *
+ ******************************************************************************
+ */
+
+const char *
+VGAuth_GetLocaleErrorText(VGAuthError errCode)
+{
+ const char* msgid = VGAuth_ErrCodeToErrMsgId(errCode);
+ const char* errmsg = I18n_GetString(VMW_TEXT_DOMAIN, msgid);
+
+ g_debug("ErrCode %llu (ErrMsgId: %s) --- ErrMsg: %s", errCode, msgid, errmsg);
+ return errmsg;
+}
auth.password.invalid = "Username and password validation failed for '%1$s': %2$s"
auth.password.valid = "Username and password successfully validated for '%1$s'"
auth.sspi.badid = "Attempt to authenticate using an invalid or expired SSPI challenge ID: %1$u"
+
+vgauth.errcode.ok = "The operation was successful"
+vgauth.errcode.invalid_argument = "One of the parameters was invalid"
+vgauth.errcode.invalid_certificate = "The certificate is not a well-formed x509 document"
+vgauth.errcode.permission_denied = "Insufficient permissions"
+vgauth.errcode.out_of_memory = "Out of memory"
+vgauth.errcode.comm = "Internal communication error between library and service"
+vgauth.errcode.notimplemented = "Not implemented"
+vgauth.errcode.not_connected = "Not connected to the service"
+vgauth.errcode.version_mismatch = "Service/library version mismatch"
+vgauth.errcode.security_violation = "Potential security violation detected"
+vgauth.errcode.cert_already_exists = "The certificate already exists"
+vgauth.errcode.authentication_denied = "Authentication denied"
+vgauth.errcode.invalid_ticket = "Invalid ticket"
+vgauth.errcode.multiple_mappings = "The certificate was found associated with more than one user, or a chain contained multiple matches against the mapping file"
+vgauth.errcode.already_impersonating = "The context is already impersonating"
+vgauth.errcode.no_such_user = "User cannot be found"
+vgauth.errcode.service_not_running = "Service not running"
+vgauth.errcode.system_errno = "An OS-specific operation failed"
+vgauth.errcode.system_windows = "An OS-specific operation failed"
+vgauth.errcode.too_many_connections = "The user exceeded its max number of connections"
+vgauth.errcode.unsupported = "The operation is not supported"
+vgauth.errcode.fail = "Unknown error"
auth.password.invalid = "Error en la validación del nombre de usuario y la contraseña para '%1$s': %2$s"
auth.password.valid = "El nombre de usuario y la contraseña de '%1$s' se han validado correctamente"
auth.sspi.badid = "Intento de autenticación utilizando un SSPI challenge ID no válido o caducado: %1$u"
+
+vgauth.errcode.ok = "The operation was successful"
+vgauth.errcode.invalid_argument = "One of the parameters was invalid"
+vgauth.errcode.invalid_certificate = "The certificate is not a well-formed x509 document"
+vgauth.errcode.permission_denied = "Insufficient permissions"
+vgauth.errcode.out_of_memory = "Out of memory"
+vgauth.errcode.comm = "Internal communication error between library and service"
+vgauth.errcode.notimplemented = "Not implemented"
+vgauth.errcode.not_connected = "Not connected to the service"
+vgauth.errcode.version_mismatch = "Service/library version mismatch"
+vgauth.errcode.security_violation = "Potential security violation detected"
+vgauth.errcode.cert_already_exists = "The certificate already exists"
+vgauth.errcode.authentication_denied = "Authentication denied"
+vgauth.errcode.invalid_ticket = "Invalid ticket"
+vgauth.errcode.multiple_mappings = "The certificate was found associated with more than one user, or a chain contained multiple matches against the mapping file"
+vgauth.errcode.already_impersonating = "The context is already impersonating"
+vgauth.errcode.no_such_user = "User cannot be found"
+vgauth.errcode.service_not_running = "Service not running"
+vgauth.errcode.system_errno = "An OS-specific operation failed"
+vgauth.errcode.system_windows = "An OS-specific operation failed"
+vgauth.errcode.too_many_connections = "The user exceeded its max number of connections"
+vgauth.errcode.unsupported = "The operation is not supported"
+vgauth.errcode.fail = "Unknown error"
auth.password.invalid = "Échec de la validation du nom d'utilisateur et du mot de passe pour « %1$s » : %2$s"
auth.password.valid = "Validation réussie du nom d'utilisateur et du mot de passe pour '%1$s'"
auth.sspi.badid = "Tentative d'authentification à l'aide d'un ID de demande SSPI non valide ou expiré : %1$u"
+
+vgauth.errcode.ok = "The operation was successful"
+vgauth.errcode.invalid_argument = "One of the parameters was invalid"
+vgauth.errcode.invalid_certificate = "The certificate is not a well-formed x509 document"
+vgauth.errcode.permission_denied = "Insufficient permissions"
+vgauth.errcode.out_of_memory = "Out of memory"
+vgauth.errcode.comm = "Internal communication error between library and service"
+vgauth.errcode.notimplemented = "Not implemented"
+vgauth.errcode.not_connected = "Not connected to the service"
+vgauth.errcode.version_mismatch = "Service/library version mismatch"
+vgauth.errcode.security_violation = "Potential security violation detected"
+vgauth.errcode.cert_already_exists = "The certificate already exists"
+vgauth.errcode.authentication_denied = "Authentication denied"
+vgauth.errcode.invalid_ticket = "Invalid ticket"
+vgauth.errcode.multiple_mappings = "The certificate was found associated with more than one user, or a chain contained multiple matches against the mapping file"
+vgauth.errcode.already_impersonating = "The context is already impersonating"
+vgauth.errcode.no_such_user = "User cannot be found"
+vgauth.errcode.service_not_running = "Service not running"
+vgauth.errcode.system_errno = "An OS-specific operation failed"
+vgauth.errcode.system_windows = "An OS-specific operation failed"
+vgauth.errcode.too_many_connections = "The user exceeded its max number of connections"
+vgauth.errcode.unsupported = "The operation is not supported"
+vgauth.errcode.fail = "Unknown error"
auth.password.invalid = "'%1$s' のユーザー名とパスワードの検証に失敗しました: %2$s"
auth.password.valid = "'%1$s' のユーザー名とパスワードが正しく検証されました"
auth.sspi.badid = "無効または期限切れの SSPI チャレンジ ID を使用して認証を試みます: %1$u"
+
+vgauth.errcode.ok = "The operation was successful"
+vgauth.errcode.invalid_argument = "One of the parameters was invalid"
+vgauth.errcode.invalid_certificate = "The certificate is not a well-formed x509 document"
+vgauth.errcode.permission_denied = "Insufficient permissions"
+vgauth.errcode.out_of_memory = "Out of memory"
+vgauth.errcode.comm = "Internal communication error between library and service"
+vgauth.errcode.notimplemented = "Not implemented"
+vgauth.errcode.not_connected = "Not connected to the service"
+vgauth.errcode.version_mismatch = "Service/library version mismatch"
+vgauth.errcode.security_violation = "Potential security violation detected"
+vgauth.errcode.cert_already_exists = "The certificate already exists"
+vgauth.errcode.authentication_denied = "Authentication denied"
+vgauth.errcode.invalid_ticket = "Invalid ticket"
+vgauth.errcode.multiple_mappings = "The certificate was found associated with more than one user, or a chain contained multiple matches against the mapping file"
+vgauth.errcode.already_impersonating = "The context is already impersonating"
+vgauth.errcode.no_such_user = "User cannot be found"
+vgauth.errcode.service_not_running = "Service not running"
+vgauth.errcode.system_errno = "An OS-specific operation failed"
+vgauth.errcode.system_windows = "An OS-specific operation failed"
+vgauth.errcode.too_many_connections = "The user exceeded its max number of connections"
+vgauth.errcode.unsupported = "The operation is not supported"
+vgauth.errcode.fail = "Unknown error"
/*********************************************************
- * Copyright (C) 2011-2016 VMware, Inc. All rights reserved.
+ * Copyright (c) 2011-2025 Broadcom. All Rights Reserved.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
const char *VGAuth_GetErrorName(VGAuthError err);
const char *VGAuth_GetErrorText(VGAuthError err,
const char *language);
+const char *VGAuth_GetLocaleErrorText(VGAuthError err);
/** @} */