summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/platform/openbsd.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/platform/openbsd.sh b/src/platform/openbsd.sh
new file mode 100644
index 0000000..b66b32f
--- /dev/null
+++ b/src/platform/openbsd.sh
@@ -0,0 +1,40 @@
+# Copyright (C) 2012 Jonathan Chu <milki@rescomp.berkeley.edu>. All Rights Reserved.
+# Copyright (C) 2015 David Dahlberg <david.dahlberg@fkie.fraunhofer.de>. All Rights Reserved.
+# This file is licensed under the GPLv2+. Please see COPYING for more information.
+
+tmpdir() {
+ [[ -n $SECURE_TMPDIR ]] && return
+ local warn=1
+ [[ $1 == "nowarn" ]] && warn=0
+ local template="$PROGRAM.XXXXXXXXXXXXX"
+ if [[ $(sysctl -n kern.usermount) == 1 ]]; then
+ SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")"
+ mount -t tmpfs -o -s16M tmpfs "$SECURE_TMPDIR" || die "Error: could not create tmpfs."
+ unmount_tmpdir() {
+ [[ -n $SECURE_TMPDIR && -d $SECURE_TMPDIR ]] || return
+ umount "$SECURE_TMPDIR"
+ rm -rf "$SECURE_TMPDIR"
+ }
+ trap unmount_tmpdir INT TERM EXIT
+ else
+ [[ $warn -eq 1 ]] && yesno "$(cat <<-_EOF
+ The sysctl kern.usermount is disabled, therefore it is not
+ possible to create a tmpfs for temporary storage of files
+ in memory.
+ This means that it may be difficult to entirely erase
+ the temporary non-encrypted password file after editing.
+
+ Are you sure you would like to continue?
+ _EOF
+ )"
+ SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")"
+ shred_tmpfile() {
+ find "$SECURE_TMPDIR" -type f -exec $SHRED {} +
+ rm -rf "$SECURE_TMPDIR"
+ }
+ trap shred_tmpfile INT TERM EXIT
+ fi
+}
+
+GETOPT="gnugetopt"
+SHRED="rm -P -f"
66b6c57c075de0e45bfdb0d574120c409512d36f&follow=1'>Do not print 'logout' menu when not logged inRené 'Necoro' Neumann2-4/+6 2013-10-16Check user's authorisation when loading entries by ID.René 'Necoro' Neumann4-6/+43 2013-10-16Print username or description in titleRené 'Necoro' Neumann3-2/+5 2013-10-15QuotestyleRené 'Necoro' Neumann11-86/+88 2013-10-15Flash on error in all formsRené 'Necoro' Neumann2-5/+21 2013-10-15Streamline CSSRené 'Necoro' Neumann2-77/+24 2013-10-15Margin for buttons in formsRené 'Necoro' Neumann1-0/+3 2013-10-15Support flashingRené 'Necoro' Neumann5-2/+34 2013-10-15Moved user implementation from model to loginRené 'Necoro' Neumann3-28/+13 2013-10-15Nicer organised importsRené 'Necoro' Neumann6-24/+40 2013-10-14Finish login stuffRené 'Necoro' Neumann11-29/+143 2013-10-14More model tuningRené 'Necoro' Neumann1-3/+3 2013-10-14Add User to modelRené 'Necoro' Neumann1-8/+25 2013-09-30Add first API stuff -- SingleExpense and CategoryRené 'Necoro' Neumann2-1/+13 2013-09-30Force python2René 'Necoro' Neumann1-1/+1 2013-09-24More margin at the bottom for expense listingRené 'Necoro' Neumann1-1/+1 2013-09-24Better pie formattingRené 'Necoro' Neumann3-6/+8 2013-09-24Increase width of page to 760pxRené 'Necoro' Neumann3-8/+9 2013-09-16typoRené 'Necoro' Neumann1-1/+1 2013-09-15Fix display of one monthRené 'Necoro' Neumann1-2/+2 2013-09-14Draw pies using highcharts JS-libRené 'Necoro' Neumann5-20/+99