pam_strerror.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Redistribution and use in source and binary forms, with or without
  3. * modification, are permitted provided that the following conditions
  4. * are met:
  5. * 1. Redistributions of source code must retain the above copyright
  6. * notice, and the entire permission notice in its entirety,
  7. * including the disclaimer of warranties.
  8. * 2. Redistributions in binary form must reproduce the above copyright
  9. * notice, this list of conditions and the following disclaimer in the
  10. * documentation and/or other materials provided with the distribution.
  11. * 3. The name of the author may not be used to endorse or promote
  12. * products derived from this software without specific prior
  13. * written permission.
  14. *
  15. * ALTERNATIVELY, this product may be distributed under the terms of
  16. * the GNU Public License, in which case the provisions of the GPL are
  17. * required INSTEAD OF the above restrictions. (This clause is
  18. * necessary due to a potential bad interaction between the GPL and
  19. * the restrictions contained in a BSD-style copyright.)
  20. *
  21. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  22. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  23. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  24. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  25. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  26. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  27. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  29. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  30. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  31. * OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. #include "pam_private.h"
  34. const char *pam_strerror(pam_handle_t *pamh UNUSED, int errnum)
  35. {
  36. switch (errnum) {
  37. case PAM_SUCCESS:
  38. return _("Success");
  39. case PAM_ABORT:
  40. return _("Critical error - immediate abort");
  41. case PAM_OPEN_ERR:
  42. return _("Failed to load module");
  43. case PAM_SYMBOL_ERR:
  44. return _("Symbol not found");
  45. case PAM_SERVICE_ERR:
  46. return _("Error in service module");
  47. case PAM_SYSTEM_ERR:
  48. return _("System error");
  49. case PAM_BUF_ERR:
  50. return _("Memory buffer error");
  51. case PAM_PERM_DENIED:
  52. return _("Permission denied");
  53. case PAM_AUTH_ERR:
  54. return _("Authentication failure");
  55. case PAM_CRED_INSUFFICIENT:
  56. return _("Insufficient credentials to access authentication data");
  57. case PAM_AUTHINFO_UNAVAIL:
  58. return _("Authentication service cannot retrieve authentication info");
  59. case PAM_USER_UNKNOWN:
  60. return _("User not known to the underlying authentication module");
  61. case PAM_MAXTRIES:
  62. return _("Have exhausted maximum number of retries for service");
  63. case PAM_NEW_AUTHTOK_REQD:
  64. return _("Authentication token is no longer valid; new one required");
  65. case PAM_ACCT_EXPIRED:
  66. return _("User account has expired");
  67. case PAM_SESSION_ERR:
  68. return _("Cannot make/remove an entry for the specified session");
  69. case PAM_CRED_UNAVAIL:
  70. return _("Authentication service cannot retrieve user credentials");
  71. case PAM_CRED_EXPIRED:
  72. return _("User credentials expired");
  73. case PAM_CRED_ERR:
  74. return _("Failure setting user credentials");
  75. case PAM_NO_MODULE_DATA:
  76. return _("No module specific data is present");
  77. case PAM_BAD_ITEM:
  78. return _("Bad item passed to pam_*_item()");
  79. case PAM_CONV_ERR:
  80. return _("Conversation error");
  81. case PAM_AUTHTOK_ERR:
  82. return _("Authentication token manipulation error");
  83. case PAM_AUTHTOK_RECOVERY_ERR:
  84. return _("Authentication information cannot be recovered");
  85. case PAM_AUTHTOK_LOCK_BUSY:
  86. return _("Authentication token lock busy");
  87. case PAM_AUTHTOK_DISABLE_AGING:
  88. return _("Authentication token aging disabled");
  89. case PAM_TRY_AGAIN:
  90. return _("Failed preliminary check by password service");
  91. case PAM_IGNORE:
  92. return _("The return value should be ignored by PAM dispatch");
  93. case PAM_MODULE_UNKNOWN:
  94. return _("Module is unknown");
  95. case PAM_AUTHTOK_EXPIRED:
  96. return _("Authentication token expired");
  97. case PAM_CONV_AGAIN:
  98. return _("Conversation is waiting for event");
  99. case PAM_INCOMPLETE:
  100. return _("Application needs to call libpam again");
  101. }
  102. return _("Unknown PAM error");
  103. }