opasswd.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2008 Thorsten Kukuk <kukuk@suse.de>
  3. * Copyright (c) 2013 Red Hat, Inc.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions
  7. * are met:
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, and the entire permission notice in its entirety,
  10. * including the disclaimer of warranties.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. The name of the author may not be used to endorse or promote
  15. * products derived from this software without specific prior
  16. * written permission.
  17. *
  18. * ALTERNATIVELY, this product may be distributed under the terms of
  19. * the GNU Public License, in which case the provisions of the GPL are
  20. * required INSTEAD OF the above restrictions. (This clause is
  21. * necessary due to a potential bad interaction between the GPL and
  22. * the restrictions contained in a BSD-style copyright.)
  23. *
  24. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  25. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  26. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  28. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  29. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  32. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  33. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  34. * OF THE POSSIBILITY OF SUCH DAMAGE.
  35. */
  36. #ifndef __OPASSWD_H__
  37. #define __OPASSWD_H__
  38. #define PAM_PWHISTORY_RUN_HELPER PAM_CRED_INSUFFICIENT
  39. #ifdef WITH_SELINUX
  40. #include <selinux/selinux.h>
  41. #define SELINUX_ENABLED (is_selinux_enabled()>0)
  42. #else
  43. #define SELINUX_ENABLED 0
  44. #endif
  45. #ifdef HELPER_COMPILE
  46. #define PAMH_ARG_DECL(fname, ...) fname(__VA_ARGS__)
  47. #else
  48. #define PAMH_ARG_DECL(fname, ...) fname(pam_handle_t *pamh, __VA_ARGS__)
  49. #endif
  50. #ifdef HELPER_COMPILE
  51. void
  52. helper_log_err(int err, const char *format, ...);
  53. #endif
  54. PAMH_ARG_DECL(int
  55. check_old_pass, const char *user, const char *newpass, int debug);
  56. PAMH_ARG_DECL(int
  57. save_old_pass, const char *user, int howmany, int debug);
  58. #endif /* __OPASSWD_H__ */