From c3ce35dc3dc01a812389b14865177400d84accef Mon Sep 17 00:00:00 2001 From: jexner Date: Mon, 12 Aug 2019 20:48:08 +0200 Subject: [PATCH] Prevent filename glob expansion in _msg_opts in rosbash (#218) The `find` argument glob is not properly quoted resulting in bash filename expansion. This leads to incorrect `find` calls. This fixes issue #192. --- tools/rosbash/rosbash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/rosbash/rosbash b/tools/rosbash/rosbash index 71ec338d..140376f8 100644 --- a/tools/rosbash/rosbash +++ b/tools/rosbash/rosbash @@ -369,7 +369,7 @@ function _msg_opts { else path=$(rospack find ${pkgname}) if [ -d ${path}/msg ]; then - echo $(find -L ${path}/msg -maxdepth 1 -mindepth 1 -name *.msg ! -regex ".*/[.][^./].*" -print0 | tr '\000' '\n' | sed -e "s/.*\/\(.*\)\.msg/${pkgname}\/\1/g") + echo $(find -L ${path}/msg -maxdepth 1 -mindepth 1 -name '*.msg' ! -regex ".*/[.][^./].*" -print0 | tr '\000' '\n' | sed -e "s/.*\/\(.*\)\.msg/${pkgname}\/\1/g") fi fi } @@ -883,7 +883,7 @@ function _msg_opts { path=$(rospack find ${pkgname} 2> /dev/null) if [ $? -eq 0 ] && [ -d ${path}/msg ]; then - echo $(find -L ${path}/msg -maxdepth 1 -mindepth 1 -name *.msg ! -regex ".*/[.][^./].*" -print0 | tr '\000' '\n' | sed -e "s/.*\/\(.*\)\.msg/${pkgname}\/\1/g") + echo $(find -L ${path}/msg -maxdepth 1 -mindepth 1 -name '*.msg' ! -regex ".*/[.][^./].*" -print0 | tr '\000' '\n' | sed -e "s/.*\/\(.*\)\.msg/${pkgname}\/\1/g") fi }