1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $FreeBSD: head/etc/rc.d/ugidfw 150800 2005-10-02 07:03:00Z maxim $
| 3# $FreeBSD: head/etc/rc.d/ugidfw 165683 2006-12-31 10:37:18Z yar $
|
4 5# PROVIDE: ugidfw 6# REQUIRE: 7# BEFORE: LOGIN 8# KEYWORD: nojail 9 10. /etc/rc.subr 11 12name="ugidfw" 13rcvar="ugidfw_enable" 14start_cmd="ugidfw_start"
| 4 5# PROVIDE: ugidfw 6# REQUIRE: 7# BEFORE: LOGIN 8# KEYWORD: nojail 9 10. /etc/rc.subr 11 12name="ugidfw" 13rcvar="ugidfw_enable" 14start_cmd="ugidfw_start"
|
15start_precmd="ugidfw_precmd"
| |
16stop_cmd="ugidfw_stop"
| 15stop_cmd="ugidfw_stop"
|
| 16required_modules="mac_bsdextended"
|
17 18ugidfw_load() 19{ 20 if [ -r "${bsdextended_script}" ]; then 21 . "${bsdextended_script}" 22 fi 23} 24
| 17 18ugidfw_load() 19{ 20 if [ -r "${bsdextended_script}" ]; then 21 . "${bsdextended_script}" 22 fi 23} 24
|
25ugidfw_precmd() 26{ 27 if ! sysctl security.mac.bsdextended 28 then kldload mac_bsdextended 29 if [ "$?" -ne "0" ] 30 then warn Unable to load the mac_bsdextended module. 31 return 1 32 else 33 return 0 34 fi 35 fi 36 return 0 37} 38
| |
39ugidfw_start() 40{ 41 [ -z "${bsdextended_script}" ] && bsdextended_script=/etc/rc.bsdextended 42 43 if [ -r "${bsdextended_script}" ]; then 44 ugidfw_load 45 echo "MAC bsdextended rules loaded." 46 fi 47} 48 49ugidfw_stop() 50{ 51 # Disable the policy 52 # 53 kldunload mac_bsdextended 54} 55 56load_rc_config $name 57run_rc_command "$1"
| 25ugidfw_start() 26{ 27 [ -z "${bsdextended_script}" ] && bsdextended_script=/etc/rc.bsdextended 28 29 if [ -r "${bsdextended_script}" ]; then 30 ugidfw_load 31 echo "MAC bsdextended rules loaded." 32 fi 33} 34 35ugidfw_stop() 36{ 37 # Disable the policy 38 # 39 kldunload mac_bsdextended 40} 41 42load_rc_config $name 43run_rc_command "$1"
|