1 /* $NetBSD: secmodel_bsd44.c,v 1.12 2009/05/03 21:25:44 elad Exp $ */
3 * Copyright (c) 2006 Elad Efrat <elad@NetBSD.org>
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. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #include <sys/cdefs.h>
30 __KERNEL_RCSID(0, "$NetBSD: secmodel_bsd44.c,v 1.12 2009/05/03 21:25:44 elad Exp $");
32 #include <sys/types.h>
33 #include <sys/param.h>
34 #include <sys/kauth.h>
36 #include <sys/sysctl.h>
37 #include <sys/mount.h>
39 #include <sys/module.h>
41 #include <secmodel/bsd44/bsd44.h>
42 #include <secmodel/suser/suser.h>
43 #include <secmodel/securelevel/securelevel.h>
45 MODULE(MODULE_CLASS_SECMODEL
, secmodel_bsd44
, "suser,securelevel");
47 static struct sysctllog
*sysctl_bsd44_log
;
50 sysctl_security_bsd44_setup(struct sysctllog
**clog
)
52 const struct sysctlnode
*rnode
;
54 sysctl_createv(clog
, 0, NULL
, &rnode
,
56 CTLTYPE_NODE
, "security", NULL
,
58 CTL_SECURITY
, CTL_EOL
);
60 sysctl_createv(clog
, 0, &rnode
, &rnode
,
62 CTLTYPE_NODE
, "models", NULL
,
66 sysctl_createv(clog
, 0, &rnode
, &rnode
,
68 CTLTYPE_NODE
, "bsd44", NULL
,
72 sysctl_createv(clog
, 0, &rnode
, NULL
,
74 CTLTYPE_STRING
, "name", NULL
,
75 NULL
, 0, __UNCONST("Traditional NetBSD (derived from 4.4BSD)"), 0,
80 secmodel_bsd44_init(void)
82 secmodel_suser_init();
83 secmodel_securelevel_init();
87 secmodel_bsd44_start(void)
89 secmodel_suser_start();
90 secmodel_securelevel_start();
92 /* secmodel_register(); */
96 secmodel_bsd44_stop(void)
98 secmodel_suser_stop();
99 secmodel_securelevel_stop();
101 /* secmodel_deregister(); */
105 secmodel_bsd44_modcmd(modcmd_t cmd
, void *arg
)
110 case MODULE_CMD_INIT
:
111 secmodel_bsd44_init();
112 secmodel_bsd44_start();
113 sysctl_security_bsd44_setup(&sysctl_bsd44_log
);
116 case MODULE_CMD_FINI
:
117 sysctl_teardown(&sysctl_bsd44_log
);
118 secmodel_bsd44_stop();