The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d783591a7debc75045e8fbb7c57622c6fda2da01
commit d783591a7debc75045e8fbb7c57622c6fda2da01 Author: Mark Johnston <ma...@freebsd.org> AuthorDate: 2025-06-27 18:59:41 +0000 Commit: Mark Johnston <ma...@freebsd.org> CommitDate: 2025-06-27 20:18:24 +0000 Revert "rc: Fix scripts that need pathname expansion" The commit which motivated this is being reverted. This reverts commit 7faddeb395b7976b44393db24f48ec47040eff07. --- libexec/rc/rc.d/moused | 2 +- libexec/rc/rc.d/syscons | 4 ++-- libexec/rc/rc.subr | 24 ++++-------------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/libexec/rc/rc.d/moused b/libexec/rc/rc.d/moused index 9bb1a5cedc31..6f1b95af0f0a 100755 --- a/libexec/rc/rc.d/moused +++ b/libexec/rc/rc.d/moused @@ -69,7 +69,7 @@ moused_start() ;; esac - for ttyv in $(expandpath "/dev/ttyv*"); do + for ttyv in /dev/ttyv* ; do vidcontrol < ${ttyv} ${mousechar_arg} -m on done } diff --git a/libexec/rc/rc.d/syscons b/libexec/rc/rc.d/syscons index 7ad9b720e454..325628a83d8c 100755 --- a/libexec/rc/rc.d/syscons +++ b/libexec/rc/rc.d/syscons @@ -237,7 +237,7 @@ syscons_configure_keyboard() if [ -n "${allscreens_kbdflags}" ]; then sc_init echo -n ' allscreens_kbd' - for ttyv in $(expandpath "/dev/ttyv*"); do + for ttyv in /dev/ttyv*; do kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1 done fi @@ -381,7 +381,7 @@ syscons_start() if [ -n "${allscreens_flags}" ]; then sc_init echo -n ' allscreens' - for ttyv in $(expandpath "/dev/ttyv*"); do + for ttyv in /dev/ttyv*; do vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1 done fi diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index d760b75a15a3..359eebd1d342 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -223,11 +223,10 @@ rc_trace() list_vars() { # Localize 'set' option below. - local - _s + local - local IFS=$'\n' line varname - # Disable path expansion temporarily in unquoted 'for' parameters below. - _s=$(set +o) + # Disable path expansion in unquoted 'for' parameters below. set -o noglob for line in $(set); do @@ -242,7 +241,6 @@ list_vars() ;; esac done - eval $_s } # set_rcvar [var] [defval] [desc] @@ -294,19 +292,6 @@ set_rcvar_obsolete() eval ${_var}_obsolete_msg=\"$*\" } -# expandpath str -# Apply pathname expansion to str. -# -expandpath() -{ - local _s - - _s=$(set +o) - set +o noglob - echo $1 - eval $_s -} - # # force_depend script [rcvar] # Force a service to start. Intended for use by services @@ -1798,19 +1783,18 @@ _run_rc_setup() _run_rc_doit() { - local _m _s + local _m debug "run_rc_command: doit: $*" _m=$(umask) ${_umask:+umask ${_umask}} # Disable pathname expansion temporarily for run_rc_command. - _s=$(set +o) set -o noglob eval "$@" + set +o noglob _return=$? umask ${_m} - eval $_s # If command failed and force isn't set, request exit. if [ $_return -ne 0 ] && [ -z "$rc_force" ]; then