From 511962e1869752447b5cb714350f152a91400130 Mon Sep 17 00:00:00 2001 From: dteske Date: Thu, 20 Jun 2013 05:40:11 +0000 Subject: [PATCH] Add debugging (for a case that shouldn't arise, but makes it more obvious if a menu addition is made in one plce but forgotten in another). --- usr.sbin/bsdconfig/security/include/messages.subr | 2 ++ usr.sbin/bsdconfig/security/kern_securelevel | 2 ++ usr.sbin/bsdconfig/security/security | 2 ++ 3 files changed, 6 insertions(+) diff --git a/usr.sbin/bsdconfig/security/include/messages.subr b/usr.sbin/bsdconfig/security/include/messages.subr index ddee89b844c0..f6df66751881 100644 --- a/usr.sbin/bsdconfig/security/include/messages.subr +++ b/usr.sbin/bsdconfig/security/include/messages.subr @@ -46,3 +46,5 @@ msg_securelevel_desc="Configure securelevels for the system" msg_securelevels_menu_text="This menu allows you to select the securelevel your system runs with.\nWhen operating at a securelevel, certain root privileges are disabled,\nwhich may increase resistance to exploits and protect system integrity.\nIn secure mode system flags may not be overridden by the root user,\naccess to direct kernel memory is limited, and kernel modules may not\nbe changed. In highly secure mode, mounted file systems may not be\nmodified on-disk, tampering with the system clock is prohibited. In\nnetwork secure mode configuration changes to firewalling are prohibited.\n " msg_securelevels_menu_title="Securelevel Configuration Menu" msg_system_security_options_menu="System Security Options Menu" +msg_unknown_kern_securelevel_selection="Unknown kern.securelevel selection" +msg_unknown_security_menu_selection="Unknown security menu selection" diff --git a/usr.sbin/bsdconfig/security/kern_securelevel b/usr.sbin/bsdconfig/security/kern_securelevel index 3563ae243b07..bc622668cd55 100755 --- a/usr.sbin/bsdconfig/security/kern_securelevel +++ b/usr.sbin/bsdconfig/security/kern_securelevel @@ -158,6 +158,8 @@ case "$mtag" in f_sysrc_set kern_securelevel_enable "YES" f_sysrc_set kern_securelevel "3" ;; +*) + f_die 1 "$msg_unknown_kern_securelevel_selection" esac exit $SUCCESS diff --git a/usr.sbin/bsdconfig/security/security b/usr.sbin/bsdconfig/security/security index d26753541964..ef566054819f 100755 --- a/usr.sbin/bsdconfig/security/security +++ b/usr.sbin/bsdconfig/security/security @@ -165,6 +165,8 @@ while :; do f_sysrc_set nfs_reserved_port_only "NO" ;; "3 [ ] $msg_nfs_port") # Same; Toggle value f_sysrc_set nfs_reserved_port_only "YES" ;; + *) + f_die 1 "$msg_unknown_security_menu_selection" esac done