Deleted Added
full compact
mac_none.c (105696) mac_none.c (105988)
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by NAI Labs,

--- 20 unchanged lines hidden (view full) ---

29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson
3 * Copyright (c) 2001, 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed by Robert Watson for the TrustedBSD Project.
7 *
8 * This software was developed for the FreeBSD Project in part by NAI Labs,

--- 20 unchanged lines hidden (view full) ---

29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * $FreeBSD: head/sys/security/mac_none/mac_none.c 105696 2002-10-22 14:31:34Z rwatson $
37 * $FreeBSD: head/sys/security/mac_none/mac_none.c 105988 2002-10-26 14:38:24Z rwatson $
38 */
39
40/*
41 * Developed by the TrustedBSD Project.
42 * Generic mandatory access module that does nothing.
43 */
44
45#include <sys/types.h>
46#include <sys/param.h>
47#include <sys/acl.h>
48#include <sys/conf.h>
38 */
39
40/*
41 * Developed by the TrustedBSD Project.
42 * Generic mandatory access module that does nothing.
43 */
44
45#include <sys/types.h>
46#include <sys/param.h>
47#include <sys/acl.h>
48#include <sys/conf.h>
49#include <sys/extattr.h>
49#include <sys/kernel.h>
50#include <sys/mac.h>
51#include <sys/mount.h>
52#include <sys/proc.h>
53#include <sys/systm.h>
54#include <sys/sysproto.h>
55#include <sys/sysent.h>
56#include <sys/vnode.h>

--- 74 unchanged lines hidden (view full) ---

131mac_none_externalize_label(struct label *label, char *element_name,
132 char *element_data, size_t size, size_t *len, int *claimed)
133{
134
135 return (0);
136}
137
138static int
50#include <sys/kernel.h>
51#include <sys/mac.h>
52#include <sys/mount.h>
53#include <sys/proc.h>
54#include <sys/systm.h>
55#include <sys/sysproto.h>
56#include <sys/sysent.h>
57#include <sys/vnode.h>

--- 74 unchanged lines hidden (view full) ---

