From 4a8cdea9d336b2198027f697decb3222d5afdf69 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Thu, 18 Feb 2021 06:17:35 +0000 Subject: [PATCH] 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@ --- usr.sbin/rcctl/rcctl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 } -- 2.20.1