Path: blob/main/tests/sys/mac/portacl/root_test.sh
39604 views
#!/bin/sh12dir=`dirname $0`3. ${dir}/misc.sh45echo "1..48"67# Verify if security.mac.portacl.suser_exempt=1 really exempts super-user.89trap restore_settings EXIT INT TERM1011sysctl security.mac.portacl.suser_exempt=1 >/dev/null1213bind_test ok ok uid root tcp 7714bind_test ok ok uid root tcp 777715bind_test ok ok uid root udp 7716bind_test ok ok uid root udp 77771718bind_test ok ok gid root tcp 7719bind_test ok ok gid root tcp 777720bind_test ok ok gid root udp 7721bind_test ok ok gid root udp 77772223# Verify if security.mac.portacl.suser_exempt=0 really doesn't exempt super-user.2425sysctl security.mac.portacl.suser_exempt=0 >/dev/null2627bind_test fl ok uid root tcp 7728bind_test ok ok uid root tcp 777729bind_test fl ok uid root udp 7730bind_test ok ok uid root udp 77773132bind_test fl ok gid root tcp 7733bind_test ok ok gid root tcp 777734bind_test fl ok gid root udp 7735bind_test ok ok gid root udp 77773637# Verify if security.mac.portacl.port_high works for super-user.3839sysctl security.mac.portacl.port_high=7778 >/dev/null4041bind_test fl ok uid root tcp 7742bind_test fl ok uid root tcp 777743bind_test fl ok uid root udp 7744bind_test fl ok uid root udp 77774546bind_test fl ok gid root tcp 7747bind_test fl ok gid root tcp 777748bind_test fl ok gid root udp 7749bind_test fl ok gid root udp 7777505152