Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.6 KiB

24 years ago
  1. /* $OpenBSD: bsd_auth.h,v 1.8 2002/08/30 08:50:01 espie Exp $ */
  2. /*-
  3. * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
  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, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. All advertising materials mentioning features or use of this software
  14. * must display the following acknowledgement:
  15. * This product includes software developed by Berkeley Software Design,
  16. * Inc.
  17. * 4. The name of Berkeley Software Design, Inc. may not be used to endorse
  18. * or promote products derived from this software without specific prior
  19. * written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
  22. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
  25. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. * SUCH DAMAGE.
  32. *
  33. * BSDI $From: bsd_auth.h,v 2.3 1999/09/08 22:13:08 prb Exp $
  34. */
  35. #ifndef _BSD_AUTH_H_
  36. #define _BSD_AUTH_H_
  37. typedef struct auth_session_t auth_session_t;
  38. typedef enum {
  39. AUTHV_ALL,
  40. AUTHV_CHALLENGE,
  41. AUTHV_CLASS,
  42. AUTHV_NAME,
  43. AUTHV_SERVICE,
  44. AUTHV_STYLE,
  45. AUTHV_INTERACTIVE
  46. } auth_item_t;
  47. #include <sys/cdefs.h>
  48. __BEGIN_DECLS
  49. struct passwd;
  50. struct login_cap;
  51. char *auth_getitem(auth_session_t *, auth_item_t);
  52. int auth_setitem(auth_session_t *, auth_item_t, char *);
  53. auth_session_t *auth_open(void);
  54. auth_session_t *auth_verify(auth_session_t *, char *, char *, ...)
  55. __attribute__((sentinel));
  56. auth_session_t *auth_userchallenge(char *, char *, char *, char **);
  57. auth_session_t *auth_usercheck(char *, char *, char *, char *);
  58. int auth_userresponse(auth_session_t *, char *, int);
  59. int auth_userokay(char *, char *, char *, char *);
  60. int auth_approval(auth_session_t *, struct login_cap *, char *, char *);
  61. int auth_close(auth_session_t *);
  62. void auth_clean(auth_session_t *);
  63. char *auth_getvalue(auth_session_t *, char *);
  64. int auth_getstate(auth_session_t *);
  65. char *auth_challenge(auth_session_t *);
  66. void auth_setenv(auth_session_t *);
  67. void auth_clrenv(auth_session_t *);
  68. void auth_setstate(auth_session_t *, int);
  69. int auth_call(auth_session_t *, char *, ...)
  70. __attribute__((sentinel));
  71. int auth_setdata(auth_session_t *, void *, size_t);
  72. int auth_setoption(auth_session_t *, char *, char *);
  73. int auth_setpwd(auth_session_t *, struct passwd *pwd);
  74. void auth_set_va_list(auth_session_t *, _BSD_VA_LIST_);
  75. struct passwd *auth_getpwd(auth_session_t *);
  76. quad_t auth_check_expire(auth_session_t *);
  77. quad_t auth_check_change(auth_session_t *);
  78. void auth_clroptions(auth_session_t *);
  79. void auth_clroption(auth_session_t *, char *);
  80. char *auth_mkvalue(char *);
  81. void auth_checknologin(struct login_cap *);
  82. int auth_cat(char *);
  83. __END_DECLS
  84. #endif /* _BSD_AUTH_H_ */