Skip to content

Commit 5fd72d7

Browse files
committed
Also canonicalize job dir before testing cleanup inclusion in it.
1 parent b438a48 commit 5fd72d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/psij/executors/batch/common/batch_lib.mustache

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,16 @@ do_cleanup() {
115115
if [ "$FAILED" == "0" ] || [ "{{job.spec.cleanup_on_failure}}" != "0" ]; then
116116
117117
TARGET=`readlink -m "$TARGET"`
118+
DIR=`readlink -m "{{job.spec.directory}}"`
118119
119120
[ "{{psij.debug}}" != "0" ] && update_status "LOG Cleaning up $TARGET"
120121
121122
case "$TARGET" in
122-
"{{job.spec.directory}}"*)
123+
"$DIR"*)
123124
rm -rf "$TARGET"
124125
;;
125126
*)
126-
fail 121 "Cannot clean $TARGET outside of job directory {{job.spec.directory}}"
127+
fail 121 "Cannot clean $TARGET outside of job directory $DIR"
127128
;;
128129
esac
129130
fi

0 commit comments

Comments
 (0)