diff --git a/src/tm_mad/lvm/tm_context.sh b/src/tm_mad/lvm/tm_context.sh index 6d6aea06ab..74061b6637 100755 --- a/src/tm_mad/lvm/tm_context.sh +++ b/src/tm_mad/lvm/tm_context.sh @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +CONTEXT_FILE=$1 + while (( "$#" )); do if [ "$#" == "1" ]; then DST=$1 @@ -56,7 +58,12 @@ for f in $SRC; do ;; *) - exec_and_log "cp -R $f $ISO_DIR" + if [ $SECURE_CONTEXT -eq 0 -o "$f" == "$CONTEXT_FILE" ]; then + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" + else + log "not copying potentialy dangerous file $f" + fi ;; esac done diff --git a/src/tm_mad/shared/tm_context.sh b/src/tm_mad/shared/tm_context.sh index db05f2dda0..fef2593fbe 100755 --- a/src/tm_mad/shared/tm_context.sh +++ b/src/tm_mad/shared/tm_context.sh @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +CONTEXT_FILE=$1 + while (( "$#" )); do if [ "$#" == "1" ]; then DST=$1 @@ -53,8 +55,12 @@ for f in $SRC; do ;; *) - exec_and_log "cp -R $f $ISO_DIR" \ - "Error copying $f to $ISO_DIR" + if [ $SECURE_CONTEXT -eq 0 -o "$f" == "$CONTEXT_FILE" ]; then + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" + else + log "not copying potentialy dangerous file $f" + fi ;; esac done diff --git a/src/tm_mad/ssh/tm_context.sh b/src/tm_mad/ssh/tm_context.sh index d5c16f6721..772b549e7f 100755 --- a/src/tm_mad/ssh/tm_context.sh +++ b/src/tm_mad/ssh/tm_context.sh @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +CONTEXT_FILE=$1 + while (( "$#" )); do if [ "$#" == "1" ]; then DST=$1 @@ -58,8 +60,12 @@ for f in $SRC; do ;; *) - exec_and_log "cp -R $f $ISO_DIR" \ - "Error copying $f to $ISO_DIR" + if [ $SECURE_CONTEXT -eq 0 -o "$f" == "$CONTEXT_FILE" ]; then + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" + else + log "not copying potentialy dangerous file $f" + fi ;; esac done