Fixed some item name escaping when containin < or > characters

This commit is contained in:
Louwrentius 2010-05-14 15:54:28 +00:00
parent 7c2d336dba
commit 9feea3fb59
1 changed files with 6 additions and 1 deletions

7
ppss
View File

@ -1345,6 +1345,8 @@ escape_item () {
sed s/\\|/\\\\\\\\\\\\\\|/g | \ sed s/\\|/\\\\\\\\\\\\\\|/g | \
sed s/\&/\\\\\\\\\\\\\\&/g | \ sed s/\&/\\\\\\\\\\\\\\&/g | \
sed s/\;/\\\\\\\\\\\\\\;/g | \ sed s/\;/\\\\\\\\\\\\\\;/g | \
sed s/\>/\\\\\\\\\\>/g | \
sed s/\</\\\\\\\\\\</g | \
sed s/\(/\\\\\\\\\\(/g | \ sed s/\(/\\\\\\\\\\(/g | \
sed s/\)/\\\\\\\\\\)/g ` sed s/\)/\\\\\\\\\\)/g `
} }
@ -1628,6 +1630,7 @@ get_item () {
fi fi
ITEM="${ARRAY[$ARRAY_POINTER]}" ITEM="${ARRAY[$ARRAY_POINTER]}"
if [ -z "$ITEM" ] if [ -z "$ITEM" ]
then then
((ARRAY_POINTER++)) ((ARRAY_POINTER++))
@ -1707,7 +1710,6 @@ elapsed () {
} }
commando () { commando () {
log DEBUG "-------------------------------------" log DEBUG "-------------------------------------"
if [ "$DAEMON" == "1" ] if [ "$DAEMON" == "1" ]
then then
@ -1736,6 +1738,7 @@ commando () {
# #
ITEM="$1" ITEM="$1"
if [ "$RECURSION" == "1" ] if [ "$RECURSION" == "1" ]
then then
escape_item "$ITEM" escape_item "$ITEM"
@ -1753,6 +1756,7 @@ commando () {
# Therefore, the output directory must reflect the original directory # Therefore, the output directory must reflect the original directory
# structure. If recursion is not used, this is not necessary. # structure. If recursion is not used, this is not necessary.
# #
if [ "$ERR_STATE" == "0" ] if [ "$ERR_STATE" == "0" ]
then then
@ -1813,6 +1817,7 @@ commando () {
ITEM="$PPSS_LOCAL_TMPDIR/$ITEM_NO_PATH" ITEM="$PPSS_LOCAL_TMPDIR/$ITEM_NO_PATH"
fi fi
fi fi
# #
# Create the log file containing the output of the command. # Create the log file containing the output of the command.