summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/tcl-neo/Makefile2
-rw-r--r--devel/tcl-neo/files/Makefile.bsd4
-rw-r--r--devel/tcl-neo/files/patch-cute359
-rw-r--r--devel/tcl-neo/pkg-plist3
-rw-r--r--www/neowebscript/Makefile11
-rw-r--r--www/neowebscript/files/Makefile.lib5
-rw-r--r--www/neowebscript/files/neowebscript.conf.in8
-rw-r--r--www/neowebscript/files/patch-access12
-rw-r--r--www/neowebscript/files/patch-neoscript398
-rw-r--r--www/neowebscript/files/patch-warnings21
-rw-r--r--www/neowebscript/files/pkg-message.in3
-rw-r--r--www/neowebscript/pkg-plist2
12 files changed, 788 insertions, 40 deletions
diff --git a/devel/tcl-neo/Makefile b/devel/tcl-neo/Makefile
index 23c368be0190..ed9e8c508654 100644
--- a/devel/tcl-neo/Makefile
+++ b/devel/tcl-neo/Makefile
@@ -31,7 +31,7 @@ WRKSRC= ${WRKDIR}/${SUBDIR}/generic
EXTRACT_AFTER_ARGS?= | ${TAR} --exclude Makefile -xpf - ${SUBDIR}/generic ${SUBDIR}/neolibs
MAKEFILE= ${FILESDIR}/Makefile.bsd
-USE_TCL= 83+
+USE_TCL= 84+
MAKE_ENV+= NEO_LIBRARY=${NEO_LIBRARY} TCL_VER=${TCL_VER}
DDIR= ${PREFIX}/lib/tcl${TCLV}/Trf
diff --git a/devel/tcl-neo/files/Makefile.bsd b/devel/tcl-neo/files/Makefile.bsd
index bd51db4a4124..7cd0f0511aed 100644
--- a/devel/tcl-neo/files/Makefile.bsd
+++ b/devel/tcl-neo/files/Makefile.bsd
@@ -16,11 +16,15 @@ CFLAGS+= -Wall -Wno-parentheses -Werror
SRCS= neoXcrypt.c neoPkgInit.c neoXwww.c neoXgeneral.c \
neoXcute.c neoXcomma.c neoXkdebug.c neoCbuf.c \
neoXlist.c neoXdb.c # neoXldap.c
+INCS= neo.h neoCbuf.h neoXcute.h
+
+WARNS= 3
SHLIB_NAME= libneo82.so.1
LDADD+= -lcrypt -L${PREFIX}/lib -lmd -ldb2 # -ldap -llber
LIBDIR= ${PREFIX}/lib
+INCSDIR= ${PREFIX}/include
.include <bsd.lib.mk>
diff --git a/devel/tcl-neo/files/patch-cute b/devel/tcl-neo/files/patch-cute
index 9844413ae1b0..3b08c4650d34 100644
--- a/devel/tcl-neo/files/patch-cute
+++ b/devel/tcl-neo/files/patch-cute
@@ -1,36 +1,381 @@
--- neoXcute.c 2000-04-20 09:16:00.000000000 -0400
-+++ neoXcute.c 2009-12-08 00:33:27.000000000 -0500
-@@ -46,4 +46,5 @@
++++ neoXcute.c 2010-01-18 01:13:14.000000000 -0500
+@@ -45,5 +45,7 @@
+ #endif
++#include <errno.h>
#include <signal.h>
+#include <string.h>
#include <unistd.h>
#include <fcntl.h>
-@@ -97,5 +98,5 @@
+@@ -55,8 +57,4 @@
+ #include "neoXcute.h"
+
+-extern char *strerror();
+-
+-extern int errno;
+-
+ static char cute_expectbuf[2048];
+
+@@ -86,9 +84,15 @@
+ int cute_bufindex = 0;
+
+-void
+-ppanic(s, fileName, lineNumber)
+-char *s;
+-char *fileName;
+-int lineNumber;
++static Tcl_CmdProc Cute_Cmd, Cute_BreakLineCmd,
++ Cute_CaptureCmd, Cute_CloseLineCmd,
++ Cute_ConnectCmd, Cute_DisconnectCmd,
++ Cute_ExpectCmd, Cute_FlushLineCmd,
++ Cute_GetLineCmd, Cute_HangupCmd,
++ Cute_OpenLineCmd, Cute_ParityCmd,
++ Cute_SendCmd, Cute_SlowSendCmd,
++ Cute_SelectSpeedCmd;
++
++static void
++ppanic(const char *s, const char *fileName, int lineNumber)
+ {
+ fflush (stdout);
+@@ -97,9 +101,9 @@
perror (s);
fflush (stderr);
- panic ();
+ abort ();
}
-@@ -665,5 +666,5 @@
- int len;
+ /* dump a buffer of a specified length, printing preamble and exit text */
+-void
++static void
+ cute_dumpbuf(char *preamble, char *buf, int len, char *exitText)
+ {
+@@ -122,6 +126,6 @@
+ * way we can timeout input, get stuff without a newline, etc, etc. */
+
+-void
+-cute_term_setup()
++static void
++cute_term_setup(void)
+ {
+ if (ioctl (0, TCGETA, &cute_orig_term_settings) < 0) {
+@@ -157,6 +161,6 @@
+ /* Put the user's terminal in a mode where we read as many characters as
+ * are there but it returns in a tenth of a second. */
+-void
+-cute_timeout_single_char_mode()
++static void
++cute_timeout_single_char_mode(void)
+ {
+ if (cute_noControllingTerminal) panic("no controlling terminal");
+@@ -168,6 +172,6 @@
+ }
+
+-void
+-cute_orig_line_mode()
++static void
++cute_orig_line_mode(void)
+ {
+ if (ioctl (cute_linefd, TCSETA, &cute_orig_line_settings) < 0) {
+@@ -176,6 +180,6 @@
+ }
+
+-void
+-cute_async_line_mode()
++static void
++cute_async_line_mode(void)
+ {
+ cute_async_line_settings.c_cc[VTIME] = 0;
+@@ -187,6 +191,6 @@
+
+ /* Restore the user's terminal to its original settings */
+-void
+-cute_orig_term_mode()
++static void
++cute_orig_term_mode(void)
+ {
+ if (cute_noControllingTerminal) return;
+@@ -198,6 +202,6 @@
+ /* Put the user's terminal in a mode where we can read one character at a time.
+ */
+-void
+-cute_single_char_mode()
++static void
++cute_single_char_mode(void)
+ {
+ if (cute_noControllingTerminal) panic ("no controlling terminal");
+@@ -212,6 +216,6 @@
+ * interval. */
+
+-int
+-cute_getachar() /* return a char or -1 after timeout */
++static int
++cute_getachar(void) /* return a char or -1 after timeout */
+ {
+ char c;
+@@ -226,6 +230,6 @@
+
+ /* goodbye - clean up and dump out */
+-void
+-cute_comm_goodbye()
++static void
++cute_comm_goodbye(void)
+ {
+ cute_orig_term_mode();
+@@ -241,5 +245,5 @@
+
+ /* Cute_Nap - nap for the specified number of milliseconds */
+-void
++static void
+ Cute_Nap (int ms)
+ {
+@@ -269,10 +273,10 @@
+ *----------------------------------------------------------------------
+ */
+-int
++static int
+ Cute_OpenLineCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (argc != 2) {
+@@ -338,8 +342,8 @@
+ int
+ Cute_CloseLineCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (argc != 1) {
+@@ -365,8 +369,8 @@
+ int
+ Cute_ParityCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int cflag;
+@@ -432,11 +436,11 @@
+ int
+ Cute_SelectSpeedCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int bps_bits;
+- static unsigned bits_per_second = 0;
++ static int bits_per_second = 0;
+
+ if (argc == 1) {
+@@ -472,5 +476,5 @@
+ #endif
+
+- if (!TclX_StrToUnsigned (argv[1], 0, &bits_per_second)) {
++ if (Tcl_GetInt(interp, argv[1], &bits_per_second) != TCL_OK) {
+ Tcl_AppendResult (interp, argv[0],
+ ": unrecognizable baud rate ", argv[1],
+@@ -591,8 +595,6 @@
+ }
+
+-int
+-cute_isline_up(interp, cmd)
+-Tcl_Interp *interp;
+-char *cmd;
++static int
++cute_isline_up(Tcl_Interp *interp, const char *cmd)
+ {
+ if (cute_line_up) return TCL_OK;
+@@ -614,8 +616,8 @@
+ int
+ Cute_SendCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int nocr = 0;
+@@ -648,6 +650,6 @@
+ }
+
+-void
+-cute_disconnect()
++static void
++cute_disconnect(void)
+ {
+ cute_interactive_connect = 0;
+@@ -660,10 +662,8 @@
+ */
+
+-void
+-cute_capture(buf, len)
+-char *buf;
+-int len;
++static void
++cute_capture(char *buf, int len)
{
- static previous_was_cr = 0;
+ static int previous_was_cr = 0;
char c;
static char cr = '\r';
-@@ -721,5 +722,5 @@
+@@ -706,8 +706,8 @@
+ int
+ Cute_CaptureCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (argc != 2) {
+@@ -721,5 +721,5 @@
}
- if (Tcl_GetOpenFile (interp, argv[1], 1, 1, &cute_captureFileP) != TCL_OK) {
+ if (Tcl_GetOpenFile (interp, argv[1], 1, 1, (ClientData *)&cute_captureFileP) != TCL_OK) {
cute_captureFileP = NULL;
return TCL_ERROR;
-@@ -1243,5 +1244,5 @@
+@@ -741,8 +741,8 @@
+ int
+ Cute_ConnectCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int c;
+@@ -840,8 +840,8 @@
+ int
+ Cute_DisconnectCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ cute_disconnect ();
+@@ -861,8 +861,8 @@
+ int
+ Cute_HangupCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ cute_comm_goodbye ();
+@@ -882,8 +882,8 @@
+ int
+ Cute_SlowSendCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int j, len;
+@@ -944,8 +944,8 @@
+ int
+ Cute_GetLineCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int newlineIndex;
+@@ -962,5 +962,5 @@
+
+ if (argc == 3) {
+- if (!TclX_StrToInt (argv[2], 10, &timeout_seconds)) {
++ if (Tcl_GetInt(interp, argv[2], &timeout_seconds) != TCL_OK) {
+ Tcl_AppendResult(interp, "bad timeout arg: ", argv[0],
+ " varName ", argv[2], (char *)NULL);
+@@ -1068,8 +1068,8 @@
+ int
+ Cute_ExpectCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int timeout_seconds;
+@@ -1101,5 +1101,5 @@
+ }
+
+- if (!TclX_StrToInt (argv[1], 10, &timeout_seconds)) {
++ if (Tcl_GetInt(interp, argv[1], &timeout_seconds) != TCL_OK) {
+ Tcl_AppendResult (interp, "bad timeout value: ", argv[0],
+ ": ", argv[1], (char *)NULL);
+@@ -1218,8 +1218,8 @@
+ int
+ Cute_FlushLineCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int flusharg;
+@@ -1243,5 +1243,5 @@
if (cute_isline_up(interp, argv[0]) == TCL_ERROR) return TCL_ERROR;
- if (ioctl(cute_linefd, TCFLSH, (struct termio *) flusharg) < 0) {
+ if (ioctl(cute_linefd, TCFLSH, flusharg) < 0) {
perror("flushing remote line");
}
+@@ -1260,8 +1260,8 @@
+ int
+ Cute_BreakLineCmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (cute_isline_up(interp, argv[0]) == TCL_ERROR) return TCL_ERROR;
+@@ -1274,6 +1274,6 @@
+
+ struct cuteCommandStruct {
+- const char *name;
+- int (*function)();
++ const char *name;
++ Tcl_CmdProc *function;
+ };
+
+@@ -1298,8 +1298,8 @@
+ int
+ Cute_Cmd(clientData, interp, argc, argv)
+- char *clientData;
++ void *clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ struct cuteCommandStruct *cmdptr = cuteCommands;
diff --git a/devel/tcl-neo/pkg-plist b/devel/tcl-neo/pkg-plist
index 9caba6793e6a..61b5a43d5055 100644
--- a/devel/tcl-neo/pkg-plist
+++ b/devel/tcl-neo/pkg-plist
@@ -1,3 +1,6 @@
+include/neo.h
+include/neoCbuf.h
+include/neoXcute.h
lib/libneo82.so.1
lib/libneo82.so
lib/neo8.2/pkgIndex.tcl
diff --git a/www/neowebscript/Makefile b/www/neowebscript/Makefile
index badf6d4ceee7..e49a72448266 100644
--- a/www/neowebscript/Makefile
+++ b/www/neowebscript/Makefile
@@ -7,7 +7,7 @@
PORTNAME= neowebscript
PORTVERSION= 3.3
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= www tcl
MASTER_SITES= SF/nws/nws/${PORTVERSION}
@@ -17,14 +17,15 @@ COMMENT= Embeds a TCL8 interpreter in the Apache server
LIB_DEPENDS= neo82:${PORTSDIR}/devel/tcl-neo
USE_APACHE= 1.3
-USE_TCL= yes
+USE_TCL= 84+
MAKEFILE= ${FILESDIR}/Makefile.bsd
WRKSRC= ${WRKDIR}/${DISTNAME}/modules
MAKE_ENV+= FILESDIR="${FILESDIR}" \
- INSTALL_DATA="${INSTALL_DATA}" \
- TCL_VERSION=${TCL_VER}
+ INSTALL_DATA="${INSTALL_DATA}" \
+ TCL_VERSION=${TCL_VER}
REINPLACE_ARGS= -i ""
SUB_FILES+= pkg-message neowebscript.conf
+SUB_LIST+= APACHEMODDIR=${APACHEMODDIR} APACHEETCDIR=${PREFIX}/${APACHEETCDIR}
SUBDIRS= modules neowebscript htdocs # tools
@@ -44,7 +45,7 @@ pre-install:
\( -type f -name \*.orig -o -type d -empty \) -delete
post-install:
- @${CP} ${WRKSRC}/../../neowebscript.conf ${LOCALBASE}/${APACHEETCDIR}/
+ @${CP} ${WRKDIR}/neowebscript.conf ${LOCALBASE}/${APACHEETCDIR}/neowebscript.conf.dist
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}/
@${CP} -Rp ${WRKSRC}/../htdocs/* ${DOCSDIR}/
diff --git a/www/neowebscript/files/Makefile.lib b/www/neowebscript/files/Makefile.lib
index 4a605e70badb..1f5d1b606b5a 100644
--- a/www/neowebscript/files/Makefile.lib
+++ b/www/neowebscript/files/Makefile.lib
@@ -10,7 +10,7 @@ INCLUDES= -I${PREFIX}/include/apache \
CC!= ${PREFIX}/sbin/apxs -q CC
CFLAGS!= ${PREFIX}/sbin/apxs -q CFLAGS CFLAGS_SHLIB
CFLAGS+= ${INCLUDES} -DGDTCL
-CFLAGS+= -DDEFAULT_XFERLOG=\"/var/log/httpd-access.log\"
+CFLAGS+= -DDEFAULT_XFERLOG=\"/var/log/httpd-access.log\" -Werror
# Ridiculous!
#CFLAGS+= -Dneo_log_module=log_neo_module \
@@ -19,6 +19,7 @@ CFLAGS+= -DDEFAULT_XFERLOG=\"/var/log/httpd-access.log\"
SHLIB_NAME= ${SRCS:R}.so
LDADD= -L${PREFIX}/lib -ltcl${TCL_NDVER} -lm
+WARNS= 2
USE_DB!= grep -l db.h ${.CURDIR}/${SRCS}
.if !empty(USE_DB)
@@ -27,6 +28,6 @@ LDADD+= -ldb2
#LDFLAGS= ${LDADD}
-NOMAN= True # don't bother with the man-page here, let the port handle it
+NO_MAN= True # don't bother with the man-page here, let the port handle it
.include <bsd.lib.mk>
diff --git a/www/neowebscript/files/neowebscript.conf.in b/www/neowebscript/files/neowebscript.conf.in
index 387f55470502..a48ad09ef52c 100644
--- a/www/neowebscript/files/neowebscript.conf.in
+++ b/www/neowebscript/files/neowebscript.conf.in
@@ -3,10 +3,10 @@
#### (uncomment to activate)
####
-LoadModule neoscript_module %%APACHEMODDIR%%/apache/mod_neoscript.so
-#LoadModule neo_userdir_module %%APACHEMODDIR%%/apache/mod_neo_userdir.so
-#LoadModule log_neo_module %%APACHEMODDIR%%/apache/mod_log_neo.so
-#LoadModule tcl_auth_module %%APACHEMODDIR%%/apache/mod_auth_tcl.so
+LoadModule neoscript_module %%APACHEMODDIR%%/mod_neoscript.so
+#LoadModule neo_userdir_module %%APACHEMODDIR%%/mod_neo_userdir.so
+#LoadModule neo_log_module %%APACHEMODDIR%%/mod_log_neo.so
+#LoadModule tcl_auth_module %%APACHEMODDIR%%/mod_auth_tcl.so
## Enable the NeoWebScript handler
AddType text/html .nhtml .nws
diff --git a/www/neowebscript/files/patch-access b/www/neowebscript/files/patch-access
index bebb7ef521ea..1b47a21c3b20 100644
--- a/www/neowebscript/files/patch-access
+++ b/www/neowebscript/files/patch-access
@@ -1,5 +1,5 @@
--- mod_auth_tcl.c Fri Nov 19 19:35:28 1999
-+++ mod_auth_tcl.c Thu Jan 3 12:24:41 2002
++++ mod_auth_tcl.c 2010-01-18 23:47:06.000000000 -0500
@@ -5,5 +5,5 @@
* You may freely redistribute most NeoSoft extensions to the Apache webserver
* for any purpose except commercial resale and/or use in secure servers,
@@ -157,9 +157,14 @@
+
if (!method_restricted)
return OK;
-@@ -214,4 +228,59 @@
+@@ -214,4 +228,63 @@
}
++/*
++ * Defined in both mod_neo_include.c and mod_neoscript.c
++ */
++void propagate_vars_to_nws(Tcl_Interp *interp, request_rec *r);
++
+/* A c c e s s
+ *
+ * Access control doesnt care about user identity, so the user doesnt
@@ -187,7 +192,6 @@
+ &tcl_auth_module);
+ char errstr[MAX_STRING_LEN];
+ int code;
-+ char *t;
+
+ if (!sec->tcl_access_command)
+ return DECLINED;
@@ -217,7 +221,7 @@
+
module tcl_auth_module = {
STANDARD_MODULE_STUFF,
-@@ -224,7 +293,7 @@
+@@ -224,7 +297,7 @@
NULL, /* handlers */
NULL, /* filename translation */
- authenticate_basic_user_via_tcl, /* check_user_id */
diff --git a/www/neowebscript/files/patch-neoscript b/www/neowebscript/files/patch-neoscript
index ceca90785f39..f512a05fda6a 100644
--- a/www/neowebscript/files/patch-neoscript
+++ b/www/neowebscript/files/patch-neoscript
@@ -1,24 +1,199 @@
--- mod_neoscript.c Fri Jul 21 19:49:29 2000
-+++ mod_neoscript.c Fri Aug 17 11:41:58 2001
-@@ -68,1 +68,1 @@
++++ mod_neoscript.c 2010-01-19 00:13:35.000000000 -0500
+@@ -66,10 +66,14 @@
+ #include "util_md5.h"
+
-#include <db.h>
+#include <db2/db.h>
-@@ -72,3 +72,5 @@
+ #include <assert.h>
+ #include <stdio.h>
+
#include "tcl.h"
-#include "tclExtend.h"
+#ifdef STATIC_TCLX
+# include "tclExtend.h"
+#endif
++#include <generic/tclInt.h>
++#include <generic/tclIntDecls.h>
+
+ extern char ap_server_root[];
+@@ -79,4 +83,11 @@
+ void Tcl_InitExtensions(Tcl_Interp *interp);
+
++static Tcl_CmdProc Neo_IncludeCmd, Neo_IncludeCmd, Neo_IncludeCmd,
++ Neo_IncludeCmd, Neo_FlushBufferCmd, Neo_AbortPageCmd,
++ Neo_HttpdCmd, Tcl_HtmlCmd,
++ Neo_RequestInfoCmd, Tcl_ExtendSafeSlaveCmd,
++ Tcl_SetHeaderCmd, NWS_MD5Cmd, Tcl_gm_timestr_822Cmd;
++static Tcl_ObjCmdProc Neo_UnescapeUrlCmd, Neo_SimplifyPathnameCmd;
++
+ char softwareStartTimeString[32];
+
+@@ -128,5 +139,6 @@
+ static int NeoWebCacheEnabled;
+
+-int load_sub_req (Tcl_Interp *interp, request_rec *r)
++static int
++load_sub_req (Tcl_Interp *interp, request_rec *r)
+ {
+ int errstatus;
+@@ -201,5 +213,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ request_rec *rr=NULL;
+@@ -401,5 +413,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (argc != 1) {
+@@ -428,5 +440,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (argc != 1) {
+@@ -463,5 +475,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ if (argc != 2 || strncmp("child_terminate", argv[1], strlen(argv[1]))) {
+@@ -488,18 +500,19 @@
+ */
+ int
+-Neo_UnescapeUrlCmd (clientData, interp, argc, argv)
++Neo_UnescapeUrlCmd (clientData, interp, argc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ Tcl_Obj * const objv[];
+ {
++ char *string;
+ if (argc != 2) {
+- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+- " url\"", (char *) NULL);
++ Tcl_WrongNumArgs(interp, 1, objv, "url");
+ return TCL_ERROR;
+ }
+
+- if (ap_unescape_url(argv[1]) == OK) {
+- interp->result = argv[1];
++ string = Tcl_GetString(objv[1]);
++ if (ap_unescape_url(string) == OK) {
++ Tcl_SetResult(interp, string, TCL_VOLATILE);
+ }
+ return TCL_OK;
+@@ -524,8 +537,8 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ char intbuf[20];
+- char *varName;
++ const char *varName;
+ int depth;
+ request_rec *r = Tcl_request_rec;
+@@ -633,5 +646,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ int i, forceHeaders = 1;
+@@ -663,5 +676,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ char *digest;
+@@ -681,5 +694,5 @@
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ const char *argv[];
+ {
+ char *ascii_time;
+@@ -702,5 +715,5 @@
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ const char *argv[]; /* Argument strings. */
+ {
+ Tcl_Interp *slaveInterp;
+@@ -741,18 +754,19 @@
+ */
+ int
+-Neo_SimplifyPathnameCmd (clientData, interp, argc, argv)
++Neo_SimplifyPathnameCmd (clientData, interp, argc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+- char **argv;
++ Tcl_Obj * const objv[];
+ {
++ char *pathname;
++
+ if (argc != 2) {
+- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+- " pathname\"", (char *) NULL);
++ Tcl_WrongNumArgs(interp, 1, objv, "pathname");
+ return TCL_ERROR;
+ }
+
+- ap_getparents(argv[1]);
+- interp->result = argv[1];
++ ap_getparents(pathname);
++ Tcl_SetResult(interp, pathname, TCL_VOLATILE);
+ return TCL_OK;
+ }
+@@ -781,5 +795,5 @@
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ const char *argv[]; /* Argument strings. */
+ {
+ int i = 1, tagstart, newline = 0;
+@@ -826,5 +840,6 @@
+ /* ----------------------- Initialization function ------------------------- */
+
+-void init_nws(server_rec *s, pool *p)
++static void
++init_nws(server_rec *s, pool *p)
+ {
+ time_t date;
+@@ -851,5 +866,9 @@
+
+ /* Setup a library Path */
++#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5
+ TclpInitLibraryPath(".");
++#else
++ TclSetLibraryPath(Tcl_NewStringObj(".", 2));
++#endif
-@@ -862,2 +864,3 @@
+ /* Tcl */
+@@ -861,4 +880,5 @@
+ }
+#ifdef STATIC_TCLX
/* Extended Tcl */
-@@ -871,2 +874,3 @@
+ if (Tclx_Init(interp) == TCL_ERROR) {
+@@ -870,4 +890,5 @@
+ Tcl_StaticPackage(interp, "Tclx", Tclx_Init, Tclx_SafeInit);
/* Tclx does its own call to Tcl_StaticPackage */
+#endif
-@@ -908,6 +908,6 @@
+ #ifdef POSTGRESQL
+@@ -904,6 +925,6 @@
#endif
-#ifdef GDTCL
@@ -27,28 +202,221 @@
+ /* Image generation */
if (Gd_Init(interp) == TCL_ERROR) {
fprintf(stderr,
-@@ -916,2 +920,3 @@
+@@ -915,4 +936,5 @@
+ #endif
+#ifdef STATIC_NEO
/* NeoSoft Extensions */
-@@ -924,2 +929,3 @@
+ if (Neo_Init(interp) == TCL_ERROR) {
+@@ -923,4 +945,5 @@
+ }
Tcl_StaticPackage(interp, "Neo", Neo_Init, NULL);
+#endif
-@@ -956 +956 @@
+ /*
+@@ -948,8 +971,8 @@
+
+ if (Tcl_VarEval(interp, "source ",
- ap_server_root_relative(p, "neowebscript/init.tcl"), (char *)NULL)
+ ap_server_root_relative(p, "share/neowebscript/init.tcl"), (char *)NULL)
-@@ -1687,2 +1687,3 @@
+ == TCL_ERROR)
+ {
+- char *errorInfo;
++ const char *errorInfo;
+
+ errorInfo = Tcl_GetVar (interp, "errorInfo", TCL_GLOBAL_ONLY);
+@@ -998,9 +1021,9 @@
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+
+- Tcl_CreateCommand(interp, "www_simplify_pathname",
++ Tcl_CreateObjCommand(interp, "www_simplify_pathname",
+ Neo_SimplifyPathnameCmd,
+ (ClientData) NULL, (void (*)()) NULL);
+
+- Tcl_CreateCommand(interp, "www_unescape_url",
++ Tcl_CreateObjCommand(interp, "www_unescape_url",
+ Neo_UnescapeUrlCmd,
+ (ClientData) NULL, (void (*)()) NULL);
+@@ -1179,7 +1202,10 @@
+ */
+
+-int find_string2(FILE *in, char *str1, char *str2, request_rec *r, int *result, int printing)
++static int
++find_string2(FILE *in, const char *str1, const char *str2,
++ request_rec *r, int *result, int printing)
+ { int x, l1 = strlen(str1), l2 = strlen(str2), p, p1, p2, m1, m2;
+- char c, *str, outbuf[OUTBUFSIZE];
++ char c, outbuf[OUTBUFSIZE];
++ const char *str;
+ int outind = 0;
+
+@@ -1596,5 +1622,5 @@
+ timeTextBuf, TCL_GLOBAL_ONLY);
+
+- sprintf (timeTextBuf, "%ld", r->finfo.st_uid);
++ sprintf (timeTextBuf, "%ld", (long)r->finfo.st_uid);
+ Tcl_SetVar2(interp, "webenv", "NEO_DOCUMENT_UID",
+ timeTextBuf, TCL_GLOBAL_ONLY);
+@@ -1608,87 +1634,4 @@
+ /* --------------------------- Action handlers ---------------------------- */
+
+-/* ensure that path is relative, and does not contain ".." elements
+- * ensentially ensure that it does not match the regex:
+- * (^/|(^|/)\.\.(/|$))
+- * XXX: this needs os abstraction... consider c:..\foo in win32
+- */
+-static int is_only_below(const char *path)
+-{
+-#if WIN32
+- if (path[1] == ':')
+- return 0;
+-#endif
+- if (path[0] == '/') {
+- return 0;
+- }
+- if (path[0] == '.' && path[1] == '.'
+- && (path[2] == '\0' || path[2] == '/')) {
+- return 0;
+- }
+- while (*path) {
+- if (*path == '/' && path[1] == '.' && path[2] == '.'
+- && (path[3] == '\0' || path[3] == '/')) {
+- return 0;
+- }
+- ++path;
+- }
+- return 1;
+-}
+-
+-int run_pickfile_req( request_rec *r )
+-{
+- int errstatus;
+- FILE *f;
+- char buf[IOBUFSIZE];
+- int nLines;
+- int whichLine;
+-
+- if (r->method_number != M_GET) return DECLINED;
+- if (r->finfo.st_mode == 0 || (r->path_info && *r->path_info)) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
+- "access to %s failed for %s, reason %s", r->filename,
+- ap_get_remote_host(r->connection, r->per_dir_config,
+- REMOTE_NAME),
+- "File does not exist");
+- return HTTP_NOT_FOUND;
+- }
+-
+- ap_set_last_modified(r);
+- if ((errstatus = ap_set_content_length (r, r->finfo.st_size))
+- || ((errstatus = ap_meets_conditions (r)) != OK))
+- return errstatus;
+-
+- f = fopen (r->filename, "r");
+-
+- if (f == NULL) {
+- ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
+- "access to %s failed for %s, reason %s", r->filename,
+- ap_get_remote_host(r->connection, r->per_dir_config,
+- REMOTE_NAME),
+- "file permissions deny server access");
+- return HTTP_FORBIDDEN;
+- }
+-
+- if ((fgets(buf, IOBUFSIZE, f) != NULL) || (errno == EINTR)) {
+- nLines = atoi(buf);
+- if (nLines <= 0) {
+- fclose (f);
+- return OK;
+- }
+-
+- ap_soft_timeout("send-pick", r);
+-
- srand((int)(getpid() * 17 + time((long *) 0)));
- for (whichLine = rand() % nLines; whichLine-- >= 0; ) {
-+ /* Use BSD's random(4) device and the random(3) functions */
-+ srandomdev();
-+ for (whichLine = random() % nLines; whichLine-- >= 0; ) {
-@@ -2164 +2165,6 @@
+- if ((fgets(buf,IOBUFSIZE,f)) == NULL) {
+- if (errno != EINTR) break;
+- }
+- }
+- ap_rprintf (r, "%s", buf);
+- }
+- fclose(f);
+- return OK;
+-}
+-
+ Tcl_Interp *get_slave_interp (request_rec *r, char *handler_name, char *name) {
+ extern Tcl_Interp *interp;
+@@ -1743,5 +1686,5 @@
+ strcpy (script, "setup_safe_interpreter");
+ if (Tcl_GlobalEval(interp, script) != TCL_OK) {
+- char *errorInfo;
++ const char *errorInfo;
+
+ errorInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);
+@@ -1911,5 +1854,4 @@
+ char directive[MAX_STRING_LEN], error[MAX_STRING_LEN];
+ char timefmt[MAX_STRING_LEN];
+- int noexec = ap_allow_options(r) & OPT_INCNOEXEC;
+ int ret, sizefmt, seqtype=0;
+ int init_environment, if_nesting, printing, conditional_status;
+@@ -2040,8 +1982,8 @@
+ request_rec *Tcl_saved_request_rec;
+ Tcl_Channel fchan;
+- char *fchan_name;
++ const char *fchan_name;
+ Tcl_DString userCommand;
+- char *commandString;
+- int fno;
++ const char *commandString;
++ intptr_t fno;
+
+ Tcl_saved_request_rec = Tcl_request_rec;
+@@ -2090,5 +2032,5 @@
+
+ status = db->get(db, NULL, &key, &data, 0);
+- db->close(db, NULL);
++ db->close(db, 0);
+ if (status)
+ return HTTP_NOT_FOUND;
+@@ -2113,5 +2055,5 @@
+ return;
+
+- if (db_open(NeoWebCacheName, DB_HASH, NULL, 0644, NULL, NULL, &db))
++ if (db_open(NeoWebCacheName, DB_HASH, 0, 0644, NULL, NULL, &db))
+ return;
+
+@@ -2131,5 +2073,5 @@
+ perror("db->put"); */
+ }
+- db->close(db, NULL);
++ db->close(db, 0);
+ return;
+ }
+@@ -2156,5 +2098,10 @@
+ struct request_rec *frr = NULL;
+
- if (!(ap_allow_options(r) & OPT_INCLUDES)) return DECLINED;
+ if (!(ap_allow_options(r) & OPT_INCLUDES)) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, r, "Apache configuration "
-+ "does not allow SSI parsing for ``%s''",
++ "does not allow SSI parsing for ``%s'' (mode %d)",
+ r->filename, mode);
+ return DECLINED;
+ }
+
+ r->allowed |= (1 << M_GET);
+@@ -2162,7 +2109,7 @@
+ ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
+ "File does not exist: %s",
+- (r->path_info
++ r->path_info
+ ? ap_pstrcat(r->pool, r->filename, r->path_info, NULL)
+- : r->filename, r));
++ : r->filename);
+ return HTTP_NOT_FOUND;
+ }
+@@ -2294,5 +2241,5 @@
+ if (Tcl_GlobalEval(interp, script) == TCL_ERROR)
+ {
+- char *errorInfo;
++ const char *errorInfo;
+
+ /* An error occured setting up for the upload. We have
diff --git a/www/neowebscript/files/patch-warnings b/www/neowebscript/files/patch-warnings
new file mode 100644
index 000000000000..070f94bfa9e3
--- /dev/null
+++ b/www/neowebscript/files/patch-warnings
@@ -0,0 +1,21 @@
+--- mod_neo_userdir.c 1999-11-19 19:35:28.000000000 -0500
++++ mod_neo_userdir.c 2010-01-17 15:02:59.000000000 -0500
+@@ -60,7 +60,8 @@
+ */
+
+-#include "httpd.h"
+-#include "http_config.h"
+-#include "ap_compat.h"
++#include <httpd.h>
++#include <http_config.h>
++#include <http_log.h>
++#include <ap_compat.h>
+
+ #include "tcl.h"
+@@ -306,5 +306,5 @@
+ extern Tcl_Interp *interp;
+ int code;
+- char *where;
++ const char *where;
+ code = Tcl_VarEval(interp, userdir+1, " ", pw->pw_name, " ",
+ pw->pw_dir, " {", pw->pw_gecos, "} {", dname+1,
diff --git a/www/neowebscript/files/pkg-message.in b/www/neowebscript/files/pkg-message.in
index d1368190b840..d31cacccfa7d 100644
--- a/www/neowebscript/files/pkg-message.in
+++ b/www/neowebscript/files/pkg-message.in
@@ -1,6 +1,7 @@
-
Please, adjust the %%APACHEETCDIR%%/neowebscript.conf
- to your liking and add
+ (%%APACHEETCDIR%%/neowebscript.conf.dist is insalled
+ for your convenience) to your liking and add
include etc/apache/neowebscript.conf
diff --git a/www/neowebscript/pkg-plist b/www/neowebscript/pkg-plist
index 0369f94a7415..82968c25c360 100644
--- a/www/neowebscript/pkg-plist
+++ b/www/neowebscript/pkg-plist
@@ -1,4 +1,4 @@
-%%APACHEETCDIR%%/neowebscript.conf
+%%APACHEETCDIR%%/neowebscript.conf.dist
%%APACHEMODDIR%%/mod_neoscript.so
%%APACHEMODDIR%%/mod_neo_userdir.so
%%APACHEMODDIR%%/mod_log_neo.so