aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/Makefile.am2
-rw-r--r--g10/trustdb.c24
2 files changed, 4 insertions, 22 deletions
diff --git a/g10/Makefile.am b/g10/Makefile.am
index 1da60ce4a..693284c6d 100644
--- a/g10/Makefile.am
+++ b/g10/Makefile.am
@@ -31,7 +31,7 @@ include $(top_srcdir)/am/cmacros.am
AM_CFLAGS = $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) \
$(LIBASSUAN_CFLAGS) $(GPG_ERROR_CFLAGS)
-needed_libs = ../kbx/libkeybox.a $(libcommon)
+needed_libs = ../kbx/libkeybox.a $(libcommon) ../regexp/libregexp.a
# Because there are no program specific transform macros we need to
# work around that to allow installing gpg as gpg2.
diff --git a/g10/trustdb.c b/g10/trustdb.c
index b8f9e82c2..78d0c7a5a 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -23,14 +23,10 @@
#include <stdlib.h>
#include <string.h>
-#ifndef DISABLE_REGEX
-#include <sys/types.h>
-#include <regex.h>
-#endif /* !DISABLE_REGEX */
-
#include "gpg.h"
#include "../common/status.h"
#include "../common/iobuf.h"
+#include "../regexp/jimregexp.h"
#include "keydb.h"
#include "../common/util.h"
#include "options.h"
@@ -1519,8 +1515,7 @@ store_validation_status (ctrl_t ctrl, int depth,
/* Returns a sanitized copy of the regexp (which might be "", but not
NULL). */
-#ifndef DISABLE_REGEX
-/* Operator charactors except '.' and backslash.
+/* Operator characters except '.' and backslash.
See regex(7) on BSD. */
#define REGEXP_OPERATOR_CHARS "^[$()|*+?{"
@@ -1584,7 +1579,6 @@ sanitize_regexp(const char *old)
return new;
}
-#endif /*!DISABLE_REGEX*/
/* Used by validate_one_keyblock to confirm a regexp within a trust
signature. Returns 1 for match, and 0 for no match or regex
@@ -1592,25 +1586,15 @@ sanitize_regexp(const char *old)
static int
check_regexp(const char *expr,const char *string)
{
-#ifdef DISABLE_REGEX
- (void)expr;
- (void)string;
- /* When DISABLE_REGEX is defined, assume all regexps do not
- match. */
- return 0;
-#else
int ret;
char *regexp;
regexp=sanitize_regexp(expr);
-#ifdef __riscos__
- ret=riscos_check_regexp(expr, string, DBG_TRUST);
-#else
{
regex_t pat;
- ret=regcomp(&pat,regexp,REG_ICASE|REG_NOSUB|REG_EXTENDED);
+ ret=regcomp(&pat,regexp,REG_ICASE|REG_EXTENDED);
if(ret==0)
{
ret=regexec(&pat,string,0,NULL,0);
@@ -1618,7 +1602,6 @@ check_regexp(const char *expr,const char *string)
}
ret=(ret==0);
}
-#endif
if(DBG_TRUST)
log_debug("regexp '%s' ('%s') on '%s': %s\n",
@@ -1627,7 +1610,6 @@ check_regexp(const char *expr,const char *string)
xfree(regexp);
return ret;
-#endif
}
/*