From aaron91@example.net Mon Feb 01 09:54:38 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 8383 invoked by uid 6000); 1 Feb 1999 09:54:33 -0000 Received: (qmail 8375 invoked from network); 1 Feb 1999 09:54:30 -0000 Received: from i.meepzor.com (HELO Mail.MeepZor.Com) (aaron91@example.net) by taz.hyperreal.org with SMTP; 1 Feb 1999 09:54:30 -0000 Received: (from cvs@localhost) by Mail.MeepZor.Com (8.8.5/8.8.5) id XAA08428; Sun, 31 Jan 1999 23:45:17 -0500 Date: Sun, 31 Jan 1999 23:45:17 -0500 Message-Id: <aaron91@example.net> From: Rodent of Unusual Size <aaron91@example.net> To: Apache HTTP developers <aaron91@example.net> Subject: [STATUS] (apache-1.3) Sun Jan 31 23:45:15 EST 1999 X-Note: This is an automated message. Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net 1.3 STATUS: Last modified at [$Date: 1999/01/31 21:54:01 $] Release: 1.3.5-dev: current. 1.3.4: Tagged and rolled on Jan. 9. Released on 11th, announced on 12th. 1.3.3: Tagged and rolled on Oct. 7. Released on 9th, announced on 10th. 1.3.2: Tagged and rolled on Sep. 21. Announced and released on 23rd. 1.3.1: Tagged and rolled on July 19. Announced and released. 1.3.0: Tagged and rolled on June 1. Announced and released on the 6th. 2.0 : In pre-alpha development, see apache-2.0 repository RELEASE SHOWSTOPPERS: * md5 passwd stuff incompatible with FreeBSD implementation. RELEASE NON-SHOWSTOPPERS BUT WOULD BE REAL NICE TO WRAP THESE UP: * Randy's proposed changes for binbuild: 1. Change to build binary only distribution 2. Use standard Apache layout [It is currently using the BinaryDistribution layout that mimics the standard Apache layout _without_ any absolute paths in it (apart from HTTPD_ROOT /usr/local/apache). This makes it possible for a user to install it in _any_ directory.] [Roy: I don't understand what Randy wants to change here.] 3. Add 'make dist' target to call binbuild.sh [Roy: That would require a Makefile, which is what binbuild creates. I don't see any point in that.] 4. Create toplevel 'setup' script for install to mirror win32 name [It is currently creating "install-bindist.sh"] * long pathnames with many components and no AllowOverride None Workaround is to define <Directory /> with AllowOverride None, which is something all sites should do in any case. Status: Marc was aaron91@example.net. Documentation that needs writing: Available Patches: * Roy's [PATCH] Core dump with Language Negotiation?!? Message-ID: <aaron91@example.net> Status: Roy +1 * Tony Finch's [PATCH] to mod_log_config.c to get both the 1.3.3 behaviour of %v and the 1.3.4 behaviour as %V. Message-ID: <aaron91@example.net> Status: * Ralf's patch to fix append of target name to layout paths Message-ID: <aaron91@example.net> Status: Ralf +1, Roy +1 * Ralf's adjusted version of Fred's Add strip flags variables Message-ID: <aaron91@example.net> Status: Ralf +1 * Fred's PATCH: Add strip flags variables in Makefile.tmpl Message-ID: <aaron91@example.net> Status: Ralf -0 (see above replacement) * Fred's PATCH: man page section numbers Message-ID: <aaron91@example.net> Status: Ralf +1, Roy +1 * Fred's PATCH: Add cgidir, htdocsdir, iconsdir variables in Makefile.tmpl Message-ID: <aaron91@example.net> Status: Ralf +1 (on concept) * Fred's PATCH: Add Mac OS X Server Layout file layout Message-ID: <aaron91@example.net> Status: Roy +1 * Jim Patterson's patch to make mod_info work on Win32 Message-ID: PR#1442 Status: Lars +1 (on concept) * Peter Greis' new '%m' CustomLog option: the time taken to serve the request, in milli-seconds. Message-ID: PR#2838 Status: Jim +0 (as is, the patch requires rework since it needs to be aware of NO_GETTIMEOFDAY and NO_TIMES as well as implement a times() alternative. Not only that, but with extended_status, we calculate this anyway). * Ronald Tschalär's ap_uuencode() bugfix Message-ID: PR#3411 Status: Lars +1 (on concept) * Michael van Elst's patch [PR#3160] to improve mod_rewrite's in-core cache handling by using a hash table. Message-ID: <aaron91@example.net> Status: Lars +1, Jim +1, Ralf +1 (on concept, but because the code change is not trivial I want to first walk though it line by line the next days before we commit it). * Juan Gallego's patch to add CSH-style modifiers (:h, :r, :t, :e) to mod_include's variable processing. Mesage-ID: PR#3246, also available at <http://www.physics.mcgill.ca/~juan/mod_include.patch> Status: Ken -0 for 1.3/+0 for 2.0, Lars -0 for 1.3 * Eric Prud'hommeaux's mod_dir mods for file-level access control. Message-ID: <aaron91@example.net> Status: Jim -0 (The current behavior seems logical to me. If there was more universal interest in changing it, then that would be a different matter). * Eric Prud'hommeaux's mods for practical negotiation with file level access control. Message-ID: <aaron91@example.net> Status: * Ronald Tschalär's major update of mod_digest Message-ID: <aaron91@example.net> Status: Big change -- needs review. In progress: * Marc's [PATCH] PR#3323: recursive includes Message-ID: <aaron91@example.net> Status: Marc +1, Jim +1 (concept) * Needs more in-depth review * * Mark Bixby's freshening up the MPE/iX port (mostly APACI) Message-ID: <aaron91@example.net> Status: Mark says: "...currently waiting for HP to fix two OS bugs. A fix for siglongjmp() is available and has been tested successfully by me, but has yet to be included in a public patch. The likely cause of the "EINTR from fopen()" bug has been identified, but analysis on how to fix it continues." * Doug MacEachern's libapr - Generic Apache Request Library (Alpha) This package contains modules for manipulating client request data via the Apache API with Perl and C. Status: http://www.pobox.com/~dougm/libapr-0.20_01.tar.gz Needs patch: * get_path_info bug; ap_get_remote_host should be ap_vformatter instead. See: <aaron91@example.net> * uri issues - RFC2068 requires a server to recognize its own IP addr(s) in dot notation, we do this fine if the user follows the dns-caveats documentation... we should handle it in the case the user doesn't ever supply a dot-notation address. * Problems dealing with .-rooted domain names such as "twinlark." versus "twinlark.arctic.org.". See the thread containing Message-ID: <aaron91@example.net> for more details. In particular this affects the correctness of the proxy and the vhost mechanism. * proxy_*_canon routines use r->proxyreq incorrectly. See <aaron91@example.net> * work around a Navigator/Mozilla bug when mod_proxy is used (broken images). Message-ID: <aaron91@example.net> Status: Lars' patch was vetoed. Roy and Dean think that it is probably another buffer magic number error and should be tested to find out and, if so, fixed like it was in core. * ap_escape_html() always duplicates the string, even when there is no change and the caller would be happy to use the original. What is needed is a separate interface for "don't need a dup" situations, like just about everywhere we use it in bvputs and bputs calls. * Should we disallow requests with bogus characters in the method? See <aaron91@example.net> * A mechanism is needed for applying access control to methods that are not known by the server core, either using a Limit __unknown__ as in <<8B57882C41A0D1118F7100805F9F68B50631A7B2@RED-MSG-45>, or via a LimitExcept directive. Open issues: * Official retirement of 1.2; when? Ken suggests as of 1.3.4. 'Retirement' to be interpreted as removing the verbiage from the main Apache page, but leaving the kits in /dist/. Status: Ken +1, Randy +1, Dean +1, Ralf +1, Jim +1 * Someone other than Dean has to do a security/correctness review on psprintf(), bprintf(), and ap_snprintf(). In particular these routines do lots of fun pointer manipulations and such and possibly have overflow errors. The respective flush_funcs also need to be exercised. o Jim's looked over the ap_snprintf() stuff (the changes that Dean did to make thread-safe) and they look fine. o Laura La Gassa's looked over ap_vformatter & other related code o Martin did a "source review" as well. o Could still use 1 or 2 more sets of eyeballs. Status: Is this still valid?? * Paul would like to see a 'gdbm' option because he uses it a lot. * Maybe a http_paths.h file? See <aaron91@example.net> +1: Brian, Paul, Ralf, Martin +0: Jim (not for 1.3.0) * Release builds: Should we provide Configuration or not? Should we 'make all suexec' in src/support? +1: Brian, Jim, Ken +1 (possible suexec path issue, though) * root's environment is inherited by the Apache server. Jim & Ken think we should recommend using 'env' to build the appropriate environment. Marc and Alexei don't see any big deal. Martin says that not every "env" has a -u flag. * Marc's socket options like source routing (kill them?) Marc, Martin say Yes * Ken's PR#1053: an error when accessing a negotiated document explicitly names the variant selected. Should it do so, or should the original URI be referenced? * Proposed API Changes: - r->content_language is for backwards compatibility... with modules that may not link any longer without some minor editing. The new field is r->content_languages. Heck it's not even mentioned in apache-devsite/mmn.txt when we got content_languages (note the s!). The proposal is to remove r->content_language: Status: Paul +1, Ralf +1, Ken +1, Martin +1 - child_exit() is redundant, it can be implemented via cleanups. It is not "symmetric" in the sense that there is no exit API method to go along with the init() API method. There is no need for an exit method, there are already modules using cleanups to perform this (see mod_mmap_static, and mod_php3 for example). The proposal is to remove the child_exit() method and document cleanups as the method of handling this need. Status: Rasmus +1, Paul +1, Jim +1, Martin +1, Ralf +1, Ken +1 * Should we re-enable nagle now that we're non-buffering CGIs? See various messages from Marc in March 98. * TZ should not be dealt with specially any longer now that we have "PassEnv". See <aaron91@example.net> Jim: IMO it's too late in the game for this... I'm sure this would cause some strange bug reports as people's cgi-scripts no longer work correctly ("It worked just fine before I upgraded to 1.3.0") unless we warn people in big nasty letters to add PassEnv TZ to their config files "just in case" and hope they do it :) * In ap_bclose() there's no test that (fb->fd != -1) -- so it's possible that it'll do something completely bogus when it's used for read-only things. - Dean Gaudet * Roy's HTTP/1.1 Wishlist items: 1) byte range error handling * use of spawnvp in uncompress_child in mod_mime_magic - doesn't use the new child_info structure, is this still safe? Needs to be looked at. * suexec doesn't understand argv parameters; e.g. <!--#exec cmd="./ls -l" --> fails even when "ls" is in the same directory because suexec is trying to stat a file called "ls -l". A patch for this is available at http://www.xnet.com/~emarshal/suexec.diff and it's not bad except that it doesn't handle programs with spaces in the filename (think win32, or samba-mounted filesystems). There are several PR's to this and I don't see for security reasons why we can't accomodate it, though it does add complexity to suexec.c. PR #1120 Brian: +1 Win32 specific issues: Important * fix O(n^2) attack in mod_isapi.c ... i.e. recopy the code from scan_script_headers_err_core. In progress: * Ben's ASP work... All agree it sounds cool. * DDA's adding a tray application to the Windoze version for ease of status/management. <aaron91@example.net> <aaron91@example.net> Status: Ken +1, Sameer +1, Martin +1, Ben +1 (as long as we get a single executable) Paul: No like Win95 specific stuff Ken: What's W95-specific about it? Help: * should trap ^C when running not-as-service and do proper shutdown * should have a pretty little icon for Apache on Win32 * proxy module doesn't load on Win95. Why? Good question. PR#1462. * Proxy cache garbage collection doesn't work. PR#1891 * "Directory /", "Directory C:/" both fail to do anything, while "Directory *" SEGVs. * chdir() for CGI scripts and mod_include #exec needs to be re-implemented now that CreateProcess is being used. * process/thread model - need dynamic thread creation/destruction, similar to Unix process model - can't use WaitForMultipleObjects in the same way we do now, since that has a limit of 64(!) objects. Grr. PR#1665 * some errors printed by CGIs to stderr don't end up making it to the server log unless an extra debugging message is added after they run? (PR#1725 indicates this may not be just Win32) * handle bugs that make it pop up errors on console, ie. segv equiv? Can we do this? Need to make it robust. * install - make installshield work - config in cvs tree? - install docs, etc.? - location for install * the mutex should be critical-regions, since the current design is creating a mess of SO calls that are unnecessary * we don't mmap on NT. Use TransmitFile? * CGIs - docs on how they work w/scripts - use registry to find interpreter? - WTF is the buffering coming from? - we don't have a way to make non-blocking files on NT! * performance * documentation: - running the server without admin - how CGIs work - update README.NT - short/long name handling - better status page on current state of NT for users * http_main.c hell - split into two files? * who should run the service? Who exactly is the "system account"? docs say: Localsystem is a very privileged account locally, so you shouldn't run any shareware applications there. However, it has no network privileges and cannot leave the machine via any NT-secured mechanism, including file system, named pipes, DCOM, or secure RPC. and: A service that runs in the context of the LocalSystem account inherits the security context of the SCM. It is not associated with any logged-on user account and does not have credentials (domain name, user name, and password) to be used for verification. This has several implications: [... removed ...] That _really_ sucks. Can we recommend running Apache as some other user? * modules that need to be made to work on win32 - mod_example isn't multithreadreded - mod_unique_id (needs mt changes) - mod_auth_db.c (do we want to even try this? We should have some db of some sort... what else can we pick from under win32?) - mod_auth_dbm.c - mod_info.c (PR#1442 re exporting symbols for it...) - mod_log_agent.c - mod_log_referer.c - mod_mime_magic.c (needs access to mod_mime API stage...) * do something to disable bogus warnings * rfc1413.c has static storage which won't work multithreaded * mod_include --> exec cgi, exec cmd, etc. don't work right. Looks like a code path that isn't run anywhere else that has something not quite right... A PR or two on it. * signal type handling - how to rotate logs from command line? (Point people to Andrew Ford's cronolog because it's "better" than ours?) * Currently if you double click on the conf files or the log files you get a useless dialog offering the set of all executables, usually after a very long pause. Ought to stuff .conf in the registry mapping it to text. * apparently either "BrowserMatch" or the "nokeepalive" variable cause instability - see PR#1729. Binaries The goal here is to have two columns of all-Y (where applicable) for the two stable release versions, and nothing under Old unless the new version just doesn't work on that platform. 1.2.6 1.3.4 Old aix_4.1 N N 1.2.5, 1.3.1 alphalinux N N 1.3.0 aux_3.1 N N 1.3.0 decalphaNT N N 1.3b6 dunix_4.0 N N 1.2.4, 1.3.0, 1.3.1 freebsd_2.1 N N 1.2.4 freebsd_2.2 N N 1.2.5 hpux_10.20 N N 1.2.5 hpux_11 N N 1.3.2 irix_6.2 N N 1.2.5 linux_2.x N N 1.2.4, 1.3.0 netbsd_1.2 N N 1.2.4 os2 N N 1.3.2 reliantunix_5.4 Y N 1.3.1 solaris N N 1.2.5, 1.3.0, 1.3.1 sparclinux N N 1.3.0, 1.3.1 sunos_4.1.x N N 1.2.5 ultrix_4.4 N N 1.2.4 win32 - N 1.3.2 (is symlink okay?) From aaron91@example.net Mon Feb 01 09:54:49 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 8715 invoked by uid 6000); 1 Feb 1999 09:54:48 -0000 Received: (qmail 8706 invoked from network); 1 Feb 1999 09:54:46 -0000 Received: from i.meepzor.com (HELO Mail.MeepZor.Com) (aaron91@example.net) by taz.hyperreal.org with SMTP; 1 Feb 1999 09:54:46 -0000 Received: (from cvs@localhost) by Mail.MeepZor.Com (8.8.5/8.8.5) id XAA08445; Sun, 31 Jan 1999 23:45:31 -0500 Date: Sun, 31 Jan 1999 23:45:31 -0500 Message-Id: <aaron91@example.net> From: Rodent of Unusual Size <aaron91@example.net> To: Apache HTTP developers <aaron91@example.net> Subject: [STATUS] (apache-2.0) Sun Jan 31 23:45:28 EST 1999 X-Note: This is an automated message. Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net Apache 2.0 STATUS: Last modified at [$Date: 1999/01/07 22:55:42 $] Release: 2.0 : In pre-alpha development Plan: Everyone with plans on things they want to do for 2.0 should add them to the repository now. Use a descriptive filename. Other code will be copied over when 1.3.? is finished. Showstoppers: Committed Code Changes: Available Patches: In progress: Needs patch: Open issues: * Library of routines to allow access to memory shared between processes, for things like per-module caches. Such shared segments should persist until the refcount drops to zero. It would be cool if pools could be created in such segments to allow things like shared tables and arrays. +1: Roy, Paul, Ken, Ralf, Martin, Lars * "Apache ports" project - simple-to-install (a la CPAN) one-off tools, scripts (such as counters, guest books, et cetera) +1: Roy, Paul, Ken, Ralf, Martin David Southwell has volunteered to work on this. -0: Lars [If we do this for modules only I'm +1, but I'm not very happy with scripts, tools or other stuff.] * Embed API documentation in the source, a la Java docs, so a script can extract the parameters and description and build a dictionary. If we do this, it needs to be *mandatory* in the style guide. +1: Ken, Lars * Maybe provide a syslog.conf-like means of directing different levels of server error messages to different locations. +1: Status: * Move authentication username (Basic) out of the conn_rec and into the request_rec where it belongs. With persistent connexions, it's perfectly reasonable for multiple realms to be referenced during the life of the connexion. Even though the conn_rec field is updated on each request when the password is requested by the auth routines, it's still not a connexion-oriented quantity. +1: Ken * Abstract the '+/-' capabilities of the Options keyword so other directives can use it without re-inventing the square peg. +1: Ken Status: Ken has volunteered to work on this. * Really, really comply with 2068 (or whatever Roy says is the right document). Like handling Vary response fields properly and reliably. +1: Ken * Improve mod_include SSI handling, perhaps by caching offsets to directives. Also, clean up the conditional syntax to allow formats that bear a faint resemblance to other usages (such as allowing "=~" and "!~") in other "languages," and provide for caseless matches. +1: Roy, Ken, Martin, Lars Martin sez: I've been thinking about replacing the parser by a recursive descent parser which would reduce complexity tremendously. * Apache reusable code library, wherein we can put some of the stuff developed during the HTTP project that would be useful elsewhere. We've got a start on this with libap, but it would be really cool to have things like the arrays, tables, pools, and related primitives moved into a library of which httpd is just a client and other things can be too. +1: Roy, Paul, Jim, Ken, Ralf, Martin, Lars * Replace the current Unix compilation model (Configuration.tmpl, home-brew Configure script) with the "autoconf toolset". +1: Brian, Roy, Dean, Ralf, Martin * Investigate replacing the current Unix compilation model (Configuration.tmpl home-brew Configure script) with the "autoconf toolset". (this varies from the above such that if it's shown that the "autoconf toolset" can do what we want, with less headache than what we have, then we go for it) +1: Jim, Ken, Marc, MarkC, Ben, Paul, Martin, Lars * The "autoconf toolset" should include all three: autoconf, automake, and libtool. +1: Brian, Jim, Roy, Dean, Ken, Ralf, Martin +0: Lars * Whatever we do regarding autoconf, we should be able to configure to build objects other than in the source tree. autoconf allows for this... you can do "mkdir obj; cd obj; ../configure". This is great for multiple platforms... or even on a single platform, one copy with profiling another without. (There are a lot of possibilities: creating shadow trees, VPATH-style Makefile settings, etc.) +1: Dean, Roy, Paul, Ralf, Martin, Lars * One of the main restrictions on Apache has been that we must assume a very low-level common denominator for the OSs out there. For example, Configure is always being derided as crappy, but it is restricted, by long tradition and common sense, to only use those capabilities that existed in the System 7 'sh' (eg: no function, etc...). One possible key to Apache's success is that it does not require any more than basic UNIX tools (and an ANSI C compiler) to build, compile and run. Many of the ideas floating around for 2.0 would, by default, (drastically) change this. Is this a good idea? [Roy: That overstates most of the changes proposed so far. In any case, older systems will continue to be supported by older versions of Apache -- it is not desirable to dull the cutting edge just so people nowhere near the cutting edge won't get cut.] FEATURE SET FOR 2.0 Here, we decide how many of the following feature ideas we will set for ourselves as work items for 2.0. We can't do everything we would want to, otherwise 2.0 will never be released. So please try and be conservative with your votes. Items in no particular order. Feel free to add more, but try not to duplicate earlier items too much. [Roy: The amount of time it will take to complete 2.0 will have very little to do with how much change is attempted --- it depends only on how many people can change things simultaneously, and thus many suggested changes will actually speed-up the overall schedule if they can help parallelize development or simplify the core code.] * multithreading. +1: Brian, Ken, Jim, Paul, Sameer, Marc, Ralf, MarkC, Ben, Martin, Roy, Lars o Thread Abstraction +1: Sameer, Marc, MarkC, Ben, Dean, Paul, Martin, Roy, Ralf Status: nobody has volunteered yet * revamped process model (Dean's proposal) Dean says: it's hard to do the multithreading work cleanly without considering a bunch of this +1: MarkC, Paul, Dean, Martin, Roy, Ralf, Lars Marc (+1 on much of it; threads aren't enough for perf.), Status: nobody has volunteered yet * new layered I/O. +1: Brian, Ken, Dean, Jim, Paul, Sameer, Marc, Ralf, MarkC, Ben, Roy, Lars Status: Ken has volunteered. o sfio_1998 <http://www.research.att.com/sw/tools/sfio/> Dean says it's not threadsafe. Specifically these need to be fixed: - sfprints.c has a "static Sfio_t *f" which would need to be made an auto for thread safety - sfcvt.c has a "static char *Buf"... needs to have similar change that we did to the cvt foo in apache - sftmp.c has a few statics... probably best to just lock in here - sfpopen.c has a couple statics that need initializing once - sfexit.c needs a few locks - sfmode.c Sfrsrv pool of buffers needs to be locked These can just be avoided: - the Stdio_b interface has a bunch of statics - the sfdcdos example discipline has a static There could be more... that was just a quick look around. But the perl folks seem to be using sfio, so they may have already looked into the threading issues. Also, the layering only provides for four primitives: read, write, seek, except (an exception mechanism). I kind of like NSPR's approach which has all the socket primitives in the list as well. It's also lacking the timeout parameters, because it wasn't specifically designed to deal with sockets like NSPR was. Roy talked to the authors (Glenn Fowler, David Korn, and Kiem-Phong Vo) at AT&T Research when he gave an Apache talk there in October. We might be able to get one of them to participate, or at least get answers to tough questions. o bstdio This was written by Chris Provenzano as part of his implementation of Posix threads. o page flipping friendly, page-sized buffer oriented, zero copy I/O (In this model there are functions like readbuf() which return a pointer to a buffer, rather than taking a pointer to a buffer. This is a lot like how kernels actually work. The advantage is that you can get zero-copy in the user space, which is a big win for caching modules of all sorts. You can also support the "traditional" slow style of stdio, which adds an extra user space copy.) [Martin: Is there some software flying around where such a model has been tried? Or is it a totally new technique?] [Roy: I did this type of buffer streams for libwww-ada95. The only problem is reclaiming buffers so that a large SSI won't suck up all available memory just sending it out the pipe.] +1: Dean, Marc, Ben, Paul, Martin, Roy +0: Jim [what about examples? Portability concerns?], Ralf, Lars o NSPR: Sameer thinks that we should evaluate NSPR (ns/nspr in the Mozilla source tree) and determine whether or not it sucks and decide if we can integrate it. It appears to me, from reading the NPL, that including NSPR in Apache 2.0 is legit. Vote +1 if you like NSPR, and want to use it. +1: +0: Sameer, Lars * API work o radically revamped API [Roy: presumably there is a goal in mind here?] +1: Ken, Lars Status: Ken has volunteered. o documented API [mom and apple pie] +1: Ken, Sameer, Marc, Ralf, Paul, Dean, Martin, Jim, Roy, Lars Status: Ken has volunteered. o just new API phases +1: Brian, Jim, Sameer (just the "gaping holes"), Ralf (especially url2url and file2file in addition to url2file) -1: Roy [that is what 1.4 would be like], Lars Status: Ken has volunteered o change API 'phase' model to use module-registered hooks rather than a fixed static structure +1: Ken, Ralf, MarkC, Paul, Dean, Roy, Martin +0: Lars Status: Ken has volunteered o use virtual functions for module hooks +1: Ben -1: Paul, Roy [would require two APIs] o clearly identify API functions by renaming them +1: Ken, Ralf, Ben, Paul (plus back compat.), Dean, Jim, Roy, Martin Status: Ken has volunteered [Roy: looks like it is already in 1.3] o backward compatibility with 1.3 (just require a recompile) if functions get renamed, old names retained as wrappers +1: Paul, Sameer, Marc, MarkC -1: Roy, Ralf, Martin, Lars o make API call syntax rational (e.g., all r*() routines list r as their first argument, et cetera) +1: Ken +0: Ralf, Paul, Dean, Martin, Roy, Lars Status: Ken has volunteered o abstract module layering for plugins (e.g., a mod_auth interface into which mod_auth_mumble modules can be plugged) +1: Ken, Martin, Ralf +0: Roy [needs more detailed proposal], Lars Status: Ken has volunteered * new configuration language +1: Dean, Marc, Ben, Martin, Roy, Lars +0: Ralf, Paul Status: Ken has volunteered, as has Ryan Bloom <aaron91@example.net> o use XML +0: Roy, Ralf * rewrite in C++ +1: Ben, Martin +0: Marc, Ralf, Lars -1: MarkC, Paul, Roy, Ken * make everything C++ friendly +1: Roy, Paul, Ken, Ralf, Martin, Lars Status: nobody has volunteered yet ("that damned pool decl" is fixed now) * Proxy enhancements (or drop proxy altogether?) for HTTP/1.1 and better ftp proxy Auth handling +1: Martin, Lars [we need at least a mini-proxy for things like reverse-proxying etc.] Closed issues: From aaron91@example.net Mon Feb 01 09:55:12 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 9043 invoked by uid 6000); 1 Feb 1999 09:55:11 -0000 Received: (qmail 9029 invoked from network); 1 Feb 1999 09:55:09 -0000 Received: from i.meepzor.com (HELO Mail.MeepZor.Com) (aaron91@example.net) by taz.hyperreal.org with SMTP; 1 Feb 1999 09:55:09 -0000 Received: (from cvs@localhost) by Mail.MeepZor.Com (8.8.5/8.8.5) id XAA08469; Sun, 31 Jan 1999 23:45:53 -0500 Date: Sun, 31 Jan 1999 23:45:53 -0500 Message-Id: <aaron91@example.net> From: Rodent of Unusual Size <aaron91@example.net> To: Apache HTTP developers <aaron91@example.net> Subject: [STATUS] (apache-apr) Sun Jan 31 23:45:49 EST 1999 X-Note: This is an automated message. Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net Apache Portable Runtime STATUS: Last modified at [$Date: 1999/01/26 20:28:30 $] Release: 0.1 : In pre-alpha development Plan: Everyone discuss and wrangle out the issues on new-httpd, and commit changes as appropriate. Showstoppers: Committed Code Changes: . docs/ directory created and initial function pre-spec added . include/ directory created and start of APRStatus macros added . pthreads/ directory tree created and populated with latest work on Apache 1.3.5-dev port to pthreads inserted Available Patches: In progress: Accept Serialization Implemented as a blocking queue. 1 accept thread passes connection to queue (size of queue is config directive, default # of threads). All other threads block on queue. Signal Handling Investigate signal handling in Apache-pthreads. Currently, we kill the process when we encounter SIGPIPE, obviously bad. Modules Ensure thread safety. Does not include mod_proxy. Everything Needs patch: Open issues: * Whether every APR routine should return a status code * What the status codes should look like * Various modules aren't pthreads-ready (mod_cgi) * Bringing in the libap stuff * Mod_proxy * Timeouts. (only soft timeouts) * Check misc thread safety. Make sure UNIX code path mirrors NT path. * Process/Thread hybridization * put monitor process back into place. Was removed for initial port, it's time we make sure the server is running, and if not, start it again. * Optimize Optimize Optimize FEATURE SET FOR APR Closed issues: From aaron91@example.net Mon Feb 01 10:48:15 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 1822 invoked by uid 6000); 1 Feb 1999 10:48:12 -0000 Received: (qmail 1811 invoked from network); 1 Feb 1999 10:48:10 -0000 Received: from deimos.worldonline.nl (83.161.120.155) by taz.hyperreal.org with SMTP; 1 Feb 1999 10:48:10 -0000 Received: from shell.worldonline.nl (aaron91@example.net [83.161.120.155]) by deimos.worldonline.nl (8.8.5/8.8.5) with SMTP id LAA16836 for <aaron91@example.net>; Mon, 1 Feb 1999 11:48:05 +0100 (MET) Date: Mon, 1 Feb 1999 11:50:11 +0100 (MET) From: "R.J. Kraaij" <aaron91@example.net> To: Apache HTTP developers <aaron91@example.net> Subject: [ apache on win32 Service /network shares] In-Reply-To: <aaron91@example.net> Message-ID: <aaron91@example.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net Hi, this is my first post here, so if i'm doing something wrong, Please Tell it me personally :o) > * who should run the service? Who exactly is the "system account"? > That _really_ sucks. Can we recommend running Apache as some > other user? The Service uses it accounts it's running on to Hand it over to called devices. However there are expection. For instance, Pathworks On NT. When having a user logged into the system and having a drive mapped, the service is capable of access the drive by using the users credits.. This is one of the leaks i personaly experimented. Microsoft iis3 is also vurnerable for this leak. infact, we have been using this trick ourself, to let us access certain shares with permission problems... So _high_ care should be taken when logging into a system where a Webserver is running. be sure your not using a rare networkmapping Client. because, then, a user, with access to any server scripting, could, Theoritically (and practilly, tested by myself) access Your mapped Network devices using _your_ account. (just by doing a openfile on your Mappedletter:\Drive\ this does not count for smb network shares. ---- Background of author: I'm Running 5 Intranet webservers on IIS, And an Internet-Apache-Module-Chatserver. -- Reinder Kraaij From aaron91@example.net Mon Feb 01 12:37:26 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 26111 invoked by uid 6000); 1 Feb 1999 12:37:23 -0000 Received: (qmail 26104 invoked from network); 1 Feb 1999 12:37:22 -0000 Received: from svpal.svpal.org (aaron91@example.net) by taz.hyperreal.org with SMTP; 1 Feb 1999 12:37:22 -0000 Received: from localhost (gstein@localhost) by svpal.svpal.org (8.9.0/8.9.0) with SMTP id EAA17451 for <aaron91@example.net>; Mon, 1 Feb 1999 04:35:38 -0800 (PST) X-Authentication-Warning: svpal.svpal.org: gstein owned process doing -bs Date: Mon, 1 Feb 1999 04:35:37 -0800 (PST) From: Greg Stein <aaron91@example.net> X-Sender: aaron91@example.net To: Apache HTTP developers <aaron91@example.net> Subject: Re: [STATUS] (apache-1.3) Sun Jan 31 23:45:15 EST 1999 In-Reply-To: <aaron91@example.net> Message-ID: <aaron91@example.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net On Sun, 31 Jan 1999, Rodent of Unusual Size wrote: > * A mechanism is needed for applying access control to methods > that are not known by the server core, either using a Limit __unknown__ > as in <<8B57882C41A0D1118F7100805F9F68B50631A7B2@RED-MSG-45>, > or via a LimitExcept directive. I'd like to reiterate a request for this functionality :-) I received a patch tonite for mod_dav that begins some work on additional DAV functionality using the SEARCH method. While 1.3.4 works great for the base DAV methods, it is back to square one for the new methods (such as SEARCH). thx! -g -- Greg Stein, http://www.lyra.org/ From aaron91@example.net Mon Feb 01 12:53:30 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 28851 invoked by uid 6000); 1 Feb 1999 12:53:30 -0000 Received: (qmail 28835 invoked from network); 1 Feb 1999 12:53:28 -0000 Received: from fwns2d.raleigh.ibm.com (HELO fwns2.raleigh.ibm.com) (83.161.120.155) by taz.hyperreal.org with SMTP; 1 Feb 1999 12:53:28 -0000 Received: from rtpmail02.raleigh.ibm.com (rtpmail02.raleigh.ibm.com [83.161.120.155]) by fwns2.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id HAA30378 for <aaron91@example.net>; Mon, 1 Feb 1999 07:53:22 -0500 Received: from raleigh.ibm.com (wgs.raleigh.ibm.com [83.161.120.155]) by rtpmail02.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with ESMTP id HAA30272 for <aaron91@example.net>; Mon, 1 Feb 1999 07:53:22 -0500 Message-ID: <aaron91@example.net> Date: Mon, 01 Feb 1999 07:53:22 -0500 From: Bill Stoddard <aaron91@example.net> X-Mailer: Mozilla 4.05 [en] (X11; I; AIX 4.2) MIME-Version: 1.0 To: aaron91@example.net Subject: Re: [NT] errors from -i or -u References: <aaron91@example.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net Paul Sutton wrote: > > Apache can installs itself as a service with the -i option. It can > uninstall itself with -u. This is infact the only way of installing and > removing the Apache service (there is no other way that I know of for > creating and removing services in general). +1 Can still do really silly things like apache -i -X. Probably not worth worrying about the patho cases though. -- Bill Stoddard aaron91@example.net From aaron91@example.net Mon Feb 01 15:33:32 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 15116 invoked by uid 6000); 1 Feb 1999 15:33:29 -0000 Received: (qmail 15109 invoked from network); 1 Feb 1999 15:33:28 -0000 Received: from fwns2d.raleigh.ibm.com (HELO fwns2.raleigh.ibm.com) (83.161.120.155) by taz.hyperreal.org with SMTP; 1 Feb 1999 15:33:28 -0000 Received: from rtpmail01.raleigh.ibm.com (rtpmail01.raleigh.ibm.com [83.161.120.155]) by fwns2.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id KAA24500 for <aaron91@example.net>; Mon, 1 Feb 1999 10:33:25 -0500 Received: from wolfpad (wolfpad.raleigh.ibm.com [83.161.120.155]) by rtpmail01.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with SMTP id KAA03684 for <aaron91@example.net>; Mon, 1 Feb 1999 10:33:26 -0500 From: "Ken Parzygnat" <aaron91@example.net> To: <aaron91@example.net> Subject: RE: Problem with <Directory proxy:*> and ap_os_canonical_filename() Date: Mon, 1 Feb 1999 10:30:11 -0500 Message-ID: <aaron91@example.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <aaron91@example.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Importance: Normal Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net > > I'm now starting to think that the correct behaviour in the case of an > invalid name is to just return it unchanged. If it's actually used to try to > open a file later it will fail at that point. Yes. This is basically the same attitude I took with the Win32 version of ap_ocf. It's whole intent is to get the passed in string into some "expected format" without regard to validating the name. So really, the Win32 verion will convert '\' to '/', and strlwr the string and that's it. There is also some code in to handle some Win32isms like trailing '.'s and long name alias's, but overall the idea is to keep it simple. - - - - - - - - - - - - - - - - - - Ken Parzygnat email: aaron91@example.net From aaron91@example.net Mon Feb 01 15:41:40 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 19157 invoked by uid 6000); 1 Feb 1999 15:41:39 -0000 Received: (qmail 19124 invoked from network); 1 Feb 1999 15:41:38 -0000 Received: from server.noc.demon.net (aaron91@example.net) by taz.hyperreal.org with SMTP; 1 Feb 1999 15:41:38 -0000 Received: by server.noc.demon.net; id PAA14401; Mon, 1 Feb 1999 15:41:36 GMT Received: from fanf.noc.demon.net(83.161.120.155) by inside.noc.demon.net via smap (3.2) id xma014386; Mon, 1 Feb 99 15:41:20 GMT Received: from fanf by fanf.noc.demon.net with local (Exim 1.73 #2) id 107LTU-0005ap-00; Mon, 1 Feb 1999 15:41:20 +0000 To: aaron91@example.net From: Tony Finch <aaron91@example.net> Subject: [PATCH] <LimitExcept>, was Re: [STATUS] (apache-1.3) Sun Jan 31 23:45:15 EST 1999 In-Reply-To: <aaron91@example.net> References: <aaron91@example.net> Message-Id: <aaron91@example.net> Date: Mon, 1 Feb 1999 15:41:20 +0000 Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net Greg Stein <aaron91@example.net> wrote: >On Sun, 31 Jan 1999, Rodent of Unusual Size wrote: >> * A mechanism is needed for applying access control to methods >> that are not known by the server core, either using a Limit __unknown__ >> as in <<8B57882C41A0D1118F7100805F9F68B50631A7B2@RED-MSG-45>, >> or via a LimitExcept directive. > >I'd like to reiterate a request for this functionality :-) Here's a patch providing <LimitExcept> that seems to work. I dislike the idea of <Limit __unknown__> for a whole lot of fairly ill-defined reasons. One point is that allowing what you know is OK is more secure than disallowing what you know isn't OK. (I shan't mention the name of a security-sensitive web application that by default uses <Limit GET POST> when it shouldn't use a <Limit> aaron91@example.net.) Tony. -- f.a.n.finch aaron91@example.net aaron91@example.net --- src/main/http_core.c.old Tue Jan 12 16:26:52 1999 +++ src/main/http_core.c.limitexcept Mon Feb 1 14:56:58 1999 @@ -1087,8 +1087,8 @@ return err; } - /* XXX: NB: Currently, we have no way of checking - * whether <Limit> sections are closed properly. + /* XXX: NB: Currently, we have no way of checking whether + * <Limit> or <LimitExcept> sections are closed properly. * (If we would add a srm_command_loop() here we might...) */ @@ -1112,10 +1112,43 @@ return NULL; } +static const char *ap_limit_except(cmd_parms *cmd, void *dummy, + const char *arg) +{ + const char *limited_methods = ap_getword(cmd->pool, &arg, '>'); + int limited; + + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); + if (err != NULL) { + return err; + } + + /* XXX: NB: see the comment in ap_limit_section. */ + + /* initially limit everything except TRACE */ + limited = ~(1 << M_TRACE); + + while (limited_methods[0]) { + char *method = ap_getword_conf(cmd->pool, &limited_methods); + int methnum = ap_method_number_of(method); + + if (methnum == M_INVALID) { + return ap_pstrcat(cmd->pool, "unknown method \"", + method, "\" in <LimitExcept>", NULL); + } + else { + limited &= ~(1 << methnum); + } + } + + cmd->limited = limited; + return NULL; +} + static const char *endlimit_section(cmd_parms *cmd, void *dummy, void *dummy2) { if (cmd->limited == -1) { - return "</Limit> unexpected"; + return "</Limit> or </LimitExcept> unexpected"; } cmd->limited = -1; @@ -2515,7 +2548,12 @@ { "<Limit", ap_limit_section, NULL, OR_ALL, RAW_ARGS, "Container for " "authentication directives when accessed using specified HTTP methods" }, { "</Limit>", endlimit_section, NULL, OR_ALL, NO_ARGS, - "Marks end of <Limit>" }, + "Marks end of <Limit>" }, /* or <LimitExcept> */ +{ "<LimitExcept", ap_limit_except, NULL, OR_ALL, RAW_ARGS, "Container for " + "authentication directives when accessed using other than the specified " + "HTTP methods" }, +{ "</LimitExcept>", endlimit_section, NULL, OR_ALL, NO_ARGS, + "Marks end of <LimitExcept>" }, /* actually a synonym for </Limit> */ { "<IfModule", start_ifmod, NULL, OR_ALL, TAKE1, "Container for directives based on existance of specified modules" }, { end_ifmodule_section, end_ifmod, NULL, OR_ALL, NO_ARGS, --- htdocs/manual/mod/core.html Tue Jan 12 16:02:48 1999 +++ htdocs/manual/mod/core.html.limitexcept Mon Feb 1 15:34:46 1999 @@ -55,6 +55,7 @@ <LI><A HREF="#keepalive">KeepAlive</A> <LI><A HREF="#keepalivetimeout">KeepAliveTimeout</A> <LI><A HREF="#limit">&lt;Limit&gt;</A> +<LI><A HREF="#limitexcept">&lt;LimitExcept&gt;</A> <LI><A HREF="#limitrequestbody">LimitRequestBody</A> <LI><A HREF="#limitrequestfields">LimitRequestFields</A> <LI><A HREF="#limitrequestfieldsize">LimitRequestFieldsize</A> @@ -664,7 +665,8 @@ The directory sections typically occur in the access.conf file, but they may appear in any configuration file. &lt;Directory&gt; directives cannot -nest, and cannot appear in a <A HREF="#limit">&lt;Limit&gt;</A> section. +nest, and cannot appear in a <A HREF="#limit">&lt;Limit&gt;</A> or +<A HREF="#limitexcept">&lt;LimitExcept&gt;</A> section. <P> <STRONG>See also</STRONG>: <A HREF="../sections.html">How Directory, @@ -1337,6 +1339,30 @@ If GET is used it will also restrict HEAD requests. <STRONG>If you wish to limit all methods, do not include any &lt;Limit&gt; aaron91@example.net.</STRONG> + +<P><HR> + +<H2><A NAME="limitexcept">&lt;LimitExcept&gt; directive</A></H2> +<!--%plaintext &lt;?INDEX {\tt LimitExcept} section directive&gt; --> +<A + HREF="directive-dict.html#Syntax" + REL="Help" +><STRONG>Syntax:</STRONG></A> + &lt;LimitExcept <EM>method method</EM> ... &gt; ... &lt;/Limit&gt;<BR> +<A + HREF="directive-dict.html#Context" + REL="Help" +><STRONG>Context:</STRONG></A> any<BR> +<A + HREF="directive-dict.html#Status" + REL="Help" +><STRONG>Status:</STRONG></A> core<P> + +&lt;LimitExcept&gt; and &lt;/LimitExcept&gt; are used to enclose a group of +access control directives which will then apply to any access method +<STRONG>not</STRONG> listed in the arguments, i.e. it is the opposite of a +<A HREF="#limit">&lt;Limit&gt;</A> section. See the documentation for +<A HREF="#limit">&lt;Limit&gt;</A> for more details. <P><HR> From aaron91@example.net Mon Feb 01 15:54:02 1999 Return-Path: <aaron91@example.net> Delivered-To: aaron91@example.net Received: (qmail 25898 invoked by uid 6000); 1 Feb 1999 15:54:01 -0000 Received: (qmail 25889 invoked from network); 1 Feb 1999 15:53:59 -0000 Received: from fwns1d.raleigh.ibm.com (HELO fwns1.raleigh.ibm.com) (83.161.120.155) by taz.hyperreal.org with SMTP; 1 Feb 1999 15:53:59 -0000 Received: from rtpmail03.raleigh.ibm.com (rtpmail03.raleigh.ibm.com [83.161.120.155]) by fwns1.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id KAA23000 for <aaron91@example.net>; Mon, 1 Feb 1999 10:53:56 -0500 Received: from raleigh.ibm.com (sashimi.raleigh.ibm.com [83.161.120.155]) by rtpmail03.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with ESMTP id KAA22242 for <aaron91@example.net>; Mon, 1 Feb 1999 10:53:56 -0500 Message-ID: <aaron91@example.net> Date: Mon, 01 Feb 1999 10:57:56 -0500 From: Bill Stoddard <aaron91@example.net> X-Mailer: Mozilla 4.06 [en] (WinNT; U) MIME-Version: 1.0 To: aaron91@example.net Subject: [PATCH] Win32 Script Interpreter Source Content-Type: multipart/mixed; boundary="------------45189F2D18726E532B0913FA" Sender: aaron91@example.net Precedence: bulk Reply-To: aaron91@example.net This is a multi-part message in MIME format. --------------45189F2D18726E532B0913FA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This patch introduces a new Win32 specifc config. directive to direct Apache to optionally search the Win32 registry for the interpreter to run scripts with. The default is to peek the shebang (!#) line at the beginning of the script. The directive is: Win32InterpreterSource It takes a single argument, either "registry" or "shebang" (unquoted, of course). ap_call_exec() in the Win32 path has been simplified and cleaned up a bit. If a registry search fails, the code will peek the shebang (and issue an informational message that the registry search failed). I have a couple of ideas on how to make 16-bit CGI's work; all are hacks and are not included with this patch. I'm inclined to say we just don't support them. I'm looking for comments and suggestions. Thanks, Bill Stoddard aaron91@example.net --------------45189F2D18726E532B0913FA Content-Type: text/plain; charset=us-ascii; name="registry.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="registry.patch" Index: include/http_core.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_core.h,v retrieving revision 1.52 diff -u -r1.52 http_core.h --- http_core.h 1999/01/01 19:04:40 1.52 +++ http_core.h 1999/01/30 16:20:17 @@ -152,6 +152,16 @@ API_EXPORT(int) ap_satisfies (request_rec *r); API_EXPORT(const array_header *) ap_requires (request_rec *); +#ifdef WIN32 +/* + * CGI Script stuff for Win32... + */ +typedef enum { FileTypeUNKNOWN, FileTypeBIN, FileTypeEXE, FileTypeSCRIPT } file_type_e; +typedef enum { INTERPRETER_SOURCE_UNSET, INTERPRETER_SOURCE_REGISTRY, + INTERPRETER_SOURCE_SHEBANG } interpreter_source_e; +API_EXPORT(file_type_e) ap_get_win32_interpreter(const request_rec *, char*, char **); +#endif + #ifdef CORE_PRIVATE /* @@ -248,6 +258,11 @@ array_header *sec; regex_t *r; +#ifdef WIN32 + /* Where to find interpreter to run scripts */ + interpreter_source_e script_interpreter_source; +#endif + } core_dir_config; /* Per-server core configuration */ Index: main/http_core.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.244 diff -u -r1.244 http_core.c --- http_core.c 1999/01/07 20:46:58 1.244 +++ http_core.c 1999/01/30 16:21:07 @@ -145,7 +145,9 @@ conf->limit_req_body = 0; conf->sec = ap_make_array(a, 2, sizeof(void *)); - +#ifdef WIN32 + conf->script_interpreter_source = INTERPRETER_SOURCE_UNSET; +#endif return (void *)conf; } @@ -262,6 +264,13 @@ if (new->satisfy != SATISFY_NOSPEC) { conf->satisfy = new->satisfy; } + +#ifdef WIN32 + if (new->script_interpreter_source != INTERPRETER_SOURCE_UNSET) { + conf->script_interpreter_source = new->script_interpreter_source; + } +#endif + return (void*)conf; } @@ -725,6 +734,176 @@ return d->limit_req_body; } +#ifdef WIN32 +static char* get_interpreter_from_win32_registry(pool *p, const char* ext) +{ + char extension_path[] = "SOFTWARE\\Classes\\"; + char executable_path[] = "\\SHELL\\OPEN\\COMMAND"; + + HKEY hkeyOpen; + DWORD type; + int size; + int result; + char *keyName; + char *buffer; + char *s; + + if (!ext) + return NULL; + /* + * Future optimization: + * When the registry is successfully searched, store the interpreter + * string in a table to make subsequent look-ups faster + */ + + /* Open the key associated with the script extension */ + keyName = ap_pstrcat(p, extension_path, ext, NULL); + + result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_QUERY_VALUE, + &hkeyOpen); + + if (result != ERROR_SUCCESS) + return NULL; + + /* Read to NULL buffer to find value size */ + size = 0; + result = RegQueryValueEx(hkeyOpen, "", NULL, &type, NULL, &size); + + if (result == ERROR_SUCCESS) { + buffer = ap_palloc(p, size); + result = RegQueryValueEx(hkeyOpen, "", NULL, &type, buffer, &size); + } + + RegCloseKey(hkeyOpen); + + if (result != ERROR_SUCCESS) + return NULL; + + /* Open the key associated with the interpreter path */ + keyName = ap_pstrcat(p, extension_path, buffer, executable_path, NULL); + + result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_QUERY_VALUE, + &hkeyOpen); + + if (result != ERROR_SUCCESS) + return NULL; + + /* Read to NULL buffer to find value size */ + size = 0; + result = RegQueryValueEx(hkeyOpen, "", 0, &type, NULL, &size); + + if (result == ERROR_SUCCESS) { + buffer = ap_palloc(p, size); + result = RegQueryValueEx(hkeyOpen, "", 0, &type, buffer, &size); + } + + RegCloseKey(hkeyOpen); + + if (result != ERROR_SUCCESS) + return NULL; + + /* + * The canonical way shell command entries are entered in the Win32 + * registry is as follows: + * shell [options] "%1" + * where + * shell - full path name to interpreter or shell to run. + * E.g., c:\usr\local\ntreskit\perl\bin\perl.exe + * options - optional switches + * E.g., \C + * "%1" - Place holder for file to run the shell against. + * Typically quoted. + * + * If we find a %1 or a quoted %1, lop it off. + */ + if (buffer && *buffer) { + if ((s = strstr(buffer, "\"%1"))) + *s = '\0'; + else if ((s = strstr(buffer, "%1"))) + *s = '\0'; + } + + return buffer; +} + +API_EXPORT (file_type_e) ap_get_win32_interpreter(const request_rec *r, + char* ext, + char** interpreter ) +{ + HANDLE hFile; + DWORD nBytesRead; + BOOLEAN bResult; + char buffer[1024]; + core_dir_config *d; + file_type_e fileType = FileTypeUNKNOWN; + int i; + + d = (core_dir_config *)ap_get_module_config(r->per_dir_config, + &core_module); + + if (d->script_interpreter_source == INTERPRETER_SOURCE_REGISTRY) { + /* + * Check the registry + */ + *interpreter = get_interpreter_from_win32_registry(r->pool, ext); + if (*interpreter) + return FileTypeSCRIPT; + else { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, + r->server, + "Win32InterpreterSource config directive set to \"registry\".\n\t" + "Registry was searched but interpreter not found. Trying the shebang line."); + } + } + + /* + * Look for a #! line in the script + */ + hFile = CreateFile(r->filename, GENERIC_READ, + FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + + if (hFile == INVALID_HANDLE_VALUE) { + return FileTypeUNKNOWN; + } + + bResult = ReadFile(hFile, (void*) &buffer, sizeof(buffer), + &nBytesRead, NULL); + if (!bResult || (nBytesRead == 0)) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, r, + "ReadFile(%s) failed", r->filename); + CloseHandle(hFile); + return (FileTypeUNKNOWN); + } + CloseHandle(hFile); + + buffer[nBytesRead] = '\0'; + + if ((buffer[0] == '#') && (buffer[1] == '!')) { + fileType = FileTypeSCRIPT; + for (i = 2; i < sizeof(buffer); i++) { + if ((buffer[i] == '\r') + || (buffer[i] == '\n')) { + break; + } + } + buffer[i] = '\0'; + for (i = 2; buffer[i] == ' '; ++i) + ; + *interpreter = ap_pstrdup(r->pool, buffer + i ); + } + else { + /* Check to see if it's a executable */ + IMAGE_DOS_HEADER *hdr = (IMAGE_DOS_HEADER*)interpreter; + if (hdr->e_magic == IMAGE_DOS_SIGNATURE && hdr->e_cblp < 512) { + fileType = FileTypeEXE; + } + } + + return fileType; +} +#endif + /***************************************************************** * * Commands... this module handles almost all of the NCSA httpd.conf @@ -2452,6 +2631,19 @@ return NULL; } +static const char *set_interpreter_source(cmd_parms *cmd, core_dir_config *d, + char *arg) +{ + if (!strcasecmp(arg, "registry")) { + d->script_interpreter_source = INTERPRETER_SOURCE_REGISTRY; + } else if (!strcasecmp(arg, "shebang")) { + d->script_interpreter_source = INTERPRETER_SOURCE_SHEBANG; + } else { + d->script_interpreter_source = INTERPRETER_SOURCE_SHEBANG; + } + return NULL; +} + /* Note --- ErrorDocument will now work from .htaccess files. * The AllowOverride of Fileinfo allows webmasters to turn it off */ @@ -2668,6 +2860,8 @@ (void*)XtOffsetOf(core_dir_config, limit_req_body), OR_ALL, TAKE1, "Limit (in bytes) on maximum size of request message body" }, +{ "Win32InterpreterSource", set_interpreter_source, NULL, OR_FILEINFO, TAKE1, + "Where to find interpreter to run Win32 scripts (Registry or script shebang line)" }, { NULL }, }; Index: main/util_script.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_script.c,v retrieving revision 1.137 diff -u -r1.137 util_script.c --- util_script.c 1999/01/01 19:04:54 1.137 +++ util_script.c 1999/01/30 16:21:40 @@ -820,31 +820,31 @@ } #elif defined(WIN32) { - /* Adapted from Alec Kloss' work for OS/2 */ - int is_script = 0; - int is_binary = 0; - char interpreter[2048]; /* hope it's enough for the interpreter path */ - FILE *program; - int i, sz; - char *dot; - char *exename; + /* Adapted from Alec Kloss' work for OS/2 */ + char *interpreter = NULL; + char *arguments = NULL; + char *ext = NULL; + char *exename = NULL; + char *s = NULL; char *quoted_filename; - int is_exe = 0; - STARTUPINFO si; - PROCESS_INFORMATION pi; char *pCommand; char *pEnvBlock, *pNext; + + int i; int iEnvBlockLen; + + file_type_e fileType; - memset(&si, 0, sizeof(si)); - memset(&pi, 0, sizeof(pi)); + STARTUPINFO si; + PROCESS_INFORMATION pi; - interpreter[0] = 0; - pid = -1; + memset(&si, 0, sizeof(si)); + memset(&pi, 0, sizeof(pi)); - quoted_filename = ap_pstrcat(r->pool, "\"", r->filename, "\"", NULL); + pid = -1; if (!shellcmd) { + /* Find the file name */ exename = strrchr(r->filename, '/'); if (!exename) { exename = strrchr(r->filename, '\\'); @@ -855,66 +855,88 @@ else { exename++; } - dot = strrchr(exename, '.'); - if (dot) {
{'source': 'Apache Software Foundation Public Mail Archives'}