Deleted Added
full compact
38c38
< * $FreeBSD: head/sys/security/mac_test/mac_test.c 174898 2007-12-25 17:52:02Z rwatson $
---
> * $FreeBSD: head/sys/security/mac_test/mac_test.c 175164 2008-01-08 21:58:16Z jhb $
96a97
> #define MAGIC_POSIX_SHM 0x4e853fc9
1118a1120,1205
> COUNTER_DECL(posixshm_check_mmap);
> static int
> test_posixshm_check_mmap(struct ucred *cred, struct shmfd *shmfd,
> struct label *shmfdlabel, int prot, int flags)
> {
>
> LABEL_CHECK(cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(shmfdlabel, MAGIC_POSIX_SHM);
> return (0);
> }
>
> COUNTER_DECL(posixshm_check_open);
> static int
> test_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd,
> struct label *shmfdlabel)
> {
>
> LABEL_CHECK(cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(shmfdlabel, MAGIC_POSIX_SHM);
> return (0);
> }
>
> COUNTER_DECL(posixshm_check_stat);
> static int
> test_posixshm_check_stat(struct ucred *active_cred,
> struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel)
> {
>
> LABEL_CHECK(active_cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(file_cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(shmfdlabel, MAGIC_POSIX_SHM);
> return (0);
> }
>
> COUNTER_DECL(posixshm_check_truncate);
> static int
> test_posixshm_check_truncate(struct ucred *active_cred,
> struct ucred *file_cred, struct shmfd *shmfd, struct label *shmfdlabel)
> {
>
> LABEL_CHECK(active_cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(file_cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(shmfdlabel, MAGIC_POSIX_SHM);
> return (0);
> }
>
> COUNTER_DECL(posixshm_check_unlink);
> static int
> test_posixshm_check_unlink(struct ucred *cred, struct shmfd *shmfd,
> struct label *shmfdlabel)
> {
>
> LABEL_CHECK(cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(shmfdlabel, MAGIC_POSIX_SHM);
> return (0);
> }
>
> COUNTER_DECL(posixshm_create);
> static void
> test_posixshm_create(struct ucred *cred, struct shmfd *shmfd,
> struct label *shmfdlabel)
> {
>
> LABEL_CHECK(cred->cr_label, MAGIC_CRED);
> LABEL_CHECK(shmfdlabel, MAGIC_POSIX_SHM);
> COUNTER_INC(posixshm_create);
> }
>
> COUNTER_DECL(posixshm_destroy_label);
> static void
> test_posixshm_destroy_label(struct label *label)
> {
>
> LABEL_DESTROY(label, MAGIC_POSIX_SHM);
> COUNTER_INC(posixshm_destroy_label);
> }
>
> COUNTER_DECL(posixshm_init_label);
> static void
> test_posixshm_init_label(struct label *label)
> {
>
> LABEL_INIT(label, MAGIC_POSIX_SHM);
> COUNTER_INC(posixshm_init_label);
> }
>
2811a2899,2907
> .mpo_posixshm_check_mmap = test_posixshm_check_mmap,
> .mpo_posixshm_check_open = test_posixshm_check_open,
> .mpo_posixshm_check_stat = test_posixshm_check_stat,
> .mpo_posixshm_check_truncate = test_posixshm_check_truncate,
> .mpo_posixshm_check_unlink = test_posixshm_check_unlink,
> .mpo_posixshm_create = test_posixshm_create,
> .mpo_posixshm_destroy_label = test_posixshm_destroy_label,
> .mpo_posixshm_init_label = test_posixshm_init_label,
>