1 /* $NetBSD: login_cap.h,v 1.11 2009/01/11 03:04:12 christos Exp $ */
4 * Copyright (c) 1995,1997 Berkeley Software Design, Inc. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
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. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Berkeley Software Design,
18 * 4. The name of Berkeley Software Design, Inc. may not be used to endorse
19 * or promote products derived from this software without specific prior
22 * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN, INC. ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN, INC. BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * BSDI login_cap.h,v 2.10 1997/08/07 21:35:19 prb Exp
40 #define LOGIN_DEFCLASS "default"
41 #define LOGIN_DEFSERVICE "login"
42 #define LOGIN_DEFUMASK 022
43 #define _PATH_LOGIN_CONF "/etc/login.conf"
45 #define LOGIN_OSETGROUP 0x0001 /* Obsolete setgroup */
47 #define LOGIN_SETLOGIN 0x0002 /* Set login */
49 #define LOGIN_SETPATH 0x0004 /* Set path */
50 #define LOGIN_SETPRIORITY 0x0008 /* Set priority */
51 #define LOGIN_SETRESOURCES 0x0010 /* Set resource limits */
52 #define LOGIN_SETUMASK 0x0020 /* Set umask */
53 #define LOGIN_SETUSER 0x0040 /* Set user */
54 #define LOGIN_SETENV 0x0080 /* Set user environment */
55 #define LOGIN_SETGID 0x0100 /* Set group id */
56 #define LOGIN_SETGROUPS 0x0200 /* Set group membership (initgroups) */
57 #define LOGIN_SETALL 0x03fe /* Set all. 0x0001 is obsolete! */
58 #define LOGIN_SETGROUP (LOGIN_SETGID|LOGIN_SETGROUPS) /* Set group */
66 typedef int (*envfunc_t
)(void *, const char *, const char *, int);
68 #include <sys/cdefs.h>
72 login_cap_t
*login_getclass(const char *);
73 #ifndef __LIBC12_SOURCE__
74 login_cap_t
*login_getpwclass(const struct passwd
*)
75 __RENAME(__login_getpwclass50
);
77 void login_close(login_cap_t
*);
78 int login_getcapbool(login_cap_t
*, const char *, u_int
);
79 quad_t
login_getcapnum(login_cap_t
*, const char *, quad_t
, quad_t
);
80 quad_t
login_getcapsize(login_cap_t
*, const char *, quad_t
, quad_t
);
81 char *login_getcapstr(login_cap_t
*, const char *, char *, char *);
82 quad_t
login_getcaptime(login_cap_t
*, const char *, quad_t
, quad_t
);
84 int setclasscontext(const char *, u_int
);
85 #ifndef __LIBC12_SOURCE__
86 int setusercontext(login_cap_t
*, struct passwd
*, uid_t
, u_int
)
87 __RENAME(__setusercontext50
);
89 void setuserpath(login_cap_t
*, const char *, envfunc_t
, void *);
90 int setuserenv(login_cap_t
*, envfunc_t
, void *);
94 #endif /* !_LOGIN_CAP_H_ */