From: ajacoutot Date: Thu, 18 Feb 2021 06:17:35 +0000 (+0000) Subject: Only pick up files matching alphanumeric and underscore characters under X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4a8cdea9d336b2198027f697decb3222d5afdf69;p=openbsd Only pick up files matching alphanumeric and underscore characters under /etc/rc.d. This prevents issues with editor backup files (foo~) or other bogus files. ok sthen@ --- diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index b7bd820fa05..954f32890e5 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: rcctl.sh,v 1.108 2020/03/31 08:03:44 ajacoutot Exp $ +# $OpenBSD: rcctl.sh,v 1.109 2021/02/18 06:17:35 ajacoutot Exp $ # # Copyright (c) 2014, 2015 Antoine Jacoutot # Copyright (c) 2014 Ingo Schwarze @@ -54,7 +54,7 @@ ls_rcscripts() cd /etc/rc.d && set -- * for _s; do - [[ ${_s} = *.* ]] && continue + [[ ${_s} == +([[:alnum:]_]) ]] || continue [ ! -d "${_s}" ] && echo "${_s}" done }