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.

107 lines
4.5 KiB

  1. /* $OpenBSD: login_cap.h,v 1.6 2001/07/15 21:32:25 millert Exp $ */
  2. /*-
  3. * Copyright (c) 1995,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: login_cap.h,v 2.11 1999/09/08 18:11:57 prb Exp $
  34. */
  35. #ifndef _LOGIN_CAP_H_
  36. #define _LOGIN_CAP_H_
  37. #define LOGIN_DEFCLASS "default"
  38. #define LOGIN_DEFSTYLE "krb4-or-pwd"
  39. #define LOGIN_DEFSERVICE "login"
  40. #define LOGIN_DEFUMASK 022
  41. #define _PATH_LOGIN_CONF "/etc/login.conf"
  42. #define _PATH_AUTHPROG "/usr/libexec/auth/login_"
  43. #define LOGIN_SETGROUP 0x0001 /* Set group */
  44. #define LOGIN_SETLOGIN 0x0002 /* Set login */
  45. #define LOGIN_SETPATH 0x0004 /* Set path */
  46. #define LOGIN_SETPRIORITY 0x0008 /* Set priority */
  47. #define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */
  48. #define LOGIN_SETUMASK 0x0020 /* Set umask */
  49. #define LOGIN_SETUSER 0x0040 /* Set user */
  50. #define LOGIN_SETALL 0x007f /* Set all. */
  51. #define BI_AUTH "authorize" /* Accepted authentication */
  52. #define BI_REJECT "reject" /* Rejected authentication */
  53. #define BI_CHALLENGE "reject challenge" /* Reject with a challenge */
  54. #define BI_SILENT "reject silent" /* Reject silently */
  55. #define BI_REMOVE "remove" /* remove file on error */
  56. #define BI_ROOTOKAY "authorize root" /* root authenticated */
  57. #define BI_SECURE "authorize secure" /* okay on non-secure line */
  58. #define BI_SETENV "setenv" /* set environment variable */
  59. #define BI_UNSETENV "unsetenv" /* unset environment variable */
  60. #define BI_VALUE "value" /* set local variable */
  61. #define BI_EXPIRED "reject expired" /* account expired */
  62. #define BI_PWEXPIRED "reject pwexpired" /* password expired */
  63. /*
  64. * bits which can be returned by authenticate()/auth_scan()
  65. */
  66. #define AUTH_OKAY 0x01 /* user authentciated */
  67. #define AUTH_ROOTOKAY 0x02 /* authenticated as root */
  68. #define AUTH_SECURE 0x04 /* secure login */
  69. #define AUTH_SILENT 0x08 /* silent rejection */
  70. #define AUTH_CHALLENGE 0x10 /* a challenge was given */
  71. #define AUTH_EXPIRED 0x20 /* account expired */
  72. #define AUTH_PWEXPIRED 0x40 /* password expired */
  73. #define AUTH_ALLOW (AUTH_OKAY | AUTH_ROOTOKAY | AUTH_SECURE)
  74. typedef struct login_cap {
  75. char *lc_class;
  76. char *lc_cap;
  77. char *lc_style;
  78. } login_cap_t;
  79. #include <sys/cdefs.h>
  80. __BEGIN_DECLS
  81. struct passwd;
  82. login_cap_t *login_getclass __P((char *));
  83. void login_close __P((login_cap_t *));
  84. int login_getcapbool __P((login_cap_t *, char *, u_int));
  85. quad_t login_getcapnum __P((login_cap_t *, char *, quad_t, quad_t));
  86. quad_t login_getcapsize __P((login_cap_t *, char *, quad_t, quad_t));
  87. char *login_getcapstr __P((login_cap_t *, char *, char *, char *));
  88. quad_t login_getcaptime __P((login_cap_t *, char *, quad_t, quad_t));
  89. char *login_getstyle __P((login_cap_t *, char *, char *));
  90. int secure_path __P((char *));
  91. int setclasscontext __P((char *, u_int));
  92. int setusercontext __P((login_cap_t *, struct passwd *, uid_t, u_int));
  93. __END_DECLS
  94. #endif /* _LOGIN_CAP_H_ */