summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-05-20 12:06:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-05-20 12:06:24 -0300
commit00c0df3775d715324c4ab28cd39290184fcc71c2 (patch)
treee991c8fdc04066c8a3c36cb151a8a78a4111a517 /lib
parent50d334dbeb99301df586cead506c6bd0ec7fb223 (diff)
parentac8cb00ad88736377a8e9458390cc99aba92cb22 (diff)
downloadkeyringer-00c0df3775d715324c4ab28cd39290184fcc71c2.tar.gz
keyringer-00c0df3775d715324c4ab28cd39290184fcc71c2.tar.bz2
Merge tag 'upstream_keyringer_0.3.5' into debian
Upstream version 0.3.5
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/edit9
-rw-r--r--lib/keyringer/editors/vim5
-rwxr-xr-xlib/keyringer/functions2
3 files changed, 12 insertions, 4 deletions
diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit
index 3ccf977..a5f14d4 100755
--- a/lib/keyringer/actions/edit
+++ b/lib/keyringer/actions/edit
@@ -36,9 +36,12 @@ elif [ "$BASENAME" == "open" ]; then
fi
fi
+# Set APPNAME
+APPNAME="`echo $APP | awk '{ print $1 }'`"
+
# Prompt
-echo "Press any key to open the decrypted data with $APP, Ctrl-C to abort"
-echo "WARNING: please make sure that $APP doesn't leak data to external applications or files"
+echo "Press any key to open the decrypted data with $APPNAME, Ctrl-C to abort"
+echo "WARNING: please make sure that $APPNAME doesn't leak data to external applications or files"
echo "Press ENTER to continue"
read -s key
$APP "$TMPWORK"
@@ -53,7 +56,7 @@ wait
# Thus, we cannot just wipe the file and exit keyringer, as the user might have a buffered copy
# of the unencrypted file in the application, which can lead to information leakage if the user
# saves the file and leaves the editor.
-echo "Press any key when done using the file and you're sure that $APP is closed."
+echo "Press any key when done using the file and you're sure that $APPNAME is closed."
read -s -n 1
# Encrypt again
diff --git a/lib/keyringer/editors/vim b/lib/keyringer/editors/vim
new file mode 100644
index 0000000..0f877df
--- /dev/null
+++ b/lib/keyringer/editors/vim
@@ -0,0 +1,5 @@
+" Use sane defaults for VIM to avoid data leakage
+" See https://keyringer.pw/trac/ticket/50
+set nowritebackup
+set nobackup
+set viminfo="NONE"
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index 50d01db..fdd8439 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -287,7 +287,7 @@ function keyringer_set_env {
# Avoid viminfo, see https://keyringer.pw/trac/ticket/50
if $EDITOR --help | grep -q -e "^VIM"; then
if ! echo $EDITOR | grep -q -- "-i NONE"; then
- EDITOR="$EDITOR -i NONE '+set nowritebackup' '+set nobackup'"
+ EDITOR="$EDITOR -S `dirname $LIB`/editors/vim"
fi
fi