132mac_none_externalize_label(struct label *label, char *element_name,
133 char *element_data, size_t size, size_t *len, int *claimed)
134{
135
136 return (0);
137}
138
139static int
139mac_none_externalize_vnode_oldmac(struct label *label, struct oldmac *extmac)
140{
141
142 return (0);
143}
144
145static int
146mac_none_internalize_label(struct label *label, char *element_name,
147 char *element_data, int *claimed)
148{
149
150 return (0);
151}
152
153/*
154 * Labeling event operations: file system objects, and things that look
155 * a lot like file system objects.
156 */
157static void
140mac_none_internalize_label(struct label *label, char *element_name,
141 char *element_data, int *claimed)
142{
143
144 return (0);
145}
146
147/*
148 * Labeling event operations: file system objects, and things that look
149 * a lot like file system objects.
150 */
151static void
152mac_none_associate_vnode_devfs(struct mount *mp, struct label *fslabel,
153 struct devfs_dirent *de, struct label *delabel, struct vnode *vp,
154 struct label *vlabel)
155{
156
157}
158
159static int
160mac_none_associate_vnode_extattr(struct mount *mp, struct label *fslabel,
161 struct vnode *vp, struct label *vlabel)
162{
163
164 return (0);
165}
166
167static void
168mac_none_associate_vnode_singlelabel(struct mount *mp,
169 struct label *fslabel, struct vnode *vp, struct label *vlabel)
170{
171
172}
173
174static void
158mac_none_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
159 struct label *label)
160{
161
162}
163
164static void
165mac_none_create_devfs_directory(char *dirname, int dirnamelen,

--- 11 unchanged lines hidden (view full) ---

177
178static void
179mac_none_create_devfs_vnode(struct devfs_dirent *devfs_dirent,
180 struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
181{
182
183}
184
175mac_none_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
176 struct label *label)
177{
178
179}
180
181static void
182mac_none_create_devfs_directory(char *dirname, int dirnamelen,

--- 11 unchanged lines hidden (view full) ---

194
195static void
196mac_none_create_devfs_vnode(struct devfs_dirent *devfs_dirent,
197 struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
198{
199
200}
201
185static void
186mac_none_create_vnode(struct ucred *cred, struct vnode *parent,
187 struct label *parentlabel, struct vnode *child,
188 struct label *childlabel)
202static int
203mac_none_create_vnode_extattr(struct ucred *cred, struct mount *mp,
204 struct label *fslabel, struct vnode *dvp, struct label *dlabel,
205 struct vnode *vp, struct label *vlabel, struct componentname *cnp)
189{
190
206{
207
208 return (0);
191}
192
193static void
194mac_none_create_mount(struct ucred *cred, struct mount *mp,
195 struct label *mntlabel, struct label *fslabel)
196{
197
198}

--- 7 unchanged lines hidden (view full) ---

206
207static void
208mac_none_relabel_vnode(struct ucred *cred, struct vnode *vp,
209 struct label *vnodelabel, struct label *label)
210{
211
212}
213
209}
210
211static void
212mac_none_create_mount(struct ucred *cred, struct mount *mp,
213 struct label *mntlabel, struct label *fslabel)
214{
215
216}

--- 7 unchanged lines hidden (view full) ---

224
225static void
226mac_none_relabel_vnode(struct ucred *cred, struct vnode *vp,
227 struct label *vnodelabel, struct label *label)
228{
229
230}
231
214static void
215mac_none_update_devfsdirent(struct devfs_dirent *devfs_dirent,
216 struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
217{
218
219}
220
221static void
222mac_none_update_procfsvnode(struct vnode *vp, struct label *vnodelabel,
223 struct ucred *cred)
224{
225
226}
227
228static int
232static int
229mac_none_update_vnode_from_externalized(struct vnode *vp,
230 struct label *vnodelabel, struct oldmac *extmac)
233mac_none_setlabel_vnode_extattr(struct ucred *cred, struct vnode *vp,
234 struct label *vlabel, struct label *intlabel)
231{
232
233 return (0);
234}
235
236static void
235{
236
237 return (0);
238}
239
240static void
237mac_none_update_vnode_from_mount(struct vnode *vp, struct label *vnodelabel,
238 struct mount *mp, struct label *fslabel)
241mac_none_update_devfsdirent(struct devfs_dirent *devfs_dirent,
242 struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
239{
240
241}
242
243/*
244 * Labeling event operations: IPC object.
245 */
246static void

--- 672 unchanged lines hidden (view full) ---

919 { MAC_EXTERNALIZE_PIPE_LABEL,
920 (macop_t)mac_none_externalize_label },
921 { MAC_EXTERNALIZE_SOCKET_LABEL,
922 (macop_t)mac_none_externalize_label },
923 { MAC_EXTERNALIZE_SOCKET_PEER_LABEL,
924 (macop_t)mac_none_externalize_label },
925 { MAC_EXTERNALIZE_VNODE_LABEL,
926 (macop_t)mac_none_externalize_label },
243{
244
245}
246
247/*
248 * Labeling event operations: IPC object.
249 */
250static void

--- 672 unchanged lines hidden (view full) ---

923 { MAC_EXTERNALIZE_PIPE_LABEL,
924 (macop_t)mac_none_externalize_label },
925 { MAC_EXTERNALIZE_SOCKET_LABEL,
926 (macop_t)mac_none_externalize_label },
927 { MAC_EXTERNALIZE_SOCKET_PEER_LABEL,
928 (macop_t)mac_none_externalize_label },
929 { MAC_EXTERNALIZE_VNODE_LABEL,
930 (macop_t)mac_none_externalize_label },
927 { MAC_EXTERNALIZE_VNODE_OLDMAC,
928 (macop_t)mac_none_externalize_vnode_oldmac },
929 { MAC_INTERNALIZE_CRED_LABEL,
930 (macop_t)mac_none_internalize_label },
931 { MAC_INTERNALIZE_IFNET_LABEL,
932 (macop_t)mac_none_internalize_label },
933 { MAC_INTERNALIZE_PIPE_LABEL,
934 (macop_t)mac_none_internalize_label },
935 { MAC_INTERNALIZE_SOCKET_LABEL,
936 (macop_t)mac_none_internalize_label },
937 { MAC_INTERNALIZE_VNODE_LABEL,
938 (macop_t)mac_none_internalize_label },
931 { MAC_INTERNALIZE_CRED_LABEL,
932 (macop_t)mac_none_internalize_label },
933 { MAC_INTERNALIZE_IFNET_LABEL,
934 (macop_t)mac_none_internalize_label },
935 { MAC_INTERNALIZE_PIPE_LABEL,
936 (macop_t)mac_none_internalize_label },
937 { MAC_INTERNALIZE_SOCKET_LABEL,
938 (macop_t)mac_none_internalize_label },
939 { MAC_INTERNALIZE_VNODE_LABEL,
940 (macop_t)mac_none_internalize_label },
941 { MAC_ASSOCIATE_VNODE_DEVFS,
942 (macop_t)mac_none_associate_vnode_devfs },
943 { MAC_ASSOCIATE_VNODE_EXTATTR,
944 (macop_t)mac_none_associate_vnode_extattr },
945 { MAC_ASSOCIATE_VNODE_SINGLELABEL,
946 (macop_t)mac_none_associate_vnode_singlelabel },
939 { MAC_CREATE_DEVFS_DEVICE,
940 (macop_t)mac_none_create_devfs_device },
941 { MAC_CREATE_DEVFS_DIRECTORY,
942 (macop_t)mac_none_create_devfs_directory },
943 { MAC_CREATE_DEVFS_SYMLINK,
944 (macop_t)mac_none_create_devfs_symlink },
945 { MAC_CREATE_DEVFS_VNODE,
946 (macop_t)mac_none_create_devfs_vnode },
947 { MAC_CREATE_DEVFS_DEVICE,
948 (macop_t)mac_none_create_devfs_device },
949 { MAC_CREATE_DEVFS_DIRECTORY,
950 (macop_t)mac_none_create_devfs_directory },
951 { MAC_CREATE_DEVFS_SYMLINK,
952 (macop_t)mac_none_create_devfs_symlink },
953 { MAC_CREATE_DEVFS_VNODE,
954 (macop_t)mac_none_create_devfs_vnode },
947 { MAC_CREATE_VNODE,
948 (macop_t)mac_none_create_vnode },
955 { MAC_CREATE_VNODE_EXTATTR,
956 (macop_t)mac_none_create_vnode_extattr },
949 { MAC_CREATE_MOUNT,
950 (macop_t)mac_none_create_mount },
951 { MAC_CREATE_ROOT_MOUNT,
952 (macop_t)mac_none_create_root_mount },
953 { MAC_RELABEL_VNODE,
954 (macop_t)mac_none_relabel_vnode },
957 { MAC_CREATE_MOUNT,
958 (macop_t)mac_none_create_mount },
959 { MAC_CREATE_ROOT_MOUNT,
960 (macop_t)mac_none_create_root_mount },
961 { MAC_RELABEL_VNODE,
962 (macop_t)mac_none_relabel_vnode },
963 { MAC_SETLABEL_VNODE_EXTATTR,
964 (macop_t)mac_none_setlabel_vnode_extattr },
955 { MAC_UPDATE_DEVFSDIRENT,
956 (macop_t)mac_none_update_devfsdirent },
965 { MAC_UPDATE_DEVFSDIRENT,
966 (macop_t)mac_none_update_devfsdirent },
957 { MAC_UPDATE_PROCFSVNODE,
958 (macop_t)mac_none_update_procfsvnode },
959 { MAC_UPDATE_VNODE_FROM_EXTERNALIZED,
960 (macop_t)mac_none_update_vnode_from_externalized },
961 { MAC_UPDATE_VNODE_FROM_MOUNT,
962 (macop_t)mac_none_update_vnode_from_mount },
963 { MAC_CREATE_MBUF_FROM_SOCKET,
964 (macop_t)mac_none_create_mbuf_from_socket },
965 { MAC_CREATE_PIPE,
966 (macop_t)mac_none_create_pipe },
967 { MAC_CREATE_SOCKET,
968 (macop_t)mac_none_create_socket },
969 { MAC_CREATE_SOCKET_FROM_SOCKET,
970 (macop_t)mac_none_create_socket_from_socket },

--- 157 unchanged lines hidden ---
967 { MAC_CREATE_MBUF_FROM_SOCKET,
968 (macop_t)mac_none_create_mbuf_from_socket },
969 { MAC_CREATE_PIPE,
970 (macop_t)mac_none_create_pipe },
971 { MAC_CREATE_SOCKET,
972 (macop_t)mac_none_create_socket },
973 { MAC_CREATE_SOCKET_FROM_SOCKET,
974 (macop_t)mac_none_create_socket_from_socket },

--- 157 unchanged lines hidden ---