[Fedora-directory-commits] mod_nss Makefile.am, 1.7, 1.8 Makefile.in, 1.12, 1.13 configure, 1.9, 1.10 configure.in, 1.6, 1.7 mod_nss.c, 1.9, 1.10 mod_nss.h, 1.8, 1.9 nss_engine_pphrase.c, 1.3, 1.4 nss_engine_vars.c, 1.3, 1.4 nss_expr_eval.c, 1.2, 1.3 nss_expr_parse.c, 1.1, 1.2 nss_expr_parse.h, 1.1, 1.2 nss_expr_parse.y, 1.1, 1.2 nss_expr_scan.c, 1.1, 1.2

Robert Crittenden (rcritten) fedora-directory-commits at redhat.com
Wed Jan 4 22:08:24 UTC 2006


Author: rcritten

Update of /cvs/dirsec/mod_nss
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18945

Modified Files:
	Makefile.am Makefile.in configure configure.in mod_nss.c 
	mod_nss.h nss_engine_pphrase.c nss_engine_vars.c 
	nss_expr_eval.c nss_expr_parse.c nss_expr_parse.h 
	nss_expr_parse.y nss_expr_scan.c 
Log Message:
Changes to allow the mod_nss to work in Apache 2.2.0. Based on a patch
from Oden Eriksson.

The conditional to determine which API to use is a bit weak at the moment
but it works with Apache 2.0.54 and 2.2.0.



Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/mod_nss/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Makefile.am	3 Oct 2005 14:59:26 -0000	1.7
+++ Makefile.am	4 Jan 2006 22:07:57 -0000	1.8
@@ -7,11 +7,13 @@
 
 ## Define the source file for the module
 libmodnss_la_SOURCES = mod_nss.c nss_engine_config.c nss_engine_init.c nss_engine_io.c nss_engine_kernel.c nss_engine_log.c nss_engine_pphrase.c nss_engine_vars.c nss_expr.c nss_expr_eval.c nss_expr_parse.y nss_expr_scan.l nss_util.c nss_engine_rand.c
+libmodnss_la_LDFLAGS = -module -avoid-version
 
 ## Set the includes and libraries needed
 INCLUDES = -I at apache_inc@ @nspr_inc@ @nss_inc@ @apr_inc@
 LIBS = @nspr_lib@ @nss_lib@ -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lplc4 -lplds4 -lnspr4
 @SSL2_TRUE at AM_CFLAGS=-DWANT_SSL2
+EXTRA_CPPFLAGS=@extra_cppflags@
 
 install-libLTLIBRARIES: libmodnss.la
 	@APXS@ -i -a -n nss libmodnss.la
@@ -65,7 +67,7 @@
 
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(AM_CFLAGS) $(CFLAGS) $(EXTRA_CPPFLAGS)
 
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@


Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/mod_nss/Makefile.in,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Makefile.in	3 Nov 2005 19:46:24 -0000	1.12
+++ Makefile.in	4 Jan 2006 22:07:57 -0000	1.13
@@ -94,6 +94,7 @@
 apache_inc = @apache_inc@
 apache_prefix = @apache_prefix@
 apr_inc = @apr_inc@
+extra_cppflags = @extra_cppflags@
 install_sh = @install_sh@
 nspr_dir = @nspr_dir@
 nspr_inc = @nspr_inc@
@@ -108,14 +109,16 @@
 nss_pcache_SOURCES = nss_pcache.c
 
 libmodnss_la_SOURCES = mod_nss.c nss_engine_config.c nss_engine_init.c nss_engine_io.c nss_engine_kernel.c nss_engine_log.c nss_engine_pphrase.c nss_engine_vars.c nss_expr.c nss_expr_eval.c nss_expr_parse.y nss_expr_scan.l nss_util.c nss_engine_rand.c
+libmodnss_la_LDFLAGS = -module -avoid-version
 
 INCLUDES = -I at apache_inc@ @nspr_inc@ @nss_inc@ @apr_inc@
 LIBS = @nspr_lib@ @nss_lib@ -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lplc4 -lplds4 -lnspr4
 @SSL2_TRUE at AM_CFLAGS = -DWANT_SSL2
+EXTRA_CPPFLAGS = @extra_cppflags@
 
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
 	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
