diff options
Diffstat (limited to 'www')
-rw-r--r-- | www/neowebscript/Makefile | 11 | ||||
-rw-r--r-- | www/neowebscript/files/Makefile.lib | 5 | ||||
-rw-r--r-- | www/neowebscript/files/neowebscript.conf.in | 8 | ||||
-rw-r--r-- | www/neowebscript/files/patch-access | 12 | ||||
-rw-r--r-- | www/neowebscript/files/patch-neoscript | 398 | ||||
-rw-r--r-- | www/neowebscript/files/patch-warnings | 21 | ||||
-rw-r--r-- | www/neowebscript/files/pkg-message.in | 3 | ||||
-rw-r--r-- | www/neowebscript/pkg-plist | 2 |
8 files changed, 428 insertions, 32 deletions
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 |