pam_appl.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * <security/pam_appl.h>
  3. *
  4. * This header file collects definitions for the PAM API --- that is,
  5. * public interface between the PAM library and an application program
  6. * that wishes to use it.
  7. *
  8. * Note, the copyright information is at end of file.
  9. */
  10. #ifndef _SECURITY_PAM_APPL_H
  11. #define _SECURITY_PAM_APPL_H
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <security/_pam_types.h> /* Linux-PAM common defined types */
  16. /* -------------- The Linux-PAM Framework layer API ------------- */
  17. extern int PAM_NONNULL((1,3,4))
  18. pam_start(const char *service_name, const char *user,
  19. const struct pam_conv *pam_conversation,
  20. pam_handle_t **pamh);
  21. extern int PAM_NONNULL((1,3,5))
  22. pam_start_confdir(const char *service_name, const char *user,
  23. const struct pam_conv *pam_conversation,
  24. const char *confdir, pam_handle_t **pamh);
  25. extern int PAM_NONNULL((1))
  26. pam_end(pam_handle_t *pamh, int pam_status);
  27. /* Authentication API's */
  28. extern int PAM_NONNULL((1))
  29. pam_authenticate(pam_handle_t *pamh, int flags);
  30. extern int PAM_NONNULL((1))
  31. pam_setcred(pam_handle_t *pamh, int flags);
  32. /* Account Management API's */
  33. extern int PAM_NONNULL((1))
  34. pam_acct_mgmt(pam_handle_t *pamh, int flags);
  35. /* Session Management API's */
  36. extern int PAM_NONNULL((1))
  37. pam_open_session(pam_handle_t *pamh, int flags);
  38. extern int PAM_NONNULL((1))
  39. pam_close_session(pam_handle_t *pamh, int flags);
  40. /* Password Management API's */
  41. extern int PAM_NONNULL((1))
  42. pam_chauthtok(pam_handle_t *pamh, int flags);
  43. /* take care of any compatibility issues */
  44. #include <security/_pam_compat.h>
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. /*
  49. * Copyright Theodore Ts'o, 1996. All rights reserved.
  50. *
  51. * Redistribution and use in source and binary forms, with or without
  52. * modification, are permitted provided that the following conditions
  53. * are met:
  54. * 1. Redistributions of source code must retain the above copyright
  55. * notice, and the entire permission notice in its entirety,
  56. * including the disclaimer of warranties.
  57. * 2. Redistributions in binary form must reproduce the above copyright
  58. * notice, this list of conditions and the following disclaimer in the
  59. * documentation and/or other materials provided with the distribution.
  60. * 3. The name of the author may not be used to endorse or promote
  61. * products derived from this software without specific prior
  62. * written permission.
  63. *
  64. * ALTERNATIVELY, this product may be distributed under the terms of
  65. * the GNU Public License, in which case the provisions of the GPL are
  66. * required INSTEAD OF the above restrictions. (This clause is
  67. * necessary due to a potential bad interaction between the GPL and
  68. * the restrictions contained in a BSD-style copyright.)
  69. *
  70. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  71. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  72. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  73. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  74. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  75. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  76. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  77. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  78. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  79. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  80. * OF THE POSSIBILITY OF SUCH DAMAGE.
  81. */
  82. #endif /* _SECURITY_PAM_APPL_H */