* configure.ac: Changed gpg and gpgsm version checks to work with
	arbitrary names of the gpg binary. New option --disable-gpg-test
	and --disable-gpgsm-test.
gpgme/
	* w32-io.c (build_commandline): Fixed stupid quoting bug.
	* w32-glib-io.c (build_commandline): Ditto.

	* rungpg.c (gpg_set_locale): Avoid dangling pointer after free.

	* gpgme-config.in: New options --get-gpg and --get-gpgsm.
This commit is contained in:
Werner Koch 2007-01-26 12:08:12 +00:00
parent ffbeb4f508
commit d6a2521246
7 changed files with 62 additions and 27 deletions

View File

@ -1,8 +1,13 @@
2007-01-26 Werner Koch <wk@g10code.com>
* configure.ac: Changed gpg and gpgsm version checks to work with
arbitrary names of the gpg binary. New option --disable-gpg-test
and --disable-gpgsm-test.
2007-01-09 Werner Koch <wk@g10code.com> 2007-01-09 Werner Koch <wk@g10code.com>
* configure.ac (NEED_GPG_VERSION, * configure.ac (NEED_GPG_VERSION, NEED_GPGSM_VERSION): Must define
(NEED_GPGSM_VERSION): Must define after it may have been changed after it may have been changed by an option.
by an option.
2007-01-08 Werner Koch <wk@g10code.com> 2007-01-08 Werner Koch <wk@g10code.com>

View File

@ -324,21 +324,20 @@ else
fi fi
fi fi
if test "$ok" = "maybe"; then if test "$ok" = "maybe"; then
AC_MSG_CHECKING(for GnuPG >= $NEED_GPG_VERSION) AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
req_major=`echo $NEED_GPG_VERSION | \ req_major=`echo $NEED_GPG_VERSION | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $NEED_GPG_VERSION | \ req_minor=`echo $NEED_GPG_VERSION | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $NEED_GPG_VERSION | \ req_micro=`echo $NEED_GPG_VERSION | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
gpg_version=`$GPG --version | grep ^gpg` GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
major=`echo $gpg_version | \ major=`echo $GPG_VERSION | \
sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $gpg_version | \ minor=`echo $GPG_VERSION | \
sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
micro=`echo $gpg_version | \ micro=`echo $GPG_VERSION | \
sed 's/^gpg (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
GPG_VERSION=`echo $gpg_version | sed 's/^gpg (GnuPG) //'`
if test "$major" -gt "$req_major"; then if test "$major" -gt "$req_major"; then
ok=yes ok=yes
@ -359,10 +358,14 @@ if test "$ok" = "maybe"; then
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_WARN([GnuPG must be at least version $NEED_GPG_VERSION]) AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
fi fi
fi fi
AM_CONDITIONAL(RUN_GPG_TESTS, test "$ok" = "yes") run_gpg_test="$ok"
AC_ARG_ENABLE(gpg-test,
AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
run_gpg_test=$enableval)
AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
AC_SUBST(GPG_PATH) AC_SUBST(GPG_PATH)
NO_OVERRIDE=no NO_OVERRIDE=no
@ -424,14 +427,13 @@ if test "$ok" = "maybe"; then
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $NEED_GPGSM_VERSION | \ req_micro=`echo $NEED_GPGSM_VERSION | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
gpgsm_version=`$GPGSM --version | grep ^gpgsm` GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
major=`echo $gpgsm_version | \ major=`echo $GPGSM_VERSION | \
sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $gpgsm_version | \ minor=`echo $GPGSM_VERSION | \
sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
micro=`echo $gpgsm_version | \ micro=`echo $GPGSM_VERSION | \
sed 's/^gpgsm (GnuPG) \([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
GPGSM_VERSION=`echo $gpgsm_version | sed 's/^gpgsm (GnuPG) //'`
if test "$major" -gt "$req_major"; then if test "$major" -gt "$req_major"; then
ok=yes ok=yes
@ -455,7 +457,12 @@ if test "$ok" = "maybe"; then
AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION]) AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
fi fi
fi fi
AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$ok" = "yes") run_gpgsm_test="$ok"
AC_ARG_ENABLE(gpgsm-test,
AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
run_gpgsm_test=$enableval)
AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
# FIXME: Only build if supported. # FIXME: Only build if supported.
AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no") AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")

View File

@ -1,3 +1,12 @@
2007-01-26 Werner Koch <wk@g10code.com>
* w32-io.c (build_commandline): Fixed stupid quoting bug.
* w32-glib-io.c (build_commandline): Ditto.
* rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
* gpgme-config.in: New options --get-gpg and --get-gpgsm.
2007-01-18 Marcus Brinkmann <marcus@g10code.de> 2007-01-18 Marcus Brinkmann <marcus@g10code.de>
* data.h (_gpgme_data_get_fd): Add prototype. * data.h (_gpgme_data_get_fd): Add prototype.

View File

@ -51,6 +51,8 @@ Options:
[--api-version] [--api-version]
[--libs] [--libs]
[--cflags] [--cflags]
[--get-gpg]
[--get-gpgsm]
EOF EOF
exit $1 exit $1
} }
@ -144,6 +146,12 @@ while test $# -gt 0; do
usage 1 1>&2 usage 1 1>&2
fi fi
;; ;;
--get-gpg)
output="$output @GPG@"
;;
--get-gpgsm)
output="$output @GPGSM@"
;;
*) *)
usage 1 1>&2 usage 1 1>&2
;; ;;

View File

@ -517,7 +517,10 @@ gpg_set_locale (void *engine, int category, const char *value)
if (category == LC_CTYPE) if (category == LC_CTYPE)
{ {
if (gpg->lc_ctype) if (gpg->lc_ctype)
free (gpg->lc_ctype); {
free (gpg->lc_ctype);
gpg->lc_ctype = NULL;
}
if (value) if (value)
{ {
gpg->lc_ctype = strdup (value); gpg->lc_ctype = strdup (value);
@ -529,7 +532,10 @@ gpg_set_locale (void *engine, int category, const char *value)
else if (category == LC_MESSAGES) else if (category == LC_MESSAGES)
{ {
if (gpg->lc_messages) if (gpg->lc_messages)
free (gpg->lc_messages); {
free (gpg->lc_messages);
gpg->lc_messages = NULL;
}
if (value) if (value)
{ {
gpg->lc_messages = strdup (value); gpg->lc_messages = strdup (value);

View File

@ -389,7 +389,7 @@ build_commandline (char **argv)
*(p++) = '"'; *(p++) = '"';
while (*argvp) while (*argvp)
{ {
if (*p == '\\' || *p == '"') if (*argvp == '\\' || *argvp == '"')
*(p++) = '\\'; *(p++) = '\\';
*(p++) = *(argvp++); *(p++) = *(argvp++);
} }

View File

@ -841,7 +841,7 @@ build_commandline (char **argv)
*(p++) = '"'; *(p++) = '"';
while (*argvp) while (*argvp)
{ {
if (*p == '\\' || *p == '"') if (*argvp == '\\' || *argvp == '"')
*(p++) = '\\'; *(p++) = '\\';
*(p++) = *(argvp++); *(p++) = *(argvp++);
} }