Make password storing optional in SecMount
This commit is contained in:
parent
a52f17606a
commit
82477517c3
1 changed files with 9 additions and 2 deletions
11
bin/secmount
11
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"
|
||||
|
|
Loading…
Reference in a new issue