Changes to improve compatibility with OS X #13

Closed
wants to merge 4 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+26 −1
Diff settings

Always

Just for now

View
@@ -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
View
@@ -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"))
{
View
@@ -32,6 +32,7 @@
#include "fko.h"
#include "cipher_funcs.h"
#include "base64.h"
+#include <wordexp.h>
#if HAVE_LIBGPGME
#include "gpgme_funcs.h"
@@ -653,6 +654,16 @@ 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);
+ } else {
+ gpg_home_dir = strdup(gpg_home_dir);
+ }
+
/* If we are unable to stat the given dir, then return with error.
*/
if(stat(gpg_home_dir, &st) != 0)
@@ -662,6 +673,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);