| 2176 | } |
| 2177 | |
| 2178 | static int |
| 2179 | lomac_system_check_swapon(struct ucred *cred, struct vnode *vp, |
| 2180 | struct label *vplabel) |
| 2181 | { |
| 2182 | struct mac_lomac *subj, *obj; |
| 2183 | |
| 2184 | if (!lomac_enabled) |
| 2185 | return (0); |
| 2186 | |
| 2187 | subj = SLOT(cred->cr_label); |
| 2188 | obj = SLOT(vplabel); |
| 2189 | |
| 2190 | if (lomac_subject_privileged(subj)) |
| 2191 | return (EPERM); |
| 2192 | |
| 2193 | if (!lomac_high_single(obj)) |
| 2194 | return (EACCES); |
| 2195 | |
| 2196 | return (0); |
| 2197 | } |
| 2198 | |
| 2199 | static int |
| 2200 | lomac_system_check_sysctl(struct ucred *cred, struct sysctl_oid *oidp, |
nothing calls this directly
no test coverage detected