Deleted Added
full compact
security (251190) security (251236)
1#!/bin/sh
2#-
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
1#!/bin/sh
2#-
3# Copyright (c) 2012-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/security/security 251190 2013-05-31 19:07:17Z dteske $
27# $FreeBSD: head/usr.sbin/bsdconfig/security/security 251236 2013-06-01 23:58:44Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." "$0"
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/mustberoot.subr

--- 64 unchanged lines hidden (view full) ---

100 local height width rows
101 eval f_dialog_menu_size height width rows \
102 \"\$DIALOG_TITLE\" \
103 \"\$DIALOG_BACKTITLE\" \
104 \"\$prompt\" \
105 \"\$hline\" \
106 $menu_list
107
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." "$0"
34f_include $BSDCFG_SHARE/dialog.subr
35f_include $BSDCFG_SHARE/mustberoot.subr

--- 64 unchanged lines hidden (view full) ---

100 local height width rows
101 eval f_dialog_menu_size height width rows \
102 \"\$DIALOG_TITLE\" \
103 \"\$DIALOG_BACKTITLE\" \
104 \"\$prompt\" \
105 \"\$hline\" \
106 $menu_list
107
108 local dialog_menu
109 dialog_menu=$( eval $DIALOG \
108 local menu_choice
109 menu_choice=$( eval $DIALOG \
110 --title \"\$DIALOG_TITLE\" \
111 --backtitle \"\$DIALOG_BACKTITLE\" \
112 --hline \"\$hline\" \
113 --ok-label \"\$msg_ok\" \
114 --cancel-label \"\$msg_cancel\" \
115 --default-item \"\$defaultitem\" \
116 --menu \"\$prompt\" \
117 $height $width $rows \
118 $menu_list \
119 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
120 )
121 local retval=$?
110 --title \"\$DIALOG_TITLE\" \
111 --backtitle \"\$DIALOG_BACKTITLE\" \
112 --hline \"\$hline\" \
113 --ok-label \"\$msg_ok\" \
114 --cancel-label \"\$msg_cancel\" \
115 --default-item \"\$defaultitem\" \
116 --menu \"\$prompt\" \
117 $height $width $rows \
118 $menu_list \
119 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
120 )
121 local retval=$?
122 setvar DIALOG_MENU_$$ "$dialog_menu"
122 f_dialog_data_sanitize menu_choice
123 f_dialog_menutag_store "$menu_choice"
123
124 # Only update default-item on success
124
125 # Only update default-item on success
125 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$dialog_menu"
126 [ $retval -eq 0 ] && setvar DEFAULTITEM_$$ "$menu_choice"
126
127 return $retval
128}
129
130############################################################ MAIN
131
132# Incorporate rc-file if it exists
133[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"

--- 14 unchanged lines hidden (view full) ---

148f_dialog_title "$msg_system_security_options_menu"
149f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
150f_mustberoot_init
151
152#
153# Launch application main menu
154#
155while :; do
127
128 return $retval
129}
130
131############################################################ MAIN
132
133# Incorporate rc-file if it exists
134[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"

--- 14 unchanged lines hidden (view full) ---

149f_dialog_title "$msg_system_security_options_menu"
150f_dialog_backtitle "${ipgm:+bsdconfig }$pgm"
151f_mustberoot_init
152
153#
154# Launch application main menu
155#
156while :; do
156 dialog_menu_main
157 retval=$?
158 mtag=$( f_dialog_menutag )
157 dialog_menu_main || f_die
158 f_dialog_menutag_fetch mtag
159
159
160 [ $retval -eq 0 ] || f_die
161
162 case "$mtag" in
163 "X <<< $msg_exit") break ;;
164 "2 ["?"] $msg_securelevel") # Configure securelevels for the system
165 $BSDCFG_LIBE/$APP_DIR/kern_securelevel ${USE_XDIALOG:+-X} ;;
166 "3 [X] $msg_nfs_port") # Require that NFS clients use reserved ports
167 f_sysrc_set nfs_reserved_port_only "NO";;
168 "3 [ ] $msg_nfs_port") # Same; Toggle value
169 f_sysrc_set nfs_reserved_port_only "YES";;
170 esac
171
172done
173
174exit $SUCCESS
175
176################################################################################
177# END
178################################################################################
160 case "$mtag" in
161 "X <<< $msg_exit") break ;;
162 "2 ["?"] $msg_securelevel") # Configure securelevels for the system
163 $BSDCFG_LIBE/$APP_DIR/kern_securelevel ${USE_XDIALOG:+-X} ;;
164 "3 [X] $msg_nfs_port") # Require that NFS clients use reserved ports
165 f_sysrc_set nfs_reserved_port_only "NO";;
166 "3 [ ] $msg_nfs_port") # Same; Toggle value
167 f_sysrc_set nfs_reserved_port_only "YES";;
168 esac
169
170done
171
172exit $SUCCESS
173
174################################################################################
175# END
176################################################################################