diff options
-rwxr-xr-x | usr.sbin/bsdconfig/console/ttys | 2 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/password/password | 2 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/password/share/password.subr | 4 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/share/mustberoot.subr | 2 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/share/variable.subr | 4 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/misc | 22 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcdelete | 2 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/startup/rcvar | 2 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/startup/share/rcconf.subr | 4 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/startup/share/rcedit.subr | 3 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/usermgmt/groupinput | 12 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/usermgmt/share/group_input.subr | 6 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/usermgmt/share/user_input.subr | 16 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/usermgmt/userinput | 32 |
14 files changed, 57 insertions, 56 deletions
diff --git a/usr.sbin/bsdconfig/console/ttys b/usr.sbin/bsdconfig/console/ttys index e1650da..3f9945e 100755 --- a/usr.sbin/bsdconfig/console/ttys +++ b/usr.sbin/bsdconfig/console/ttys @@ -192,7 +192,7 @@ while :; do err=$( ttys_set_type "$consterm" 2>&1 ) [ "$err" ] || break - f_show_msg "%s" "$err" + f_dialog_msgbox "$err" done exit $SUCCESS diff --git a/usr.sbin/bsdconfig/password/password b/usr.sbin/bsdconfig/password/password index 6b9e57d..50d963d 100755 --- a/usr.sbin/bsdconfig/password/password +++ b/usr.sbin/bsdconfig/password/password @@ -72,7 +72,7 @@ f_mustberoot_init if f_dialog_input_password; then err=$( echo "$pw_password" | pw usermod $USER_ROOT -h 0 2>&1 ) || f_die $? "%s" "$err" - f_show_msg "$msg_password_changed" + f_dialog_msgbox "$msg_password_changed" fi return $SUCCESS diff --git a/usr.sbin/bsdconfig/password/share/password.subr b/usr.sbin/bsdconfig/password/share/password.subr index bf83df7..f4ebaab9 100644 --- a/usr.sbin/bsdconfig/password/share/password.subr +++ b/usr.sbin/bsdconfig/password/share/password.subr @@ -108,13 +108,13 @@ f_dialog_input_password() # Check for NULL entry if ! [ "$_password1" -o "$_password2" ]; then - f_show_msg "$msg_password_is_empty" + f_dialog_msgbox "$msg_password_is_empty" continue fi # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_show_msg "$msg_passwords_do_not_match" + f_dialog_msgbox "$msg_passwords_do_not_match" continue fi diff --git a/usr.sbin/bsdconfig/share/mustberoot.subr b/usr.sbin/bsdconfig/share/mustberoot.subr index ebce9c1..2ead592 100644 --- a/usr.sbin/bsdconfig/share/mustberoot.subr +++ b/usr.sbin/bsdconfig/share/mustberoot.subr @@ -128,7 +128,7 @@ f_become_root_via_sudo() 1) # Always try sudo(8) when run as $user local err if ! err=$( touch "$checkpath" 2>&1 ); then - f_show_msg "%s" "$err" + f_dialog_msgbox "$err" else f_show_msg "$msg_created_path" "$checkpath" fi diff --git a/usr.sbin/bsdconfig/share/variable.subr b/usr.sbin/bsdconfig/share/variable.subr index f63a5f8..235f6dc 100644 --- a/usr.sbin/bsdconfig/share/variable.subr +++ b/usr.sbin/bsdconfig/share/variable.subr @@ -118,7 +118,7 @@ f_variable_set_defaults() # # Dump a list of registered/advertised variables and their respective values to # $VARIABLE_DUMPFILE. Returns success unless the file couldn't be written. If -# an error occurs, it is displayed using f_show_msg() (from common.subr). +# an error occurs, it is displayed using f_dialog_msgbox() (from dialog.subr). # f_dump_variables() { @@ -131,7 +131,7 @@ f_dump_variables() printf "%s='%s'\n" "$var" "$value" done > "$VARIABLE_DUMPFILE" ) 2>&1 ); then - f_show_msg "%s" "$err" + f_dialog_msgbox "$err" return $FAILURE fi } diff --git a/usr.sbin/bsdconfig/startup/misc b/usr.sbin/bsdconfig/startup/misc index 626697a..37bb80f 100755 --- a/usr.sbin/bsdconfig/startup/misc +++ b/usr.sbin/bsdconfig/startup/misc @@ -307,14 +307,14 @@ while :; do ?" [X] "*) err=$( f_sysrc_set apm_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set apm_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_startup_dirs") dialog_input_value \ "$msg_startup_dirs_desc" \ "$( f_sysrc_get local_startup )" if [ $? -eq $SUCCESS ]; then err=$( f_sysrc_set local_startup "$value" ) || - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" fi ;; ?" ["?"] $msg_named") @@ -322,14 +322,14 @@ while :; do ?" [X] "*) err=$( f_sysrc_set named_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set named_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_named_flags") dialog_input_value \ "$msg_named_flags_desc" \ "$( f_sysrc_get named_flags )" if [ $? -eq $SUCCESS ]; then err=$( f_sysrc_set named_flags "$value" ) || - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" fi ;; ?" ["?"] $msg_nis_client") @@ -339,14 +339,14 @@ while :; do err=$( f_sysrc_set nis_client_enable YES 2>&1 ) \ && err=$( f_sysrc_set rpcbind_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_nis_domainname") dialog_input_value \ "$msg_nis_domainname_desc" \ "$( f_sysrc_get nisdomainname )" if [ $? -eq $SUCCESS ]; then err=$( f_sysrc_set nisdomainname "$value" ) || - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" fi ;; ?" ["?"] $msg_nis_server") @@ -356,31 +356,31 @@ while :; do err=$( f_sysrc_set nis_server_enable YES 2>&1 ) \ && err=$( f_sysrc_set rpcbind_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_accounting") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set accounting_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set accounting_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_lpd") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set lpd_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set lpd_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_sco") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set ibcs2_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set ibcs2_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; ?" ["?"] $msg_svr4") case "$mtag" in ?" [X] "*) err=$( f_sysrc_set svr4_enable NO 2>&1 ) ;; ?" [ ] "*) err=$( f_sysrc_set svr4_enable YES 2>&1 ) ;; esac - [ $? -eq $SUCCESS ] || f_show_msg "%s\n" "$err" ;; + [ $? -eq $SUCCESS ] || f_dialog_msgbox "$err\n" ;; esac done diff --git a/usr.sbin/bsdconfig/startup/rcdelete b/usr.sbin/bsdconfig/startup/rcdelete index b0068f5..578b13e 100755 --- a/usr.sbin/bsdconfig/startup/rcdelete +++ b/usr.sbin/bsdconfig/startup/rcdelete @@ -318,7 +318,7 @@ while :; do for var in $delete_vars; do err=$( f_sysrc_delete $var 2>&1 ) if [ $? -ne $SUCCESS ]; then - f_show_msg "%s\n" "$err" + f_dialog_msgbox "$err\n" break fi done diff --git a/usr.sbin/bsdconfig/startup/rcvar b/usr.sbin/bsdconfig/startup/rcvar index 8f27b51..d7ced9e 100755 --- a/usr.sbin/bsdconfig/startup/rcvar +++ b/usr.sbin/bsdconfig/startup/rcvar @@ -194,7 +194,7 @@ while :; do esac err=$( f_sysrc_set "$rcvar" "$value" 2>&1 ) || - f_show_msg "$err" + f_dialog_msgbox "$err" esac done diff --git a/usr.sbin/bsdconfig/startup/share/rcconf.subr b/usr.sbin/bsdconfig/startup/share/rcconf.subr index 8878d2c..12eafd9 100644 --- a/usr.sbin/bsdconfig/startup/share/rcconf.subr +++ b/usr.sbin/bsdconfig/startup/share/rcconf.subr @@ -432,14 +432,14 @@ f_dialog_input_rcvar() # Check for invalid entry (1of2) if ! echo "$_input" | grep -q "^[[:alpha:]_]"; then - f_show_msg "$msg_rcvar_must_start_with" + f_dialog_msgbox "$msg_rcvar_must_start_with" continue fi # Check for invalid entry (2of2) if ! echo "$_input" | grep -q "^[[:alpha:]_][[:alnum:]_]*$" then - f_show_msg "$msg_rcvar_contains_invalid_chars" + f_dialog_msgbox "$msg_rcvar_contains_invalid_chars" continue fi diff --git a/usr.sbin/bsdconfig/startup/share/rcedit.subr b/usr.sbin/bsdconfig/startup/share/rcedit.subr index a9cba88..cb4a411 100644 --- a/usr.sbin/bsdconfig/startup/share/rcedit.subr +++ b/usr.sbin/bsdconfig/startup/share/rcedit.subr @@ -78,8 +78,7 @@ f_dialog_rcedit() f_dprintf "%s: [%s]->[%s]" "$var" "$cur_val" "$_input" - err=$( f_sysrc_set "$var" "$_input" 2>&1 ) || - f_show_msg "$err" + err=$( f_sysrc_set "$var" "$_input" 2>&1 ) || f_dialog_msgbox "$err" } ############################################################ MAIN diff --git a/usr.sbin/bsdconfig/usermgmt/groupinput b/usr.sbin/bsdconfig/usermgmt/groupinput index 83d0c1d..c459224 100755 --- a/usr.sbin/bsdconfig/usermgmt/groupinput +++ b/usr.sbin/bsdconfig/usermgmt/groupinput @@ -63,10 +63,10 @@ save_changes() err=$( pw groupdel "$group_name" 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_group_deleted" + f_dialog_msgbox "$msg_group_deleted" ;; Add) local cmd="pw groupadd -n '$group_name'" @@ -82,10 +82,10 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_group_added" + f_dialog_msgbox "$msg_group_added" ;; Edit/View) local cmd="pw groupmod -n '$group_name'" @@ -101,10 +101,10 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_group_updated" + f_dialog_msgbox "$msg_group_updated" ;; esac diff --git a/usr.sbin/bsdconfig/usermgmt/share/group_input.subr b/usr.sbin/bsdconfig/usermgmt/share/group_input.subr index 4b47392..278e0a4 100644 --- a/usr.sbin/bsdconfig/usermgmt/share/group_input.subr +++ b/usr.sbin/bsdconfig/usermgmt/share/group_input.subr @@ -134,13 +134,13 @@ f_dialog_input_group_name() # Check for NULL entry if [ ! "$_input" ]; then - f_show_msg "$msg_group_is_empty" + f_dialog_msgbox "$msg_group_is_empty" continue fi # Check for invalid entry if ! echo "$_input" | grep -q "^[[:alpha:]]"; then - f_show_msg "$msg_group_must_start_with_letter" + f_dialog_msgbox "$msg_group_must_start_with_letter" continue fi @@ -229,7 +229,7 @@ f_dialog_input_group_password() # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_show_msg "$msg_group_passwords_do_not_match" + f_dialog_msgbox "$msg_group_passwords_do_not_match" continue fi diff --git a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr index d0b5fe3..e0281ed 100644 --- a/usr.sbin/bsdconfig/usermgmt/share/user_input.subr +++ b/usr.sbin/bsdconfig/usermgmt/share/user_input.subr @@ -239,13 +239,13 @@ f_dialog_input_name() # Check for NULL entry if [ ! "$_input" ]; then - f_show_msg "$msg_login_is_empty" + f_dialog_msgbox "$msg_login_is_empty" continue fi # Check for invalid entry if ! echo "$_input" | grep -q "^[[:alpha:]]"; then - f_show_msg "$msg_login_must_start_with_letter" + f_dialog_msgbox "$msg_login_must_start_with_letter" continue fi @@ -334,7 +334,7 @@ f_dialog_input_password() # Check for password mismatch if [ "$_password1" != "$_password2" ]; then - f_show_msg "$msg_passwords_do_not_match" + f_dialog_msgbox "$msg_passwords_do_not_match" continue fi @@ -589,7 +589,7 @@ f_dialog_input_change() # Taint-check the user's input if ! f_isinteger "$ret_days"; then - f_show_msg "$msg_invalid_number_of_days" + f_dialog_msgbox "$msg_invalid_number_of_days" continue fi @@ -616,7 +616,8 @@ f_dialog_input_change() # Taint-check the user's input if ! f_isinteger "${_input:-0}"; then - f_show_msg "$msg_invalid_number_of_seconds" + f_dialog_msgbox \ + "$msg_invalid_number_of_seconds" continue fi @@ -773,7 +774,7 @@ f_dialog_input_expire() # Taint-check the user's input if ! f_isinteger "$ret_days"; then - f_show_msg "$msg_invalid_number_of_days" + f_dialog_msgbox "$msg_invalid_number_of_days" continue fi @@ -800,7 +801,8 @@ f_dialog_input_expire() # Taint-check the user's input if ! f_isinteger "${_input:-0}"; then - f_show_msg "$msg_invalid_number_of_seconds" + f_dialog_msgbox \ + "$msg_invalid_number_of_seconds" continue fi diff --git a/usr.sbin/bsdconfig/usermgmt/userinput b/usr.sbin/bsdconfig/usermgmt/userinput index 36c43e1..ad62a09 100755 --- a/usr.sbin/bsdconfig/usermgmt/userinput +++ b/usr.sbin/bsdconfig/usermgmt/userinput @@ -81,22 +81,22 @@ save_changes() err=$( pw userdel -u "$pw_uid" 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_login_deleted" + f_dialog_msgbox "$msg_login_deleted" if [ "$pw_group_delete" = "$msg_yes" ] && f_quietly pw groupshow -g "$pw_gid" then err=$( pw groupdel -g "$pw_gid" 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi if [ "$pw_home_delete" = "$msg_yes" ]; then f_dialog_info "$msg_deleting_home_directory" err=$( rm -Rf "$pw_home_dir" 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi ;; Add) @@ -119,26 +119,26 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_login_added" + f_dialog_msgbox "$msg_login_added" if [ "$pw_home_create" = "$msg_yes" ]; then err=$( mkdir -p "$pw_home_dir" 2>&1 ) if [ $? -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" elif [ -e "$pw_home_dir" ]; then err=$( chown -R "$pw_uid:$pw_gid" \ "$pw_home_dir" 2>&1 ) - [ $? -eq $SUCCESS ] || f_show_msg \ - "%s %s\n" "$msg_warning" "$err" + [ $? -eq $SUCCESS ] || + f_dialog_msgbox "$msg_warning $err\n" fi fi if [ "$pw_dotfiles_create" = "$msg_yes" ]; then err=$( copy_dotfiles 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi user="$pw_name" @@ -165,26 +165,26 @@ save_changes() err=$( eval $cmd 2>&1 ) retval=$? if [ $retval -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_error" "$err" + f_dialog_msgbox "$msg_error $err\n" return $retval fi - f_show_msg "$msg_login_updated" + f_dialog_msgbox "$msg_login_updated" if [ "$pw_home_create" = "$msg_yes" ]; then err=$( mkdir -p "$pw_home_dir" ) if [ $? -ne $SUCCESS ]; then - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" elif [ -e "$pw_home_dir" ]; then err=$( chown -R "$pw_uid:$pw_gid" \ "$pw_home_dir" 2>&1 ) - [ $? -eq $SUCCESS ] || f_show_msg \ - "%s %s\n" "$msg_warning" "$err" + [ $? -eq $SUCCESS ] || + f_dialog_msgbox "$msg_warning $err\n" fi fi if [ "$pw_dotfiles_create" = "$msg_yes" ]; then err=$( copy_dotfiles 2>&1 ) || - f_show_msg "%s %s\n" "$msg_warning" "$err" + f_dialog_msgbox "$msg_warning $err\n" fi ;; esac |