summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2012-09-21 19:03:25 +0000
committerdteske <dteske@FreeBSD.org>2012-09-21 19:03:25 +0000
commit5bd90f70aeb197b19ce714af4c1a59070b9dc689 (patch)
treed041ecdde663dcb11b07368b0990746b6b9decd7 /usr.sbin/bsdconfig/share
parentbe9906f96c7ede292408ef02eae1e83ce8646c13 (diff)
downloadFreeBSD-src-5bd90f70aeb197b19ce714af4c1a59070b9dc689.zip
FreeBSD-src-5bd90f70aeb197b19ce714af4c1a59070b9dc689.tar.gz
Reverse SVN r240770 -- jilles@ made a suggestion that allowed us to redesign
our embedded rescue environment to support /dev/null making r240770 obsolete. Reviewed by: jilles, adrian (co-mentor) Approved by: jilles, adrian (co-mentor)
Diffstat (limited to 'usr.sbin/bsdconfig/share')
-rw-r--r--usr.sbin/bsdconfig/share/common.subr2
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr6
-rw-r--r--usr.sbin/bsdconfig/share/mustberoot.subr12
-rw-r--r--usr.sbin/bsdconfig/share/strings.subr2
-rw-r--r--usr.sbin/bsdconfig/share/sysrc.subr22
5 files changed, 22 insertions, 22 deletions
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index 49d3023..c724c62 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -72,7 +72,7 @@ f_err()
#
f_quietly()
{
- "$@" >&- 2>&-
+ "$@" > /dev/null 2>&1
}
# f_have $anything ...
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index 4f86e7b..d2ba529 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -1321,7 +1321,7 @@ f_dialog_init()
# Process stored command-line arguments
#
SECURE=$( set -- "$ARGV"
- while getopts S flag >&-; do
+ while getopts S flag > /dev/null; do
case "$flag" in
S) echo 1;;
\?) continue;;
@@ -1329,7 +1329,7 @@ f_dialog_init()
done
)
USE_XDIALOG=$( set -- "$ARGV"
- while getopts SX flag >&-; do
+ while getopts SX flag > /dev/null; do
case "$flag" in
S|X) echo 1;;
\?) continue;;
@@ -1372,7 +1372,7 @@ f_dialog_init()
eval xauth -if \~$SUDO_USER/.Xauthority extract - \
\"\$HOSTNAME/unix:\$displaynum\" \
\"\$HOSTNAME:\$displaynum\" | sudo sh -c 'xauth -ivf \
- ~root/.Xauthority merge - >&- 2>&-'
+ ~root/.Xauthority merge - > /dev/null 2>&1'
fi
#
diff --git a/usr.sbin/bsdconfig/share/mustberoot.subr b/usr.sbin/bsdconfig/share/mustberoot.subr
index 234724e..c6514c0 100644
--- a/usr.sbin/bsdconfig/share/mustberoot.subr
+++ b/usr.sbin/bsdconfig/share/mustberoot.subr
@@ -85,7 +85,7 @@ f_become_root_via_sudo()
#
# Check sudo(8) access before prompting for password.
#
- :| sudo -S -v 2>&-
+ :| sudo -S -v 2> /dev/null
if [ $? -ne $SUCCESS ]; then
#
# sudo(8) access denied. Prompt for their password.
@@ -112,7 +112,7 @@ f_become_root_via_sudo()
--ok-label "$msg_ok" \
--cancel-label "$msg_cancel" \
--password --inputbox "$msg" $size \
- 2>&1 >&- )
+ 2>&1 > /dev/null )
retval=$?
# Catch X11-related errors
@@ -141,7 +141,7 @@ f_become_root_via_sudo()
#
# Validate sudo(8) credentials
#
- sudo -S -v 2>&- <<-EOF
+ sudo -S -v 2> /dev/null <<-EOF
$password
EOF
retval=$?
@@ -186,7 +186,7 @@ f_become_root_via_sudo()
displaynum="${DISPLAY#*:}"
xauth -f ~/.Xauthority extract - $HOSTNAME/unix:$displaynum \
$HOSTNAME:$displaynum | sudo sh -c 'xauth -ivf \
- ~root/.Xauthority merge - >&- 2>&-'
+ ~root/.Xauthority merge - > /dev/null 2>&1'
fi
# Re-execute ourselves with sudo(8)
@@ -254,7 +254,7 @@ f_authenticate_some_user()
$height $width \
"$field_username" "" \
"$field_password" "" \
- 2>&1 >&- )
+ 2>&1 > /dev/null )
retval=$?
# Catch X11-related errors
@@ -302,7 +302,7 @@ f_authenticate_some_user()
su -m "$user" <<-EOF
sh <<EOS
sudo -k
- sudo -S -v 2>&- <<EOP
+ sudo -S -v 2> /dev/null <<EOP
$password
EOP
EOS
diff --git a/usr.sbin/bsdconfig/share/strings.subr b/usr.sbin/bsdconfig/share/strings.subr
index fac55fe..1a330ad 100644
--- a/usr.sbin/bsdconfig/share/strings.subr
+++ b/usr.sbin/bsdconfig/share/strings.subr
@@ -98,7 +98,7 @@ f_isinteger()
# Attempt to perform arithmetic divison (an operation which will exit
# with error unless arg is a valid positive/negative whole integer).
#
- ( : $((0/$arg)) ) >&- 2>&-
+ ( : $((0/$arg)) ) > /dev/null 2>&1
}
fi # ! $_STRINGS_SUBR
diff --git a/usr.sbin/bsdconfig/share/sysrc.subr b/usr.sbin/bsdconfig/share/sysrc.subr
index e39b67a..014ab46 100644
--- a/usr.sbin/bsdconfig/share/sysrc.subr
+++ b/usr.sbin/bsdconfig/share/sysrc.subr
@@ -134,7 +134,7 @@ f_sysrc_get()
#
f_clean_env --except RC_CONFS RC_DEFAULTS SUCCESS
- . "$RC_DEFAULTS" >&- 2>&-
+ . "$RC_DEFAULTS" > /dev/null 2>&1
unset RC_DEFAULTS
# no longer needed
@@ -153,7 +153,7 @@ f_sysrc_get()
# If RC_CONFS is defined, set $rc_conf_files to an explicit
# value, modifying the default behavior of source_rc_confs().
#
- ( : ${RC_CONFS?} ) >&- 2>&-
+ ( : ${RC_CONFS?} ) > /dev/null 2>&1
if [ $? -eq ${SUCCESS:-0} ]; then
rc_conf_files="$RC_CONFS"
_rc_confs_set=1
@@ -162,7 +162,7 @@ f_sysrc_get()
unset SUCCESS
# no longer needed
- source_rc_confs >&- 2>&-
+ source_rc_confs > /dev/null 2>&1
#
# If the query was for `rc_conf_files' AND after calling
@@ -190,7 +190,7 @@ f_sysrc_get()
# such as "${varname?}" and "${varname:?}" (see "Parameter
# Expansion" in sh(1) for more information).
#
- eval echo '"${'"$1"'}"' 2>&-
+ eval echo '"${'"$1"'}"' 2> /dev/null
)
}
@@ -221,7 +221,7 @@ f_sysrc_get_default()
#
f_clean_env --except RC_DEFAULTS
- . "$RC_DEFAULTS" >&- 2>&-
+ . "$RC_DEFAULTS" > /dev/null 2>&1
unset RC_DEFAULTS
# no longer needed
@@ -232,7 +232,7 @@ f_sysrc_get_default()
# such as "${varname?}" and "${varname:?}" (see "Parameter
# Expansion" in sh(1) for more information).
#
- eval echo '"${'"$1"'}"' 2>&-
+ eval echo '"${'"$1"'}"' 2> /dev/null
)
}
@@ -477,7 +477,7 @@ f_sysrc_set()
# permissions from the temporary file).
#
local mode
- mode=$( stat -f '%#Lp' "$file" 2>&- )
+ mode=$( stat -f '%#Lp' "$file" 2> /dev/null )
f_quietly chmod "${mode:-0644}" "$tmpfile"
#
@@ -486,14 +486,14 @@ f_sysrc_set()
# permissions (so we throw stderr into the bit-bucket).
#
local owner
- owner=$( stat -f '%u:%g' "$file" 2>&- )
+ owner=$( stat -f '%u:%g' "$file" 2> /dev/null )
f_quietly chown "${owner:-root:wheel}" "$tmpfile"
#
# Operate on the matching file, replacing only the last occurrence.
#
local new_contents retval
- new_contents=$( tail -r $file 2>&- )
+ new_contents=$( tail -r $file 2> /dev/null )
new_contents=$( echo "$new_contents" | awk -v varname="$varname" \
-v new_value="$new_value" "$f_sysrc_set_awk" )
retval=$?
@@ -572,8 +572,8 @@ f_sysrc_delete()
# permissions) to instead match the destination file.
#
local mode owner
- mode=$( stat -f '%#Lp' "$file" 2>&- )
- owner=$( stat -f '%u:%g' "$file" 2>&- )
+ mode=$( stat -f '%#Lp' "$file" 2> /dev/null )
+ owner=$( stat -f '%u:%g' "$file" 2> /dev/null )
f_quietly chmod "${mode:-0644}" "$tmpfile"
f_quietly chown "${owner:-root:wheel}" "$tmpfile"
OpenPOWER on IntegriCloud