]> granicus.if.org Git - ejabberd/commitdiff
Let ejabberdctl handle more shell metacharacters
authorHolger Weiss <holger@zedat.fu-berlin.de>
Sat, 15 Aug 2015 15:01:47 +0000 (17:01 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Sat, 15 Aug 2015 15:01:47 +0000 (17:01 +0200)
Closes #704.

ejabberdctl.template

index 79f443890c2e4be7aa68cded13812084ef3b4af2..4704c85c4a56b7c141535c1fa2bd4ad568ed4abb 100755 (executable)
@@ -405,7 +405,7 @@ ctl()
 ctlexec()
 {
     CONN_NAME=$1; shift
-    COMMAND=$(echo $@ | sed 's/;/\\;/g')
+    COMMAND=$(echo $@ | sed 's/["&$;\|<>()]/\\&/g')
     $EXEC_CMD "$ERL \
       $NAME ${CONN_NAME} \
       -noinput \