1135912Strhodes#!/bin/sh
2135912Strhodes#
3135912Strhodes# $FreeBSD$
4135912Strhodes
5135912Strhodes# PROVIDE: ugidfw
6135912Strhodes# BEFORE: LOGIN
7180564Sdougb# KEYWORD: nojail shutdown
8135912Strhodes
9135912Strhodes. /etc/rc.subr
10135912Strhodes
11135912Strhodesname="ugidfw"
12135912Strhodesrcvar="ugidfw_enable"
13135912Strhodesstart_cmd="ugidfw_start"
14135912Strhodesstop_cmd="ugidfw_stop"
15165683Syarrequired_modules="mac_bsdextended"
16135912Strhodes
17144515Strhodesugidfw_load()
18144515Strhodes{
19144515Strhodes	if [ -r "${bsdextended_script}" ]; then
20144515Strhodes		. "${bsdextended_script}"
21144515Strhodes	fi
22144515Strhodes}
23144515Strhodes
24135912Strhodesugidfw_start()
25135912Strhodes{
26150800Smaxim	[ -z "${bsdextended_script}" ] && bsdextended_script=/etc/rc.bsdextended
27135912Strhodes
28150800Smaxim	if [ -r "${bsdextended_script}" ]; then
29150800Smaxim		ugidfw_load
30150800Smaxim		echo "MAC bsdextended rules loaded."
31150800Smaxim	fi
32135912Strhodes}
33135912Strhodes
34135912Strhodesugidfw_stop()
35135912Strhodes{
36135912Strhodes	# Disable the policy
37135912Strhodes	#
38135912Strhodes	kldunload mac_bsdextended
39135912Strhodes}
40135912Strhodes
41135912Strhodesload_rc_config $name
42135912Strhodesrun_rc_command "$1"
43