From 82477517c37d431a0c4debc620d801789803fa20 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Mon, 3 Apr 2023 16:01:39 +0200 Subject: [PATCH] Make password storing optional in SecMount --- bin/secmount | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/secmount b/bin/secmount index ac6a7a3..e5783cc 100755 --- a/bin/secmount +++ b/bin/secmount @@ -1,5 +1,7 @@ #!/bin/sh +title="SecMount" + target=$(realpath "$1") if ! [ -d "$target" ] then @@ -10,11 +12,16 @@ 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" + passwd=$(zenity --password --title $title) + if zenity --question --title $title --text "Save password in login keyring?" + then echo $passwd | secret-tool store --label "SecureFS $target" application securefs directory "$target" + fi echo $passwd | securefs c "$back" else passwd=$(secret-tool lookup application securefs directory "$target") + if [ -z "$passwd" ] + then passwd=$(zenity --password --title $title) + fi fi exec echo $passwd | securefs mount "$back" "$target"