From 4add47feb18d33af952c97334486a79aa745ddaf Mon Sep 17 00:00:00 2001 From: Les Aker Date: Wed, 5 Dec 2012 19:57:21 -0500 Subject: [PATCH 1/4] fixed autogen for systems with glibtoolize --- autogen.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index cf580cee..0f56bfc7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -12,7 +12,14 @@ fi if [ ! -d config ]; then mkdir config fi -libtoolize --automake --copy --force +if which libtoolize &> /dev/null ; then + libtoolize --automake --copy --force +elif which glibtoolize &> /dev/null ; then + glibtoolize --automake --copy --force +else + echo 'No libtoolize or glibtoolize found' + exit +fi aclocal -I config autoheader automake --add-missing --copy From 8ee19313e08435aaa338f4a019283d0d44260022 Mon Sep 17 00:00:00 2001 From: Les Aker Date: Thu, 6 Dec 2012 01:16:40 -0500 Subject: [PATCH 2/4] Added GPG Agent config file option --- client/config_init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/config_init.c b/client/config_init.c index cae7c49a..0b98d21c 100644 --- a/client/config_init.c +++ b/client/config_init.c @@ -321,6 +321,12 @@ parse_rc_param(fko_cli_options_t *options, const char *var, char * val) if(val[0] == 'y' || val[0] == 'Y') options->use_gpg = 1; } + /* Use GPG Agent ? */ + else if(CONF_VAR_IS(var, "USE_GPG_AGENT")) + { + if(val[0] == 'y' || val[0] == 'Y') + options->use_gpg_agent = 1; + } /* GPG Recipient */ else if(CONF_VAR_IS(var, "GPG_RECIPIENT")) { From 8ea634463285b89d1881744c4d9af8aba3330369 Mon Sep 17 00:00:00 2001 From: Les Aker Date: Thu, 6 Dec 2012 01:46:58 -0500 Subject: [PATCH 3/4] fixed path expansion for gpg_home_dir --- lib/fko_encryption.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/fko_encryption.c b/lib/fko_encryption.c index 529fa411..dc9f87fb 100644 --- a/lib/fko_encryption.c +++ b/lib/fko_encryption.c @@ -32,6 +32,7 @@ #include "fko.h" #include "cipher_funcs.h" #include "base64.h" +#include #if HAVE_LIBGPGME #include "gpgme_funcs.h" @@ -653,6 +654,14 @@ fko_set_gpg_home_dir(fko_ctx_t ctx, const char *gpg_home_dir) if(!CTX_INITIALIZED(ctx)) return(FKO_ERROR_CTX_NOT_INITIALIZED); + /* Ensure we're working with the expanded path + */ + wordexp_t expanded_form; + if( !wordexp(gpg_home_dir, &expanded_form, WRDE_SHOWERR) ){ + gpg_home_dir = strdup(expanded_form.we_wordv[0]); + wordfree(&expanded_form); + } + /* If we are unable to stat the given dir, then return with error. */ if(stat(gpg_home_dir, &st) != 0) @@ -662,6 +671,7 @@ fko_set_gpg_home_dir(fko_ctx_t ctx, const char *gpg_home_dir) return(FKO_ERROR_GPGME_BAD_HOME_DIR); ctx->gpg_home_dir = strdup(gpg_home_dir); + free(gpg_home_dir); if(ctx->gpg_home_dir == NULL) return(FKO_ERROR_MEMORY_ALLOCATION); From 9d477bdfcd0ebdd1535e9f96b1f426e94133ef04 Mon Sep 17 00:00:00 2001 From: Les Aker Date: Thu, 6 Dec 2012 02:05:47 -0500 Subject: [PATCH 4/4] Added catch to ensure reliable operations --- lib/fko_encryption.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fko_encryption.c b/lib/fko_encryption.c index dc9f87fb..0a37a0d0 100644 --- a/lib/fko_encryption.c +++ b/lib/fko_encryption.c @@ -660,6 +660,8 @@ fko_set_gpg_home_dir(fko_ctx_t ctx, const char *gpg_home_dir) if( !wordexp(gpg_home_dir, &expanded_form, WRDE_SHOWERR) ){ gpg_home_dir = strdup(expanded_form.we_wordv[0]); wordfree(&expanded_form); + } else { + gpg_home_dir = strdup(gpg_home_dir); } /* If we are unable to stat the given dir, then return with error.