-	$(AM_CFLAGS) $(CFLAGS)
+	$(AM_CFLAGS) $(CFLAGS) $(EXTRA_CPPFLAGS)
 
 
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -127,7 +130,6 @@
 CONFIG_CLEAN_FILES = nss.conf gencert
 LTLIBRARIES = $(lib_LTLIBRARIES)
 
-libmodnss_la_LDFLAGS =
 libmodnss_la_LIBADD =
 am_libmodnss_la_OBJECTS = mod_nss.lo nss_engine_config.lo \
 	nss_engine_init.lo nss_engine_io.lo nss_engine_kernel.lo \


Index: configure
===================================================================
RCS file: /cvs/dirsec/mod_nss/configure,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- configure	3 Nov 2005 19:46:24 -0000	1.9
+++ configure	4 Jan 2006 22:07:57 -0000	1.10
@@ -466,7 +466,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL YACC LEX LEXLIB LEX_OUTPUT_ROOT SSL2_TRUE SSL2_FALSE APR_CONFIG APXS PKG_CONFIG apr_inc apache_inc apache_conf apache_prefix apache_bin nspr_inc nspr_lib nss_inc nss_lib nspr_dir nss_dir LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE build build_cpu build_vendor build_os host host_cpu host_vendor host_os LN_S ECHO RANLIB ac_ct_RANLIB CPP EGREP LIBTOOL YACC LEX LEXLIB LEX_OUTPUT_ROOT SSL2_TRUE SSL2_FALSE APR_CONFIG APXS PKG_CONFIG apr_inc apache_inc apache_conf apache_prefix apache_bin nspr_inc nspr_lib nss_inc nss_lib nspr_dir nss_dir extra_cppflags LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -8452,7 +8452,7 @@
   enableval="$enable_ssl2"
   ssl2=$enableval
 else
-  ssl2=yes
+  ssl2=no
 fi;
 if test $ssl2 = yes; then
    echo "$as_me:$LINENO: result: yes" >&5
@@ -8649,6 +8649,7 @@
 apache_conf=`$APXS -q SYSCONFDIR`
 apache_prefix=`$APXS -q PREFIX`
 apache_bin=`$APXS -q SBINDIR`
+extra_cppflags=`$APXS -q EXTRA_CPPFLAGS`
 
 if ! test -f "$apache_inc/apr.h"; then
   if test -z "$apr_inc"; then
@@ -8949,6 +8950,7 @@
 
 
 
+
 # Write config.status and the Makefile
                               ac_config_files="$ac_config_files Makefile nss.conf gencert"
 cat >confcache <<\_ACEOF
@@ -9679,6 +9681,7 @@
 s, at nss_lib@,$nss_lib,;t t
 s, at nspr_dir@,$nspr_dir,;t t
 s, at nss_dir@,$nss_dir,;t t
+s, at extra_cppflags@,$extra_cppflags,;t t
 s, at LIBOBJS@,$LIBOBJS,;t t
 s, at LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF


Index: configure.in
===================================================================
RCS file: /cvs/dirsec/mod_nss/configure.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- configure.in	26 Sep 2005 19:38:52 -0000	1.6
+++ configure.in	4 Jan 2006 22:07:58 -0000	1.7
@@ -25,7 +25,7 @@
 AC_MSG_CHECKING(for SSL2)
 AC_ARG_ENABLE(ssl2,
   [  --enable-ssl2         enable SSLv2 (default=no)],
-  ssl2=$enableval, ssl2=yes)
+  ssl2=$enableval, ssl2=no)
 if test $ssl2 = yes; then
    AC_MSG_RESULT(yes)
 else
@@ -104,6 +104,7 @@
 apache_conf=`$APXS -q SYSCONFDIR`
 apache_prefix=`$APXS -q PREFIX`
 apache_bin=`$APXS -q SBINDIR`
+extra_cppflags=`$APXS -q EXTRA_CPPFLAGS` 
 
 if ! test -f "$apache_inc/apr.h"; then
   if test -z "$apr_inc"; then
@@ -257,6 +258,7 @@
 AC_SUBST(nss_lib)
 AC_SUBST(nspr_dir)
 AC_SUBST(nss_dir)
+AC_SUBST(extra_cppflags)
 
 # Write config.status and the Makefile
 AC_OUTPUT(Makefile nss.conf gencert)


Index: mod_nss.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/mod_nss.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mod_nss.c	3 Oct 2005 14:59:26 -0000	1.9
+++ mod_nss.c	4 Jan 2006 22:07:58 -0000	1.10
@@ -362,7 +362,7 @@
     return APR_SUCCESS;
 }
 
