Use f_show_help() where printf(1) syntax is desired.
This commit is contained in:
parent
ecfed9f2eb
commit
fa2e39c892
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244554
@ -378,11 +378,7 @@ f_dialog_menu_netdev_edit()
|
||||
if f_nfs_mounted && ! f_jailed; then
|
||||
local setting="$( printf "$msg_current_dhcp_status" \
|
||||
"$interface" "$dhcp_status" )"
|
||||
local message="$(
|
||||
printf "$msg_nfs_mounts_may_cause_hang" \
|
||||
"$setting"
|
||||
)"
|
||||
f_dialog_msgbox "$message"
|
||||
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
|
||||
continue
|
||||
fi
|
||||
|
||||
|
@ -101,16 +101,11 @@ f_dialog_validate_hostname()
|
||||
#
|
||||
local retval=$?
|
||||
case $retval in
|
||||
1) f_dialog_msgbox "$( printf \
|
||||
"$msg_hostname_label_contains_invalid_chars" "$fqhn" )";;
|
||||
2) f_dialog_msgbox "$( printf \
|
||||
"$msg_hostname_label_starts_or_ends_with_hyphen" "$fqhn" )";;
|
||||
3) f_dialog_msgbox "$( printf \
|
||||
"$msg_hostname_label_is_null" "$fqhn" )";;
|
||||
63) f_dialog_msgbox "$( printf \
|
||||
"$msg_hostname_label_exceeds_max_length" "$fqhn" )";;
|
||||
255) f_dialog_msgbox "$( printf \
|
||||
"$msg_hostname_exceeds_max_length" "$fqhn" )";;
|
||||
1) f_show_msg "$msg_hostname_label_contains_invalid_chars" "$fqhn";;
|
||||
2) f_show_msg "$msg_hostname_label_starts_or_ends_with_hyphen" "$fqhn";;
|
||||
3) f_show_msg "$msg_hostname_label_is_null" "$fqhn";;
|
||||
63) f_show_msg "$msg_hostname_label_exceeds_max_length" "$fqhn";;
|
||||
255) f_show_msg "$msg_hostname_exceeds_max_length" "$fqhn";;
|
||||
esac
|
||||
|
||||
return $retval
|
||||
@ -169,10 +164,8 @@ f_dialog_input_hostname()
|
||||
# "X11 connection rejected because of wrong authentication."
|
||||
#
|
||||
if [ "$USE_XDIALOG" -a "$SSH_CONNECTION" ]; then
|
||||
f_dialog_msgbox "$(
|
||||
printf "$msg_activate_hostname_x11warning" \
|
||||
"$( hostname )" "$hostname"
|
||||
)"
|
||||
f_show_msg "$msg_activate_hostname_x11warning" \
|
||||
"$( hostname )" "$hostname"
|
||||
else
|
||||
f_dialog_yesno "$(
|
||||
printf "$msg_activate_hostname" \
|
||||
|
@ -116,14 +116,10 @@ f_dialog_iperror()
|
||||
[ ${error:-0} -ne 0 ] || return $SUCCESS
|
||||
|
||||
case "$error" in
|
||||
1) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_addr_octet_contains_invalid_chars" "$ip" )";;
|
||||
2) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_addr_octet_is_null" "$ip" )";;
|
||||
3) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_addr_octet_exceeds_max_value" "$ip" )";;
|
||||
4) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_addr_octet_missing_or_extra" "$ip" )";;
|
||||
1) f_show_msg "$msg_ipv4_addr_octet_contains_invalid_chars" "$ip";;
|
||||
2) f_show_msg "$msg_ipv4_addr_octet_is_null" "$ip";;
|
||||
3) f_show_msg "$msg_ipv4_addr_octet_exceeds_max_value" "$ip";;
|
||||
4) f_show_msg "$msg_ipv4_addr_octet_missing_or_extra" "$ip";;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -294,14 +290,10 @@ f_dialog_ip6error()
|
||||
[ ${error:-0} -ne 0 ] || return $SUCCESS
|
||||
|
||||
case "$error" in
|
||||
1) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv6_addr_segment_contains_invalid_chars" "$ip" )";;
|
||||
2) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv6_addr_too_many_null_segments" "$ip" )";;
|
||||
3) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv6_addr_segment_contains_too_many_chars" "$ip" )";;
|
||||
4) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv6_addr_too_few_or_extra_segments" "$ip" )";;
|
||||
1) f_show_msg "$msg_ipv6_addr_segment_contains_invalid_chars" "$ip";;
|
||||
2) f_show_msg "$msg_ipv6_addr_too_many_null_segments" "$ip";;
|
||||
3) f_show_msg "$msg_ipv6_addr_segment_contains_too_many_chars" "$ip";;
|
||||
4) f_show_msg "$msg_ipv6_addr_too_few_or_extra_segments" "$ip";;
|
||||
*)
|
||||
if [ $(( $error & 0xF )) -eq 5 ]; then
|
||||
# IPv4 at the end of IPv6 address is invalid
|
||||
@ -353,9 +345,7 @@ f_dialog_input_ipaddr()
|
||||
if f_nfs_mounted && ! f_jailed; then
|
||||
local setting="$( printf "$msg_current_ipaddr" \
|
||||
"$interface" "$_ipaddr" )"
|
||||
local message="$( printf "$msg_nfs_mounts_may_cause_hang" \
|
||||
"$setting" )"
|
||||
f_dialog_msgbox "$message"
|
||||
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
|
@ -114,9 +114,7 @@ f_dialog_input_options()
|
||||
if f_nfs_mounted && ! f_jailed; then
|
||||
local setting="$( printf "$msg_current_options" \
|
||||
"$interface" "$options" )"
|
||||
local message="$( printf "$msg_nfs_mounts_may_cause_hang" \
|
||||
"$setting" )"
|
||||
f_dialog_msgbox "$message"
|
||||
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
@ -165,9 +163,7 @@ f_dialog_menu_media_options()
|
||||
if f_nfs_mounted && ! f_jailed; then
|
||||
local setting="$( printf "$msg_current_options" \
|
||||
"$interface" "$_options" )"
|
||||
local message="$( printf "$msg_nfs_mounts_may_cause_hang" \
|
||||
"$setting" )"
|
||||
f_dialog_msgbox "$message"
|
||||
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
|
@ -127,16 +127,11 @@ f_dialog_validate_netmask()
|
||||
#
|
||||
local retval=$?
|
||||
case $retval in
|
||||
1) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_mask_field_contains_invalid_chars" "$mask" )";;
|
||||
2) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_mask_field_is_null" "$mask" )";;
|
||||
3) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_mask_field_exceeds_max_value" "$mask" )";;
|
||||
4) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_mask_field_missing_or_extra" "$mask" )";;
|
||||
5) f_dialog_msgbox "$( printf \
|
||||
"$msg_ipv4_mask_field_invalid_value" "$mask" )";;
|
||||
1) f_show_msg "$msg_ipv4_mask_field_contains_invalid_chars" "$mask";;
|
||||
2) f_show_msg "$msg_ipv4_mask_field_is_null" "$mask";;
|
||||
3) f_show_msg "$msg_ipv4_mask_field_exceeds_max_value" "$mask";;
|
||||
4) f_show_msg "$msg_ipv4_mask_field_missing_or_extra" "$mask";;
|
||||
5) f_show_msg "$msg_ipv4_mask_field_invalid_value" "$mask";;
|
||||
esac
|
||||
|
||||
return $retval
|
||||
@ -158,9 +153,7 @@ f_dialog_input_netmask()
|
||||
if f_nfs_mounted && ! f_jailed; then
|
||||
local setting="$( printf "$msg_current_subnet" \
|
||||
"$interface" "$_netmask" )"
|
||||
local message="$( printf "$msg_nfs_mounts_may_cause_hang" \
|
||||
"$setting" )"
|
||||
f_dialog_msgbox "$message"
|
||||
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
|
@ -91,9 +91,7 @@ f_dialog_input_defaultrouter()
|
||||
if f_nfs_mounted && ! f_jailed; then
|
||||
local setting="$( printf "$msg_current_default_router" \
|
||||
"$defaultrouter" )"
|
||||
local message="$( printf "$msg_nfs_mounts_may_cause_hang" \
|
||||
"$setting" )"
|
||||
f_dialog_msgbox "$message"
|
||||
f_show_msg "$msg_nfs_mounts_may_cause_hang" "$setting"
|
||||
return $FAILURE
|
||||
fi
|
||||
|
||||
|
@ -338,16 +338,14 @@ f_authenticate_some_user()
|
||||
case "$user" in
|
||||
root|toor)
|
||||
nfailures=$(( $nfailures + 1 ))
|
||||
f_dialog_msgbox "$( printf \
|
||||
"$msg_user_disallowed" "$user" )"
|
||||
f_show_msg "$msg_user_disallowed" "$user"
|
||||
continue
|
||||
esac
|
||||
fi
|
||||
if ! f_quietly id "$user"; then
|
||||
nfailures=$(( $nfailures + 1 ))
|
||||
if [ "$SECURE_DIVULGE_UNKNOWN_USER" ]; then
|
||||
f_dialog_msgbox "$( printf \
|
||||
"$msg_unknown_user" "$user" )"
|
||||
f_show_msg "$msg_unknown_user" "$user"
|
||||
elif [ $nfailures -lt $PASSWD_TRIES ]; then
|
||||
f_dialog_info "$msg_sorry_try_again"
|
||||
sleep 1
|
||||
|
Loading…
Reference in New Issue
Block a user