]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/mac/mac_portacl/root.t
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / mac / mac_portacl / root.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 dir=`dirname $0`
5 . ${dir}/misc.sh
6
7 echo "1..48"
8
9 # Verify if security.mac.portacl.suser_exempt=1 really exempts super-user.
10
11 sysctl security.mac.portacl.suser_exempt=1 >/dev/null
12
13 bind_test ok ok uid root tcp 77
14 bind_test ok ok uid root tcp 7777
15 bind_test ok ok uid root udp 77
16 bind_test ok ok uid root udp 7777
17
18 bind_test ok ok gid root tcp 77
19 bind_test ok ok gid root tcp 7777
20 bind_test ok ok gid root udp 77
21 bind_test ok ok gid root udp 7777
22
23 # Verify if security.mac.portacl.suser_exempt=0 really doesn't exempt super-user.
24
25 sysctl security.mac.portacl.suser_exempt=0 >/dev/null
26
27 bind_test fl ok uid root tcp 77
28 bind_test ok ok uid root tcp 7777
29 bind_test fl ok uid root udp 77
30 bind_test ok ok uid root udp 7777
31
32 bind_test fl ok gid root tcp 77
33 bind_test ok ok gid root tcp 7777
34 bind_test fl ok gid root udp 77
35 bind_test ok ok gid root udp 7777
36
37 # Verify if security.mac.portacl.port_high works for super-user.
38
39 sysctl security.mac.portacl.port_high=7778 >/dev/null
40
41 bind_test fl ok uid root tcp 77
42 bind_test fl ok uid root tcp 7777
43 bind_test fl ok uid root udp 77
44 bind_test fl ok uid root udp 7777
45
46 bind_test fl ok gid root tcp 77
47 bind_test fl ok gid root tcp 7777
48 bind_test fl ok gid root udp 77
49 bind_test fl ok gid root udp 7777
50
51 restore_settings