tomb

the crypto undertaker
git clone git://parazyd.org/tomb.git
Log | Files | Refs | README | LICENSE

commit a9bc4c2489681105a370a5dca68eb27fd4643b33
parent 3416ad2d2c50f629ea242d326729ff8179960a73
Author: hellekin <hellekin@cepheide.org>
Date:   Mon, 20 Oct 2014 12:52:21 -0300

Remove fatally broken failure :)

Diffstat:
Mtomb | 19+++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/tomb b/tomb @@ -131,14 +131,11 @@ check_shm() { || { # mount the tmpfs if the SO doesn't already mkdir /run/shm - [[ $? = 0 ]] || { - fatal "Fatal error creating a directory for temporary files" - return 1 } + (( $? )) && _failure "Fatal error creating a directory for temporary files" + mount -t tmpfs tmpfs /run/shm \ -o nosuid,noexec,nodev,mode=0600,uid="$_uid",gid="$_gid" - [[ $? = 0 ]] || { - fatal "Fatal error mounting tmpfs in /run/shm for temporary files" - return 1 } + (( $? )) && _failure "Fatal error mounting tmpfs in /run/shm for temporary files" SHMPREFIX=/run/shm } @@ -153,14 +150,12 @@ check_shm() { tmp_create() { local tfile="${TMPPREFIX}${RANDOM}" touch "$tfile" - [[ $? = 0 ]] || { - fatal "Fatal error creating a temporary file: ::1 temp file::" $tfile - return 1 } + (( $? )) && _failure "Fatal error creating a temporary file: ::1 temp file::" $tfile + chown "$_uid":"$_gid" "$tfile" chmod 0600 "$tfile" - [[ $? = 0 ]] || { - fatal "Fatal error setting permissions on temporary file: ::1 temp file::" $tfile - return 1 } + (( $? )) && _failure "Fatal error setting permissions on temporary file: ::1 temp file::" $tfile + _verbose "Created tempfile: ::1 temp file::" $tfile tomb_tempfiles+=($tfile) return 0