Ticket #44255: patch-use_apple_mktemp.diff

File patch-use_apple_mktemp.diff, 1.9 KB (added by john@…, 10 years ago)
  • password-store.sh

    diff -r -u src.orig/password-store.sh src/password-store.sh
    old new  
    168168        [[ $1 == "nowarn" ]] && warn=0
    169169        local template="$PROGRAM.XXXXXXXXXXXXX"
    170170        if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then
    171                 SECURE_TMPDIR="$(mktemp -d "/dev/shm/$template")"
     171                SECURE_TMPDIR="$(${MKTEMP} -d "/dev/shm/$template")"
    172172                remove_tmpfile() {
    173173                        rm -rf "$SECURE_TMPDIR"
    174174                }
     
    182182                Are you sure you would like to continue?
    183183                _EOF
    184184                )"
    185                 SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")"
     185                SECURE_TMPDIR="$(${MKTEMP} -d "${TMPDIR:-/tmp}/$template")"
    186186                shred_tmpfile() {
    187187                        find "$SECURE_TMPDIR" -type f -exec $SHRED {} +
    188188                        rm -rf "$SECURE_TMPDIR"
     
    421421        local passfile="$PREFIX/$path.gpg"
    422422
    423423        tmpdir #Defines $SECURE_TMPDIR
    424         local tmp_file="$(mktemp -u "$SECURE_TMPDIR/XXXXX")-${path//\//-}.txt"
     424        local tmp_file="$(${MKTEMP} -u "$SECURE_TMPDIR/XXXXX")-${path//\//-}.txt"
    425425
    426426
    427427        local action="Add"
  • platform/darwin.sh

    diff -r -u src.orig/platform/darwin.sh src/platform/darwin.sh
    old new  
    2424                rm -rf "$SECURE_TMPDIR"
    2525        }
    2626        trap unmount_tmpdir INT TERM EXIT
    27         SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$PROGRAM.XXXXXXXXXXXXX")"
     27        SECURE_TMPDIR="$(${MKTEMP} -d "${TMPDIR:-/tmp}/$PROGRAM.XXXXXXXXXXXXX")"
    2828        DARWIN_RAMDISK_DEV="$(hdid -drivekey system-image=yes -nomount 'ram://32768' | cut -d ' ' -f 1)" # 32768 sectors = 16 mb
    2929        [[ -z $DARWIN_RAMDISK_DEV ]] && die "Error: could not create ramdisk."
    3030        newfs_hfs -M 700 "$DARWIN_RAMDISK_DEV" &>/dev/null || die "Error: could not create filesystem on ramdisk."
     
    3333
    3434GETOPT=@@PREFIX@@/bin/getopt
    3535SHRED="srm -f -z"
     36MKTEMP="/usr/bin/mktemp"