From a52f17606a85732845f7c91a320de6dfd463c2bb Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 3 Apr 2023 15:48:46 +0200 Subject: [PATCH] Add secmount wrapper for securefs --- bin/secmount | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/secmount diff --git a/bin/secmount b/bin/secmount new file mode 100755 index 0000000..ac6a7a3 --- /dev/null +++ b/bin/secmount @@ -0,0 +1,20 @@ +#!/bin/sh + +target=$(realpath "$1") +if ! [ -d "$target" ] +then + echo "Directory '$(basename "$target")' does not exist!" + exit 1 +fi +back="$(dirname "$target")/.$(basename "$target")" +if ! [ -d "$back" ] +then + mkdir -p "$back" + passwd=$(zenity --password) + echo $passwd | secret-tool store --label "SecureFS $target" application securefs directory "$target" + echo $passwd | securefs c "$back" +else + passwd=$(secret-tool lookup application securefs directory "$target") +fi + +exec echo $passwd | securefs mount "$back" "$target"