-static const char *nss_hook_http_method(const request_rec *r)
+static const char *nss_hook_http_scheme(const request_rec *r)
 {
     SSLSrvConfigRec *sc = mySrvConfig(r->server);
 
@@ -394,7 +394,11 @@
 
     ap_hook_pre_connection(nss_hook_pre_connection,NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_post_config   (nss_init_Module,        NULL,NULL, APR_HOOK_MIDDLE);
-    ap_hook_http_method   (nss_hook_http_method,   NULL,NULL, APR_HOOK_MIDDLE);
+#ifndef AP_SERVER_MAJORVERSION_NUMBER
+    ap_hook_http_method   (nss_hook_http_scheme,   NULL,NULL, APR_HOOK_MIDDLE);
+#else
+    ap_hook_http_scheme   (nss_hook_http_scheme,   NULL,NULL, APR_HOOK_MIDDLE);
+#endif
     ap_hook_default_port  (nss_hook_default_port,  NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_pre_config    (nss_hook_pre_config,    NULL,NULL, APR_HOOK_MIDDLE);
     ap_hook_child_init    (nss_init_Child,         NULL,NULL, APR_HOOK_MIDDLE);


Index: mod_nss.h
===================================================================
RCS file: /cvs/dirsec/mod_nss/mod_nss.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- mod_nss.h	3 Oct 2005 14:59:26 -0000	1.8
+++ mod_nss.h	4 Jan 2006 22:07:58 -0000	1.9
@@ -316,6 +316,15 @@
     int fortezza_only;
     PRInt32 version; // protocol version valid for this cipher
 } cipher_properties;
+
+/* Compatibility between Apache 2.0.x and 2.2.x. The numeric version of
+ * the version first appeared in Apache 2.2.0 */
+#ifndef AP_SERVER_MAJORVERSION_NUMBER
+typedef struct regex_t ap_regex_t;
+#define AP_REG_EXTENDED REG_EXTENDED
+#define AP_REG_NOSUB REG_NOSUB
+#define AP_REG_ICASE REG_ICASE
+#endif
  
 enum sslversion { SSL2=1, SSL3=2, TLS=4};
 


Index: nss_engine_pphrase.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_engine_pphrase.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- nss_engine_pphrase.c	4 Aug 2005 16:18:49 -0000	1.3
+++ nss_engine_pphrase.c	4 Jan 2006 22:07:58 -0000	1.4
@@ -125,7 +125,7 @@
 
         snprintf(buf, 1024, "STOR\t%s\t%s", PK11_GetTokenName(slot), passwd);
         rv = apr_file_write_full(parg->mc->proc.in, buf, strlen(buf), NULL);
-        if (!APR_STATUS_IS_SUCCESS(rv)) {
+        if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
                 "Unable to write to pin store for slot: %s APR err: %d",  PK11_GetTokenName(slot), rv);
             nss_die();
@@ -139,9 +139,9 @@
         memset(buf, 0, sizeof(buf));
         rv = apr_file_read(parg->mc->proc.out, buf, &nBytes);
 
-        if (APR_STATUS_IS_SUCCESS(rv))
+        if (rv = APR_SUCCESS)
            res = atoi(buf);
-        if (!APR_STATUS_IS_SUCCESS(rv) ||
+        if (rv != APR_SUCCESS ||
            (res != PIN_SUCCESS && res != PIN_INCORRECTPW)) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
                 "Unable to read from pin store for slot: %s APR err: %d",  PK11_GetTokenName(slot), rv);
@@ -245,7 +245,7 @@
 
         snprintf(buf, 1024, "RETR\t%s", token_name);
         rv = apr_file_write_full(parg->mc->proc.in, buf, strlen(buf), NULL);
-        if (!APR_STATUS_IS_SUCCESS(rv)) {
+        if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
                 "Unable to write to pin store for slot: %s APR err: %d",  PK11_GetTokenName(slot), rv);
             nss_die();
@@ -256,7 +256,7 @@
          */
         memset(buf, 0, sizeof(buf));
         rv = apr_file_read(parg->mc->proc.out, buf, &nBytes);
-        if (!APR_STATUS_IS_SUCCESS(rv)) {
+        if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
                 "Unable to read from pin store for slot: %s APR err: %d",  PK11_GetTokenName(slot), rv);
             nss_die();


Index: nss_engine_vars.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_engine_vars.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- nss_engine_vars.c	31 May 2005 14:32:42 -0000	1.3
+++ nss_engine_vars.c	4 Jan 2006 22:07:58 -0000	1.4
@@ -100,7 +100,11 @@
         else if (strcEQ(var, "REQUEST_METHOD"))
             result = (char *)(r->method);
         else if (strcEQ(var, "REQUEST_SCHEME"))
+#ifndef AP_SERVER_MAJORVERSION_NUMBER
             result = (char *)ap_http_method(r);
+#else
+            result = (char *)ap_http_scheme(r);
+#endif
         else if (strcEQ(var, "REQUEST_URI"))
             result = r->uri;
         else if (strcEQ(var, "SCRIPT_FILENAME") ||


Index: nss_expr_eval.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_expr_eval.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nss_expr_eval.c	31 May 2005 14:32:42 -0000	1.2
+++ nss_expr_eval.c	4 Jan 2006 22:07:58 -0000	1.3
@@ -113,24 +113,24 @@
             nss_expr *e1;
             nss_expr *e2;
             char *word;
-            regex_t *regex;
+            ap_regex_t *regex;
 
             e1 = (nss_expr *)node->node_arg1;
             e2 = (nss_expr *)node->node_arg2;
             word = nss_expr_eval_word(r, e1);
-            regex = (regex_t *)(e2->node_arg1);
+            regex = (ap_regex_t *)(e2->node_arg1);
             return (ap_regexec(regex, word, 0, NULL, 0) == 0);
         }
         case op_NRE: {
             nss_expr *e1;
             nss_expr *e2;
             char *word;
-            regex_t *regex;
+            ap_regex_t *regex;
 
             e1 = (nss_expr *)node->node_arg1;
             e2 = (nss_expr *)node->node_arg2;
             word = nss_expr_eval_word(r, e1);
-            regex = (regex_t *)(e2->node_arg1);
+            regex = (ap_regex_t *)(e2->node_arg1);
             return !(ap_regexec(regex, word, 0, NULL, 0) == 0);
         }
         default: {


View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.1 -r 1.2 nss_expr_parse.c
Index: nss_expr_parse.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_expr_parse.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- nss_expr_parse.c	31 May 2005 14:32:42 -0000	1.1
+++ nss_expr_parse.c	4 Jan 2006 22:07:58 -0000	1.2
@@ -1,479 +1,856 @@
+/* A Bison parser, made by GNU Bison 1.875c.  */
 
-/*  A Bison parser, made from nss_expr_parse.y
-    by GNU Bison version 1.28  */
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
-#define YYBISON 1  /* Identify Bison output.  */
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Written by Richard Stallman by simplifying the original so called
+   ``semantic'' parser.  */
 
-#define	T_TRUE	257
-#define	T_FALSE	258
-#define	T_DIGIT	259
-#define	T_ID	260
-#define	T_STRING	261
-#define	T_REGEX	262
-#define	T_REGEX_I	263
-#define	T_FUNC_FILE	264
-#define	T_OP_EQ	265
-#define	T_OP_NE	266
-#define	T_OP_LT	267
-#define	T_OP_LE	268
-#define	T_OP_GT	269
-#define	T_OP_GE	270
-#define	T_OP_REG	271
-#define	T_OP_NRE	272
-#define	T_OP_IN	273
-#define	T_OP_OR	274
-#define	T_OP_AND	275
-#define	T_OP_NOT	276
+/* All symbols defined below should begin with nss_expr_yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum nss_expr_yytokentype {
+     T_TRUE = 258,
+     T_FALSE = 259,
+     T_DIGIT = 260,
+     T_ID = 261,
+     T_STRING = 262,
+     T_REGEX = 263,
+     T_REGEX_I = 264,
+     T_FUNC_FILE = 265,
+     T_OP_EQ = 266,
+     T_OP_NE = 267,
+     T_OP_LT = 268,
+     T_OP_LE = 269,
+     T_OP_GT = 270,
+     T_OP_GE = 271,
+     T_OP_REG = 272,
+     T_OP_NRE = 273,
+     T_OP_IN = 274,
+     T_OP_OR = 275,
+     T_OP_AND = 276,
+     T_OP_NOT = 277
+   };
+#endif
+#define T_TRUE 258
+#define T_FALSE 259
+#define T_DIGIT 260
+#define T_ID 261
+#define T_STRING 262
+#define T_REGEX 263
+#define T_REGEX_I 264
+#define T_FUNC_FILE 265
+#define T_OP_EQ 266
+#define T_OP_NE 267
+#define T_OP_LT 268
+#define T_OP_LE 269
+#define T_OP_GT 270
+#define T_OP_GE 271
+#define T_OP_REG 272
+#define T_OP_NRE 273
+#define T_OP_IN 274
+#define T_OP_OR 275
+#define T_OP_AND 276
+#define T_OP_NOT 277
 
+
+
+
+/* Copy the first part of user declarations.  */
 #line 22 "nss_expr_parse.y"
 
 #include "mod_nss.h"
 
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
 #line 26 "nss_expr_parse.y"
-typedef union {
+typedef union YYSTYPE {
     char     *cpVal;
     nss_expr *exVal;
 } YYSTYPE;
-#include <stdio.h>
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
+/* Line 191 of yacc.c.  */
+#line 129 "y.tab.c"
+# define nss_expr_yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 
 
-#define	YYFINAL		53
-#define	YYFLAG		-32768
-#define	YYNTBASE	29
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 276 ? nss_expr_yytranslate[x] : 36)
-
-static const char nss_expr_yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,    28,     2,     2,    23,
-    24,     2,     2,    27,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,    25,     2,    26,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
[...1792 lines suppressed...]
+	  if (nss_expr_yychar == YYEOF)
+	     for (;;)
+	       {
+		 YYPOPSTACK;
+		 if (nss_expr_yyssp == nss_expr_yyss)
+		   YYABORT;
+		 YYDSYMPRINTF ("Error: popping", nss_expr_yystos[*nss_expr_yyssp], nss_expr_yyvsp, nss_expr_yylsp);
+		 nss_expr_yydestruct (nss_expr_yystos[*nss_expr_yyssp], nss_expr_yyvsp);
+	       }
+        }
+      else
+	{
+	  YYDSYMPRINTF ("Error: discarding", nss_expr_yytoken, &nss_expr_yylval, &nss_expr_yylloc);
+	  nss_expr_yydestruct (nss_expr_yytoken, &nss_expr_yylval);
+	  nss_expr_yychar = YYEMPTY;
 
-      nss_expr_yychar = YYEMPTY;
+	}
     }
 
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  nss_expr_yyerrstatus = 3;		/* Each real token shifted decrements this */
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto nss_expr_yyerrlab1;
 
-  goto nss_expr_yyerrhandle;
 
-nss_expr_yyerrdefault:  /* current state does not do anything special for the error token. */
+/*---------------------------------------------------.
+| nss_expr_yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+nss_expr_yyerrorlab:
 
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  nss_expr_yyn = nss_expr_yydefact[nss_expr_yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (nss_expr_yyn) goto nss_expr_yydefault;
+#ifdef __GNUC__
+  /* Pacify GCC when the user code never invokes YYERROR and the label
+     nss_expr_yyerrorlab therefore never appears in user code.  */
+  if (0)
+     goto nss_expr_yyerrorlab;
 #endif
 
-nss_expr_yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (nss_expr_yyssp == nss_expr_yyss) YYABORT;
-  nss_expr_yyvsp--;
-  nss_expr_yystate = *--nss_expr_yyssp;
-#ifdef YYLSP_NEEDED
-  nss_expr_yylsp--;
-#endif
+  nss_expr_yyvsp -= nss_expr_yylen;
+  nss_expr_yyssp -= nss_expr_yylen;
+  nss_expr_yystate = *nss_expr_yyssp;
+  goto nss_expr_yyerrlab1;
 
-#if YYDEBUG != 0
-  if (nss_expr_yydebug)
-    {
-      short *ssp1 = nss_expr_yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != nss_expr_yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
 
-nss_expr_yyerrhandle:
+/*-------------------------------------------------------------.
+| nss_expr_yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+nss_expr_yyerrlab1:
+  nss_expr_yyerrstatus = 3;	/* Each real token shifted decrements this.  */
 
-  nss_expr_yyn = nss_expr_yypact[nss_expr_yystate];
-  if (nss_expr_yyn == YYFLAG)
-    goto nss_expr_yyerrdefault;
+  for (;;)
+    {
+      nss_expr_yyn = nss_expr_yypact[nss_expr_yystate];
+      if (nss_expr_yyn != YYPACT_NINF)
+	{
+	  nss_expr_yyn += YYTERROR;
+	  if (0 <= nss_expr_yyn && nss_expr_yyn <= YYLAST && nss_expr_yycheck[nss_expr_yyn] == YYTERROR)
+	    {
+	      nss_expr_yyn = nss_expr_yytable[nss_expr_yyn];
+	      if (0 < nss_expr_yyn)
+		break;
+	    }
+	}
 
-  nss_expr_yyn += YYTERROR;
-  if (nss_expr_yyn < 0 || nss_expr_yyn > YYLAST || nss_expr_yycheck[nss_expr_yyn] != YYTERROR)
-    goto nss_expr_yyerrdefault;
+      /* Pop the current state because it cannot handle the error token.  */
+      if (nss_expr_yyssp == nss_expr_yyss)
+	YYABORT;
 
-  nss_expr_yyn = nss_expr_yytable[nss_expr_yyn];
-  if (nss_expr_yyn < 0)
-    {
-      if (nss_expr_yyn == YYFLAG)
-	goto nss_expr_yyerrpop;
-      nss_expr_yyn = -nss_expr_yyn;
-      goto nss_expr_yyreduce;
+      YYDSYMPRINTF ("Error: popping", nss_expr_yystos[*nss_expr_yyssp], nss_expr_yyvsp, nss_expr_yylsp);
+      nss_expr_yydestruct (nss_expr_yystos[nss_expr_yystate], nss_expr_yyvsp);
+      YYPOPSTACK;
+      nss_expr_yystate = *nss_expr_yyssp;
+      YY_STACK_PRINT (nss_expr_yyss, nss_expr_yyssp);
     }
-  else if (nss_expr_yyn == 0)
-    goto nss_expr_yyerrpop;
 
   if (nss_expr_yyn == YYFINAL)
     YYACCEPT;
 
-#if YYDEBUG != 0
-  if (nss_expr_yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
+  YYDPRINTF ((stderr, "Shifting error token, "));
 
   *++nss_expr_yyvsp = nss_expr_yylval;
-#ifdef YYLSP_NEEDED
-  *++nss_expr_yylsp = nss_expr_yylloc;
-#endif
+
 
   nss_expr_yystate = nss_expr_yyn;
   goto nss_expr_yynewstate;
 
- nss_expr_yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (nss_expr_yyfree_stacks)
-    {
-      free (nss_expr_yyss);
-      free (nss_expr_yyvs);
-#ifdef YYLSP_NEEDED
-      free (nss_expr_yyls);
-#endif
-    }
-  return 0;
 
- nss_expr_yyabortlab:
-  /* YYABORT comes here.  */
-  if (nss_expr_yyfree_stacks)
-    {
-      free (nss_expr_yyss);
-      free (nss_expr_yyvs);
-#ifdef YYLSP_NEEDED
-      free (nss_expr_yyls);
+/*-------------------------------------.
+| nss_expr_yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+nss_expr_yyacceptlab:
+  nss_expr_yyresult = 0;
+  goto nss_expr_yyreturn;
+
+/*-----------------------------------.
+| nss_expr_yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+nss_expr_yyabortlab:
+  nss_expr_yyresult = 1;
+  goto nss_expr_yyreturn;
+
+#ifndef nss_expr_yyoverflow
+/*----------------------------------------------.
+| nss_expr_yyoverflowlab -- parser overflow comes here.  |
+`----------------------------------------------*/
+nss_expr_yyoverflowlab:
+  nss_expr_yyerror ("parser stack overflow");
+  nss_expr_yyresult = 2;
+  /* Fall through.  */
+#endif
+
+nss_expr_yyreturn:
+#ifndef nss_expr_yyoverflow
+  if (nss_expr_yyss != nss_expr_yyssa)
+    YYSTACK_FREE (nss_expr_yyss);
 #endif
-    }
-  return 1;
+  return nss_expr_yyresult;
 }
+
+
 #line 128 "nss_expr_parse.y"
 
 
@@ -1077,3 +1437,4 @@
     return 2;
 }
 
+


Index: nss_expr_parse.h
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_expr_parse.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- nss_expr_parse.h	31 May 2005 14:32:42 -0000	1.1
+++ nss_expr_parse.h	4 Jan 2006 22:07:58 -0000	1.2
@@ -1,27 +1,94 @@
-typedef union {
+/* A Bison parser, made by GNU Bison 1.875c.  */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum nss_expr_yytokentype {
+     T_TRUE = 258,
+     T_FALSE = 259,
+     T_DIGIT = 260,
+     T_ID = 261,
+     T_STRING = 262,
+     T_REGEX = 263,
+     T_REGEX_I = 264,
+     T_FUNC_FILE = 265,
+     T_OP_EQ = 266,
+     T_OP_NE = 267,
+     T_OP_LT = 268,
+     T_OP_LE = 269,
+     T_OP_GT = 270,
+     T_OP_GE = 271,
+     T_OP_REG = 272,
+     T_OP_NRE = 273,
+     T_OP_IN = 274,
+     T_OP_OR = 275,
+     T_OP_AND = 276,
+     T_OP_NOT = 277
+   };
+#endif
+#define T_TRUE 258
+#define T_FALSE 259
+#define T_DIGIT 260
+#define T_ID 261
+#define T_STRING 262
+#define T_REGEX 263
+#define T_REGEX_I 264
+#define T_FUNC_FILE 265
+#define T_OP_EQ 266
+#define T_OP_NE 267
+#define T_OP_LT 268
+#define T_OP_LE 269
+#define T_OP_GT 270
+#define T_OP_GE 271
+#define T_OP_REG 272
+#define T_OP_NRE 273
+#define T_OP_IN 274
+#define T_OP_OR 275
+#define T_OP_AND 276
+#define T_OP_NOT 277
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 26 "nss_expr_parse.y"
+typedef union YYSTYPE {
     char     *cpVal;
     nss_expr *exVal;
 } YYSTYPE;
-#define	T_TRUE	257
-#define	T_FALSE	258
-#define	T_DIGIT	259
-#define	T_ID	260
-#define	T_STRING	261
-#define	T_REGEX	262
-#define	T_REGEX_I	263
-#define	T_FUNC_FILE	264
-#define	T_OP_EQ	265
-#define	T_OP_NE	266
-#define	T_OP_LT	267
-#define	T_OP_LE	268
-#define	T_OP_GT	269
-#define	T_OP_GE	270
-#define	T_OP_REG	271
-#define	T_OP_NRE	272
-#define	T_OP_IN	273
-#define	T_OP_OR	274
-#define	T_OP_AND	275
-#define	T_OP_NOT	276
-
+/* Line 1275 of yacc.c.  */
+#line 86 "y.tab.h"
+# define nss_expr_yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
 
 extern YYSTYPE nss_expr_yylval;
+
+
+


Index: nss_expr_parse.y
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_expr_parse.y,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- nss_expr_parse.y	31 May 2005 14:32:42 -0000	1.1
+++ nss_expr_parse.y	4 Jan 2006 22:07:58 -0000	1.2
@@ -100,18 +100,18 @@
           ;
 
 regex     : T_REGEX { 
-                regex_t *regex;
+                ap_regex_t *regex;
                 if ((regex = ap_pregcomp(nss_expr_info.pool, $1, 
-                                         REG_EXTENDED|REG_NOSUB)) == NULL) {
+                                         AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
                     nss_expr_error = "Failed to compile regular expression";
                     YYERROR;
                 }
                 $$ = nss_expr_make(op_Regex, regex, NULL);
             }
           | T_REGEX_I {
-                regex_t *regex;
+                ap_regex_t *regex;
                 if ((regex = ap_pregcomp(nss_expr_info.pool, $1, 
-                                         REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) {
+                                         AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
                     nss_expr_error = "Failed to compile regular expression";
                     YYERROR;
                 }


Index: nss_expr_scan.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_expr_scan.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- nss_expr_scan.c	31 May 2005 14:32:42 -0000	1.1
+++ nss_expr_scan.c	4 Jan 2006 22:07:58 -0000	1.2
@@ -1432,6 +1432,7 @@
 #endif	/* ifndef YY_NO_UNPUT */
 
 
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
 static int yyinput()
 #else
@@ -1503,7 +1504,7 @@
 
 	return c;
 	}
-
+#endif /* YY_NO_INPUT */
 
 #ifdef YY_USE_PROTOS
 void yyrestart( FILE *input_file )




More information about the Fedora-directory-commits mailing list