File: removeprivacybreach

package info (click to toggle)
imagemagick 8%3A7.1.1.43%2Bdfsg1-1%2Bdeb13u3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 96,160 kB
  • sloc: ansic: 370,601; cpp: 22,835; xml: 11,549; perl: 6,280; sh: 6,203; makefile: 3,484; tcl: 459
file content (18 lines) | stat: -rwxr-xr-x 571 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
set -e

# Set $TMPDIR to "/tmp" only if it didn't have a value previously
: ${TMPDIR:=/tmp}

# Remove the temporary directory when the script finishes
unset temporary_dir
trap '[ "$temporary_dir" ] && rm -rf "$temporary_dir"' EXIT

save_mask=$(umask)
umask 077
temporary_dir=$(mktemp -d "$TMPDIR/xslt-XXXXXXXXXXXXXXXXXXXXXXXXXXXXX") || { echo "ERROR creating a temporary file" >&2; exit 1; }
umask "$save_mask"
temporary_file=$temporary_dir/htmlprivacy

xsltproc --novalid --nonet --stringparam filename "$2" "$1" "$2" > $temporary_file
mv $temporary_file "$2"