pam_ext.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (C) 2005, 2006, 2008, 2009 Thorsten Kukuk.
  3. *
  4. * <security/pam_ext.h>
  5. *
  6. * This header file collects definitions for the extended PAM API.
  7. * This is a public interface of the PAM library for PAM modules,
  8. * which makes the life of PAM developers easier, but are not documented
  9. * in any standard and are not portable between different PAM
  10. * implementations.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. * 1. Redistributions of source code must retain the above copyright
  16. * notice, and the entire permission notice in its entirety,
  17. * including the disclaimer of warranties.
  18. * 2. Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in the
  20. * documentation and/or other materials provided with the distribution.
  21. * 3. The name of the author may not be used to endorse or promote
  22. * products derived from this software without specific prior
  23. * written permission.
  24. *
  25. * ALTERNATIVELY, this product may be distributed under the terms of
  26. * the GNU Public License, in which case the provisions of the GPL are
  27. * required INSTEAD OF the above restrictions. (This clause is
  28. * necessary due to a potential bad interaction between the GPL and
  29. * the restrictions contained in a BSD-style copyright.)
  30. *
  31. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  32. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  33. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  34. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  35. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  36. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  37. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  39. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  40. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  41. * OF THE POSSIBILITY OF SUCH DAMAGE.
  42. */
  43. #ifndef _SECURITY__PAM_EXT_H_
  44. #define _SECURITY__PAM_EXT_H_
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. #include <security/_pam_types.h>
  49. #include <stdarg.h>
  50. extern void PAM_FORMAT((printf, 3, 0)) PAM_NONNULL((3))
  51. pam_vsyslog (const pam_handle_t *pamh, int priority,
  52. const char *fmt, va_list args);
  53. extern void PAM_FORMAT((printf, 3, 4)) PAM_NONNULL((3))
  54. pam_syslog (const pam_handle_t *pamh, int priority, const char *fmt, ...);
  55. extern int PAM_FORMAT((printf, 4, 0)) PAM_NONNULL((1,4))
  56. pam_vprompt (pam_handle_t *pamh, int style, char **response,
  57. const char *fmt, va_list args);
  58. extern int PAM_FORMAT((printf, 4, 5)) PAM_NONNULL((1,4))
  59. pam_prompt (pam_handle_t *pamh, int style, char **response,
  60. const char *fmt, ...);
  61. #define pam_error(pamh, fmt...) \
  62. pam_prompt(pamh, PAM_ERROR_MSG, NULL, fmt)
  63. #define pam_verror(pamh, fmt, args) \
  64. pam_vprompt(pamh, PAM_ERROR_MSG, NULL, fmt, args)
  65. #define pam_info(pamh, fmt...) pam_prompt(pamh, PAM_TEXT_INFO, NULL, fmt)
  66. #define pam_vinfo(pamh, fmt, args) pam_vprompt(pamh, PAM_TEXT_INFO, NULL, fmt, args)
  67. extern int PAM_NONNULL((1,3))
  68. pam_get_authtok (pam_handle_t *pamh, int item, const char **authtok,
  69. const char *prompt);
  70. extern int PAM_NONNULL((1,2))
  71. pam_get_authtok_noverify (pam_handle_t *pamh, const char **authtok,
  72. const char *prompt);
  73. extern int PAM_NONNULL((1,2))
  74. pam_get_authtok_verify (pam_handle_t *pamh, const char **authtok,
  75. const char *prompt);
  76. #ifdef __cplusplus
  77. }
  78. #endif
  79. #endif