summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorparazyd <parazyd@dyne.org>2017-03-23 12:07:05 (GMT)
committer parazyd <parazyd@dyne.org>2017-03-23 12:07:05 (GMT)
commitbd58e6a52609fa764168bde27b85c04cdc255ebd (patch)
treef15ce1f1ef6e63929ecb484ffb930ede6795dec0
parent6f59b5e2a7f70b07492562fa5b543625bde9dcfb (diff)
fix opmux; fix pass bug where it reencrypts everything on every update
also enable static building of bins on musl, and switch to busybox netcat
-rw-r--r--Makefile2
-rwxr-xr-xbuild/build-gnu.sh1
-rwxr-xr-xsrc/jaro4
-rwxr-xr-xsrc/zlibs/filters2
-rwxr-xr-xsrc/zlibs/helpers2
-rwxr-xr-xsrc/zlibs/mutt15
6 files changed, 14 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 8bded03..4e36977 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ install:
clean:
rm -f src/*.o
- rm -f src/pgpewrap
+ rm -f src/gpgewrap
rm -f src/fetchaddr
rm -f src/parsedate
rm -f src/dotlock
diff --git a/build/build-gnu.sh b/build/build-gnu.sh
index 3e14e89..a60a3a5 100755
--- a/build/build-gnu.sh
+++ b/build/build-gnu.sh
@@ -5,6 +5,7 @@ distro=unknown
builddir=`pwd`
# cc="${builddir}/cc-static.zsh"
cc="gcc -O3"
+[[ "$OSTYPE" = linux-musl ]] && cc="gcc -Os -static"
which apt-get > /dev/null && distro=debian
which yum > /dev/null && distro=fedora
diff --git a/src/jaro b/src/jaro
index c698d3c..7fc06bd 100755
--- a/src/jaro
+++ b/src/jaro
@@ -346,7 +346,7 @@ check_bin() {
# check for pass, else fallback
if isfound pass; then
act "keyring in use: pass (auto-detected)"
- export PASSWORD_STORE_DIR=$HOME/.password-store
+ export PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR:-$HOME/.password-store}
[[ -d $PASSWORD_STORE_DIR ]] || {
error "the 'pass' keyring is found but not initialised"
error "run 'pass init your-gpg-id' or uninstall it to use other keyrings"
@@ -371,7 +371,7 @@ check_bin() {
case $JARO_KEYRING in
pass)
act "keyring in use: pass (set in JARO_KEYRING)"
- export PASSWORD_STORE_DIR=$HOME/.password-store
+ export PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR:-$HOME/.password-store}
[[ -d $PASSWORD_STORE_DIR ]] || {
error "the 'pass' keyring is found but not initialised"
error "run 'pass init your-gpg-id'"
diff --git a/src/zlibs/filters b/src/zlibs/filters
index 67951b9..ea6f59e 100755
--- a/src/zlibs/filters
+++ b/src/zlibs/filters
@@ -56,7 +56,7 @@ init_inbox() {
if [[ $PASS = 1 ]]; then
GPGID=${$(awk '/default-key/ { print $2 }' $HOME/.gnupg/gpg.conf)}
- pass init ${GPGID}
+ [[ -f "$PASSWORD_STORE_DIR/.gpg-id" ]] || pass init ${GPGID}
fi
${=mkdir} "$MAILDIRS/cache"
${=mkdir} "$MAILDIRS/logs"
diff --git a/src/zlibs/helpers b/src/zlibs/helpers
index 92c6bca..d167a7b 100755
--- a/src/zlibs/helpers
+++ b/src/zlibs/helpers
@@ -263,7 +263,7 @@ is_online() {
;;
host)
func "trying to connect ${_host} port ${_port}"
- nc -w 16 -z ${_host} ${_port} > /dev/null
+ busybox nc -w 16 -z ${_host} ${_port} > /dev/null
{ test $? = 0 } || {
error "Host unreachable: $_host"
act "Network connection is checked with 16s timeout"
diff --git a/src/zlibs/mutt b/src/zlibs/mutt
index 745c96b..ba4049b 100755
--- a/src/zlibs/mutt
+++ b/src/zlibs/mutt
@@ -59,7 +59,7 @@ x_mutt() {
gpgkey=""
- [[ -f $MAILDIRS/.pass/.gpg-id ]] || {
+ [[ -f ${PASSWORD_STORE_DIR}/.gpg-id ]] || {
# detect the default gpg key to always encrypt also to self
# update: do not re-encrypt if already done
[[ -r $HOME/.gnupg/gpg.conf ]] && {
@@ -126,22 +126,23 @@ EOF
# Generated by JaroMail at every execution
set pgp_long_ids
-set pgp_decode_command="OPMUX_MUA=mutt ${opmux_path} --passphrase-fd 0 \
+set pgp_decode_command="OPMUX_MUA=mutt ${cryptowrap} --passphrase-fd 0 \
--quiet --batch --output - %f"
-set pgp_verify_command="OPMUX_MUA=mutt ${opmux_path} --quiet --batch \
+set pgp_verify_command="OPMUX_MUA=mutt ${cryptowrap} --quiet --batch \
--output - --verify %s %f"
-set pgp_decrypt_command="OPMUX_MUA=mutt ${opmux_path} --passphrase-fd 0 \
+set pgp_decrypt_command="OPMUX_MUA=mutt ${cryptowrap} --passphrase-fd 0 \
--quiet --batch --output - %f"
-set pgp_encrypt_only_command="${opmux_path} --batch --quiet --output - \
+set pgp_encrypt_only_command="${cryptowrap} --batch --quiet --output - \
--encrypt --textmode --armor --always-trust -r '%r' %f"
-set pgp_encrypt_sign_command="${opmux_path} --passphrase-fd 0 --batch \
+set pgp_encrypt_sign_command="${cryptowrap} --passphrase-fd 0 --batch \
--quiet --textmode --output - --encrypt --sign %?a?-u %a? --armor \
--always-trust -r '%r' %f"
-set pgp_list_pubring_command="${opmux_path} --batch --quiet --with-colons \
+set pgp_list_pubring_command="${cryptowrap} --batch --quiet --with-colons \
--list-keys %r"
+## XXX: currently added in Identity.txt
# set pgp_decryption_okay="^opmux: SUCCESS\.$"
EOF
;;