aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-03-25 19:26:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-03-25 19:26:51 -0300
commit53e30563bd825d21d276b3f9c79e94bb754f642f (patch)
treeadddcc6e926800fd84b03866b8c4b95e66bcfa2c
parentd08a02dc906f5a121e58a37c4c0af9c7cb3938f3 (diff)
downloadkeyringer-53e30563bd825d21d276b3f9c79e94bb754f642f.tar.gz
keyringer-53e30563bd825d21d276b3f9c79e94bb754f642f.tar.bz2
Fix secret name when encrypting a folder
-rw-r--r--ChangeLog2
-rwxr-xr-xlib/keyringer/actions/encrypt7
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 10da2b2..f503212 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
Fix git parameter expansion
+ Fix secret name when encrypting a folder
+
2019-01-29 - 0.5.4 - Silvio Rhatto <rhatto@riseup.net>
Use --no-encrypt-to GnuPG option to strictly respect the recipients file
diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt
index c1d5601..1256374 100755
--- a/lib/keyringer/actions/encrypt
+++ b/lib/keyringer/actions/encrypt
@@ -95,9 +95,14 @@ if [ "$UNENCRYPTED_FILE" != "-" ] && [ -d "$UNENCRYPTED_FILE" ]; then
# Time to go recursive
BASEPATH="`basename $FILE .asc`"
FILEPATH="`dirname "$UNENCRYPTED_FILE"`"
+
+ if [ "$FILEPATH" == "." ]; then
+ FILEPATH="$(cd `dirname "$UNENCRYPTED_FILE"` &> /dev/null & pwd)"
+ fi
+
find $UNENCRYPTED_FILE | while read file; do
if [ ! -d "$file" ]; then
- dir="`dirname "$file" | sed -e "s|^$FILEPATH|$BASEPATH|g"`"
+ dir="`dirname "$file" | sed -e "s|^$UNENCRYPTED_FILE|$BASEPATH|" -e "s|^$FILEPATH|$BASEPATH|"`"
keyringer_get_new_file `basename "$file"`
keyringer_encrypt "$dir/$FILE" $file
fi