{5} Assigned, Active Tickets by Owner (Full Description) (124 matches)

List tickets assigned, group by ticket owner. This report demonstrates the use of full-row display.

apiskors

Ticket Summary Component Milestone Type Created
Description
#232 ns_logroll fails w/ 'Permission denied' on Windows XP Architecture: Win32-specific Bugs 07/19/04
On Windows XP with AOLserver 4.0.7, rolling either the
access or the server log fails with:

  Error: rollfile: failed to rename file ... to ...:
'Permission denied'

Everything is running as the Windows user "Andy", who
also has Admin privileges.

So I experimented with ns_logroll.  I thought this was
Windows brain-damage where it's refusing to rename a
file that's open and still in use.  And in fact, the
server log IS still in use when it gets renamed.

So I hacked up LogReOpen() to stash the server log file
descriptor in a atp_server_log_fd global variable, and
I changed Ns_LogRoll() to get that fd and close() it
BEFORE calling Ns_RollFile().  To my surprise, after
this change I STILL got the 'Permission denied' error
on the rename in Ns_RollFile().

Yet now, I ALSO get the additional "logging disabled:
write() failed" error below, due to adding that close():

  Notice: log: Closing server log now, fd: '3'
  Notice: Ns_RollFile:atp:1
  Notice: Ns_RollFile:atp:2
  Notice: Ns_RollFile:  Calling Rename()
now.[19/Jul/2004:21:47:33][1304.656][-conn:ddsbb-dev-win::0]
Error: rollfile: failed to rename file
'z:/src/aol4-src/nsbbapi/log/ddsbb-dev-win-error.log'
to
'z:/src/aol4-src/nsbbapi/log/ddsbb-dev-win-error.log.000':
'Permission denied'
  Notice: log: re-opening log file
'z:/src/aol4-src/nsbbapi/log/ddsbb-dev-win-error.log'
  Notice: LogReOpen: atp_server_log_fd: '3'
  Error: nslog: logging disabled: write() failed: 'Bad
file descriptor'
  Error: nslog: failed to flush log: Bad file descriptor

Clearly I'm missing something there...  The call to
LogReOpen() somehow didn't do the right thing.  But
more importantly, it appears that keeping the server
log open was NOT even the problem in the first place. 
What else could the problem be?


#266 gettimeofday() is unix only Modules: nsopenssl (SSL) Bugs 10/04/04
nsopenssl uses gettimeofday() in two places, but this
function is not available on MS Windows.  Tcl also had
to deal with this problem, and has different
implementations of Tcl_GetTime() for Unix and Windows.
 Thus, I recommend that we change nsopenssl to use
Tcl_GetTime() rather than gettimeofday().


#267 ns_sendmail doesn't include a Message-ID header API: Tcl Bugs 10/10/04
ns_sendmail does not add a Message-ID header to
outgoing email.  This is annoying, as some spam
filtering software considers such emails to be spam.  I
fixed this back in 2001 for my own use, and have
forward-ported the change to AOLserver 4.0.8 now.

The fix is pretty simple, if the user did not include
his own custom Message-ID header in the extraheaders
ns_set, then ns_sendmail adds one.  The Message-ID used
is guaranteed to be globally unique under certain
circumstances, as described in the comments.

This patch will cause ns_sendmail to ALWAYS include a
Message-ID header field in outgoing email.  It would be
easy to add a config file switch to turn this on/off,
but this patch doesn't do that.

RFC 2822 has info on the messgage-id and other email
header fields:

http://www.faqs.org/rfcs/rfc2822.html

I generated the patch with:

cvs diff -w -u -r aolserver_v40_r8 tcl/sendmail.tcl >
patch-nssendmail-messageid-20041010

(Note that for simplicity I used -w to generate the
patch. sendmail.tcl has annoying whitespace problems -
trailing whitespace on otherwise blank lines, and tab
characters.  I've fixed these in my private version but
did NOT include those whitespace-only changes in this
patch.)


#298 Ns_NormalizePath() breaks //foo/bar paths on Windows API: C Bugs 03/14/05
On Windows, paths like "//foo/bar" are allowed and
sometimes necessary.  AOLserver's Ns_NormalizePath() C
function incorrectly changes that path to "/foo/bar". 
Tcl, on the other hand, does the right thing.

In AOLserver 4.0.10, the following test script gives
the following results on Windows and Linux:

   ns_return 200 text/plain " 
   [ns_normalizepath
{//unixbox/vmhome/log/mysite-win-error.log}] 
   [file normalize
{//unixbox/vmhome/log/mysite-win-error.log}] 
   " 

Run on Windows XP (bad):
 
   /unixbox/vmhome/log/mysite-win-error.log 
   //unixbox/vmhome/log/mysite-win-error.log 

Run on Linux (ok):

   /unixbox/vmhome/log/mysite-win-error.log
   /unixbox/vmhome/log/mysite-win-error.log


dossy

Ticket Summary Component Milestone Type Created
Description
#381 ns_passwordcheck inverts logic API: Tcl Bugs 05/04/01
From the documentation:

ns_passwordcheck ?-server servername? user password

Description

This function returns 1 (one) if the user and password 
combination is legitimate. It returns 0 (zero) if 
either the user does not exist or the password is 
incorrect. If no servername is specified, the current 
virtual server is used.

From the code (nsperm/compat.tcl)

# compat.tcl -

proc ns_passwordcheck { user password } {
    set ret [catch {ns_perm checkpass $user $password} 
err]
    if {$ret == 0} {
	return 0
    } else {
	return 1
    }
}

Now catch returns 0 when all is fine, and 1 when there 
is an error, and ns_perm checkpass tosses an error 
when the password is NOT correct or there the user 
does not exist.

Hence, ret will be 0 when all is fine and 
ns_passwordcheck will return a 0 when all is fine.

Either the doc or the code needs to be fixed -- I 
suggest the code.

#325 Crash in AppendConn Architecture: Server (nsd) Bugs 12/08/06
After a week+ of runtime and usually more than a million page requests, our server crashes in AppendConn(), with the following stacktrace:

#0  0x40180781 in kill () from /lib/libc.so.6
#1  0x4011ce5e in pthread_kill () from /lib/libpthread.so.0
#2  0x4011d339 in raise () from /lib/libpthread.so.0
#3  0x40181be1 in abort () from /lib/libc.so.6
#4  0x40051023 in FatalSignalHandler () from /usr/local/aolserver/lib/libnsd.so
#5  0x4011cf54 in pthread_sighandler () from /lib/libpthread.so.0
#6  0x401806b8 in sigaction () from /lib/libc.so.6
#7  0x40039d1b in AppendConn () from /usr/local/aolserver/lib/libnsd.so
#8  0x40039e61 in AppendConnList () from /usr/local/aolserver/lib/libnsd.so
#9  0x40039135 in NsTclServerObjCmd () from /usr/local/aolserver/lib/libnsd.so
#10 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#11 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#12 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#13 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#14 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#15 0x4008f637 in Tcl_EvalEx () from /usr/local/aolserver/lib/libtcl8.4.so
#16 0x4008fc18 in Tcl_EvalObjEx () from /usr/local/aolserver/lib/libtcl8.4.so
#17 0x400dfdbe in Tcl_UplevelObjCmd () from /usr/local/aolserver/lib/libtcl8.4.so
#18 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#19 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#20 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#21 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#22 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#23 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#24 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#25 0x4008fc4b in Tcl_EvalObjEx () from /usr/local/aolserver/lib/libtcl8.4.so
#26 0x40097147 in Tcl_IfObjCmd () from /usr/local/aolserver/lib/libtcl8.4.so
#27 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#28 0x4008f637 in Tcl_EvalEx () from /usr/local/aolserver/lib/libtcl8.4.so
#29 0x4008fc18 in Tcl_EvalObjEx () from /usr/local/aolserver/lib/libtcl8.4.so
#30 0x400dfdbe in Tcl_UplevelObjCmd () from /usr/local/aolserver/lib/libtcl8.4.so
#31 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#32 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#33 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#34 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#35 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#36 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#37 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#38 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#39 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#40 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#41 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#42 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#43 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#44 0x4008f637 in Tcl_EvalEx () from /usr/local/aolserver/lib/libtcl8.4.so
#45 0x4008fc18 in Tcl_EvalObjEx () from /usr/local/aolserver/lib/libtcl8.4.so
#46 0x400dfdbe in Tcl_UplevelObjCmd () from /usr/local/aolserver/lib/libtcl8.4.so
#47 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#48 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#49 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#50 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#51 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#52 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#53 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#54 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#55 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#56 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#57 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#58 0x4008fc4b in Tcl_EvalObjEx () from /usr/local/aolserver/lib/libtcl8.4.so
#59 0x40097147 in Tcl_IfObjCmd () from /usr/local/aolserver/lib/libtcl8.4.so
#60 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#61 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#62 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#63 0x4008fc4b in Tcl_EvalObjEx () from /usr/local/aolserver/lib/libtcl8.4.so
#64 0x40097147 in Tcl_IfObjCmd () from /usr/local/aolserver/lib/libtcl8.4.so
#65 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#66 0x400b23d8 in TclExecuteByteCode () from /usr/local/aolserver/lib/libtcl8.4.so
#67 0x400b18d4 in TclCompEvalObj () from /usr/local/aolserver/lib/libtcl8.4.so
#68 0x400e03e1 in TclObjInterpProc () from /usr/local/aolserver/lib/libtcl8.4.so
#69 0x4008ec64 in TclEvalObjvInternal () from /usr/local/aolserver/lib/libtcl8.4.so
#70 0x4008f637 in Tcl_EvalEx () from /usr/local/aolserver/lib/libtcl8.4.so
#71 0x4008fa11 in Tcl_Eval () from /usr/local/aolserver/lib/libtcl8.4.so
#72 0x40090fef in Tcl_GlobalEval () from /usr/local/aolserver/lib/libtcl8.4.so
#73 0x40048b29 in ProcRequest () from /usr/local/aolserver/lib/libnsd.so
#74 0x40037ff0 in Ns_ConnRunRequest () from /usr/local/aolserver/lib/libnsd.so
#75 0x40039963 in ConnRun () from /usr/local/aolserver/lib/libnsd.so
#76 0x400395cb in NsConnThread () from /usr/local/aolserver/lib/libnsd.so
#77 0x40068ce9 in NsThreadMain () from /usr/local/aolserver/lib/libnsthread.so
#78 0x4006a392 in ThreadMain () from /usr/local/aolserver/lib/libnsthread.so
#79 0x4011a0ba in pthread_start_thread () from /lib/libpthread.so.0

Build details:

> /usr/local/aolserver/bin/nsd -V
AOLserver/4.0.10 (aolserver4_0)
   CVS Tag:         $Name: aolserver_v40_r10 $
   Built:           Dec 19 2005 at 15:51:14
   Tcl version:     8.4
   Platform:        linux

As I'm unfamiliar with debugging nsd crashes, what other information can I provide to help figure out the cause?  Thanks!



#171 Support for Universal Plug and Play? None Feature Requests 08/23/03
Would you like to offer an UPnP interface to your server as a 
plugin?
http://www.upnp.org/download/UPnPDA10_20000613.htm

How 
do you think about to support this standard with a library?
- 
http://sourceforge.net/projects/cgupnpjava/
- 
http://upnp.sourceforge.net/

#147 nsvhr: zero-byte error SockWrite() Modules: nsunix/nsvhr (Virtual Hosting) Bugs 04/30/03
MarkD from borkware.com patched nsvhr for a zero-byte
error in SockWrite(). This problem prevents uploading
of binary files through nsvhr. See
http://borkware.com/rants/aolserver-vhosting/ for a
full description and patch. 

His patch for nsd/conn.c might also be of interest
although it would require a rework for AOLserver 4.

#157 nsxml 'leaks' memory None Bugs 06/05/03
nsxml as compiled for 3.x and above defers some cleanup
until the interpreter is destroyed.  Depending on
server configurations that may not happen till the
server is shutdown which results in the process growing
till it kills the server (or aolserver is restarted).

1. A call to ns_xml doc delete $id should be able to
cleanup all information related to that document.  2.
nsxml should register a per-connection based cleanup
handler (preferably through a C function instead of
evaling a TCL script w/ ns_atclose to do it).

To show that #1 is a problem you can do the following.
 Telnet into the nscp port and type the following
proc doit {doc iterations} {
    for {set x 0} {$x < $iterations} {incr x} {
        set id [ns_xml string parse xml $doc]
        ns_xml doc delete $id
    }
}
doit "<foo>bar</foo>" 1000000

Even though in theory it deletes everything right after
making it, memory on my machine increases at about 1MB
every 5 seconds while running that.

Furthermore if you execute it again, it will leak more
- but if you exit the nscp, then telnet back into it
and re-execute it the same number of times, memory
usage will _not_ increase.  That's because in the case
of nscp logging out destroyes the interpreter so the
cleaup handlers run - that doesn't happen for web pages.

Temporary fix:
   The patch enclosed will get rid of the special
handling for aolserver 3.x+ and treat everything as it
did under 2.x which registers a per-connection cleanup
by evaluating a tcl script that executes ns_atclose. 
This seems to successfully work around the problem.



#166 Win32: Ns_ThreadJoin() can wait forever - hangs server Architecture: Win32-specific Bugs 07/16/03
ThreadJoin windows port uses 
WaitForSingleObject with IDEFINITE argument.
In some situations sched thread exited before main
process issues ThreadJoin and it hangs indefinitely.
So intead of waiting forever i put timeout. This may be
non-complient but aolserver can be shutdown now.


#239 Connection hangs until timeout when request reaches maxinput Architecture: Server (nsd) Bugs 08/13/04
When uploading a file whose size is greater than the
server's configured maxinput paramter, nothing happens
-- no response to the client, and the connection is
never even closed, until tcp_timeout is reached.

I do see this error when the client is finally
disconnected:
[13/Aug/2004:10:40:34][9099.65541][-driver-] Error:
Releasing Socket; Unable to read request, Peer =  ...

Note that this problem does not occur when the request
has exceed the recvwait parameter -- in that case, the
connection is closed with no response.

Note also that this same problem occurs when the
connection is using the nsopenssl driver.

I have observed this on both linux and solaris
instances of aolserver 4.0.7.


IMHO, the client should receive some sort of error:
413 Request Entity Too Large
or
400 Bad Request

or the connection should be closed, or both (ideally,
but perhaps not possible).





#255 [ns_info shutdownpending] is missing None Feature Requests 09/17/04
The subcommand "shutdownpending" is missing from the
"ns_info" command.  This should invoke the C API
Ns_InfoShutdownPending() and return a boolean value.

One specific use case where the [ns_info
shutdownpending] is important: long-running worker
threads running in forever-loops need to know when to
terminate at server shutdown.  Especially important are
scheduled procs that run in separate threads from the
main "sched" thread.

Right now, those threads will cause the server to wait
until "shutdowntimeout" (default 20 sec) then the
server will abend with the following fatal message:

    [17/Sep/2004:00:30:22][13849.79][-driver-] Fatal:
driver: trigger recv() failed: Socket operation on
non-socket

Those threads need to be implemented to periodically
check (at least as frequently as once every
shutdowntimeout seconds) for [ns_info shutdownpending]
true, and if so, terminate themselves.

For threads which run C procs, they should use the
Ns_InfoShutdownPending() C API which already exists to
do the same.

#382 [ns_info server] returns "no server" in config interp Architecture: Server (nsd) Bugs 05/05/01
[ns_info server] doesn't work in the configuration 
interpreter for versions after 3.2 as nsServer is not 
set until _after_ the configuration is read. Setting 
it when the option is parsed (like it was before) 
fixes this issue so [ns_info server] works in the 
configuration interpreter like the other ns_info calls.

This might be socially unacceptable or have side 
effects, but I haven't notice any yet.

diff -r aolserver-3.4pre1/nsd/nsmain.c aolserver-
3.4pre1-mod/nsd/nsmain.c
216a217
>       nsServer = optarg;

#182 nslog: bytes sent in access log wildly incorrect sometimes Modules: nslog (Access Logging) Bugs 10/01/03
I was looking at an analysis page for some of my access
logs, when I noticed that the total traffic on some
pages was very large, as in, more than 1000 times
larger than it should be.

When I started tracking down, I found lots of entries
like this in my access.logs:

67.72.101.6 - - [01/Oct/2003:07:47:42 -0500] "HEAD /
HTTP/1.0" 200 4294967160 "" ""

They're not all HEAD requests, but seem to run the gamut.  

This is actually against AOLServer 4 beta 10, which I
did not see on the list above.

If people have trouble reproducing this I'll see if I
can set up some kind of test bed.

#210 Fix for fastpath.tcl to add trailing slash Protocol: HTTP Bugs 04/15/04
If an url is typed in to a browser that is a directory 
handled by _ns_dirlist,  and that url does not have a 
trailing slash, the resulting hyperlinks do not work, as 
they lack the slash separator.  This patch simply detects 
this condition and appends the slash if needed.



#278 ns_eval evaluates script badly, at least from nscp API: Tcl Bugs 12/07/04
one example:

ns_eval {
proc default_formatter { data_name input_proc } {
    upvar $data_name data

    return "<tr class=item-font>
    <td>[ad_space_to_nbsp $data(type)]</td>
    <td>$data(stats)</td>
    <td>[util_commify_number $data(value)]</td>
    <td align=right>[$input_proc data]</td>
    </tr>
    "
}
}

results in
nscp 1>>> can't read "data_name": no such variable

#316 ns_adp_parse returns empty string Scripting: ADP Bugs 03/13/06
On our web server, running version 4.0.10, we have 25
threads running with no thread die-off.  Occasionally,
we've noticed HTTP 200s being returned with a
Content-Length of 0.  We've tracked this down to
ns_adp_parse returning null in our application.  We're
calling this function like:

set parsed_code [ns_adp_parse -string $adp_to_parse]

and parsed_code comes back as "" for the affected thread.

This seems to affect all ns_adp_parse calls for an
affected thread (interpreter?) -- generally we see it
on only one of the 25 threads, but all HTTP requests
for an ADP page for that thread return no content.  Tcl
requests work fine.

Here's some info from our config:

ns_section ns/server/${server}
        ns_param PageRoot ${server_root}/www
        ns_param DirectoryFile {index.tcl,index.adp}
        ns_param MinThreads 25
        ns_param MaxThreads 25
        ns_param MaxConnections 250
        ns_param MaxDropped 0
        ns_param MaxKeepAlive 100
        ns_param KeepAliveTimeout 10
        ns_param SockTimeout 15
        ns_param ThreadTimeout 3600
        ns_param ConnsPerThread 0
        ns_param CheckModifiedSince false
        ns_param EnableTclPages off

ns_section ns/server/${server}/adp
        ns_param Cache on
        ns_param Map /*.adp
        ns_param DefaultParser fancy
        ns_param EnableExpire    false
        ns_param EnableDebug     false

We're running on Linux 2.4.25 (Debian Woody), on an SMP
Intel machine with 4 GB of RAM, and are using a heavily
modified version of ACS to serve our content.

Please let me know what other information would be
helpful, and how to trace this issue into Aolserver. 
Since the problem only occurs on only one or two
threads at a time, and after the web server has seen
several hundred thousand requests, it's somewhat
difficult to reproduce.


#387 const usage None Feature Requests 05/15/01
There is a noticeable lack of "const" parameters in the
AOLserver API.  This is a problem for me, since I am
quite pedantic when writing modules, and the
Ns_DString* and Ns_DSet* calls cause a cascade of casts
and/or compiler warnings.

I have gone through a decent amount of the server API
and converted appropriate functions to use const
parameters.  Would be more than happy to submit diffs.


#288 ns_adp_compress: apply gzip to outgoing ADP buffer None Feature Requests 01/10/05
Using the new Ns_Compress() function, add the
capability to gzip-compress ADP responses.

New configuration options:

ns_section "ns/server/${servername}/adp/gzip"
ns_param enabled on
ns_param level 4
ns_param minsize 0

New Tcl API:

ns_adp_compress ?boolean?

By default, "boolean" is "on."  Calling
"ns_adp_compress on" will flag the ADP request for
compression if the requirements are met (ADP streaming
not turned on, ADP reseponse is larger than minsize,
enabled in config).


#250 Vulnerability to HTTP Response Splitting attack Architecture: Server (nsd) Bugs 08/26/04
AOLserver 3.x and 4.0 are vulnerable against the HTTP Response 
Splitting attack described in

http://www.sanctuminc.com/pdf/whitepaper_httpresponse.pdf

Neither ns_returnredirect nor ad_returnredirect check for newlines 
in the redirection target.

As described in the Recommendations section on page 28 of above 
document, this is pretty easy to fix. Just check for \n and \r, log 
the offending redirection target, and throw an error.

See also:

http://openacs.org/bugtracker/openacs/bug?
filter%2eassignee=2956&bug%5fnumber=2011



elizthom

Ticket Summary Component Milestone Type Created
Description
#412 Ns_ConnConnectionFdProc return value None Feature Requests 06/28/01
Ns_ConnConnectionFdProc should return a SOCKET, not an int.

This change would affect the socket driver, keepalive
code, and Ns_ConnSock.

Diff follows as an attachment.



hobbs

Ticket Summary Component Milestone Type Created
Description
#168 content/file regeneration None Feature Requests 08/15/03
Does your server support an automatic content regeneration 
mechanism like the apache web 
(http://httpd.apache.org/docs-
2.1/mod/mod_rewrite.html)?
Is there a rule or condition 
available to make it possible to react on the event "missing or 
invalid file" by a script?

#169 Rewrite Module None Feature Requests 08/15/03
Would you like to provide a URL rewrite module like it is available 
for the apache web server (http://httpd.apache.org/docs-
2.1/mod/mod_rewrite.html)?
Can modules from other web 
servers be used by your software?

jgdavidson

Ticket Summary Component Milestone Type Created
Description
#149 Conn specific User/Module Storage and API None Feature Requests 05/11/03
I would like to see an API developed that would let
modules attach data and metadata to specific connections.

Such an API would make it easier for modules to perform
work at various times in a connection's life: init,
request processing, logging, and conn tear down.

This API would also make it much easier for modules to
cooperate and delegate tasks amongst themselves.

An example (from 3.x)

Access logging is performed by the nslog module.  Right
now, on several of my servers, there are a bunch of
metarequests that are made.  Uptime monitoring,
ns_telemetry requests, etc.  There are also useless
requests caused by Code Red etc.  For a variety of
reasons, I choose not to even log these requests.  I do
this by creating a input request filter.  When that
filter recognizes a virus, or metarequests, it knows to
flag the connection in such a way as to inform the log
module not to log the request.  There is no connection
specific method for doing so at this time, so what I do
do is set an X-Log False header in the connection's
Input Header Set.  This is a complete and ugly kluge. 
But it does work, and when the nslog module comes
along, it sees the input header and checks for X-Log
False.  If it finds it, it returns.

Recently there was discussion of creating a mechanism
that would recognize requests that come from search
engines, and that would alter the output stream to
highlight the search engine keywords.  One way of
approaching this task is with two modules.  One, on
accepting a request, examines the referrer field and
noting it comes from a search engine, it proceeds to
annotate the connection with the specific words or
phrases to be highlighted.  Then, as output is created,
another module can recognize the connection specific
keywords and alter the output stream accordingly.

The value of breaking this into two modules as
described is it that it separates the highlight
processing from the request processing.  This would
make it easier to highlight requests from external
search engines, or from internal site queries.

The key requirements of this API are to:

a)  provide connection specific storage
b)  provide an API to enable modules to cooperate in
sharing this connection specific storage.  Presumably,
modules would want to hook or daisy chain individual
pieces of storage together.
c)  provide well defined times for module specific
procedures to initialize and cleanup the connection
specific storage

jwl

Ticket Summary Component Milestone Type Created
Description
#332 Possible double-free crash in nspostgres_v4_r1 Modules: nspostgres Bugs 09/12/07
Juan Jose reported a crash on FreeBSD 6.2.  The last bit in the server log before the crash was:

----
[12/sep/2007:12:59:56][14336.134800896][-sched:3-] Notice: Ns_PgExec: Trying to reopen database connection
[12/sep/2007:12:59:56][14336.134800896][-sched:3-] Notice: Opening webstats on 127.0.0.1, port 5432
[12/sep/2007:12:59:56][14336.134800896][-sched:3-] Error: Ns_PgOpenDb(postgres_driver):  Could not connect to 127.0.0.1:5432:webstats:  FATAL:  the database system is shutting down

[12/sep/2007:12:59:56][14336.134800896][-sched:3-] Error: dbinit: error(127.0.0.1:5432:webstats,FATAL:  terminating connection due to administrator command
CONTEXTO:  SQL statement "..."
PL/pgSQL function "refresh_matview" line 9 at execute statement
el servidor ha cerrado la conexi<C3><B3>n inesperadamente,
        probablemente porque termin<C3><B3> de manera anormal
        antes o durante el procesamiento de la petici<C3><B3>n.
): 'select refresh_matview('...')'
[12/sep/2007:12:59:56][14336.134800896][-sched:3-] Notice: Ns_PgExec: Trying to reopen database connection
nsd in free(): error: chunk is already free
----

gdb backtrace was not very useful:

(gdb) bt
#0  0x281ad537 in pthread_testcancel () from /lib/libpthread.so.2
#1  0x2819688d in pthread_kill () from /lib/libpthread.so.2
#2  0x28196256 in raise () from /lib/libpthread.so.2
#3  0x28271114 in abort () from /lib/libc.so.6
#4  0x2820de2b in _UTF8_init () from /lib/libc.so.6
#5  0xbfbfecc9 in ?? ()
#6  0x282783ef in sys_nsig () from /lib/libc.so.6
#7  0x282782ef in sys_nsig () from /lib/libc.so.6
#8  0x2827834c in sys_nsig () from /lib/libc.so.6
#9  0x00000004 in ?? ()
#10 0x28284700 in ?? () from /lib/libc.so.6
#11 0xbf672a48 in ?? ()
#12 0x2820de59 in _UTF8_init () from /lib/libc.so.6
#13 0x28284700 in ?? () from /lib/libc.so.6
#14 0x28299c64 in _nsyyin () from /lib/libc.so.6
#15 0xbf672af8 in ?? ()
#16 0x2820ebb9 in _UTF8_init () from /lib/libc.so.6
#17 0x0810da08 in ?? ()
#18 0x0810dae0 in ?? ()
#19 0xbf672a78 in ?? ()
#20 0x280d3f27 in NsLockUnset (lock=0x28284700) at pthread.c:369
Previous frame inner to this frame (corrupt stack?)


mpagenva

Ticket Summary Component Milestone Type Created
Description
#361 ADPs sourced in different encodings None Feature Requests 03/27/01
<p>AOLserver 3.x reads ADPs as UTF-8 encoded files. It
would be convinient if it can read them in other
encodings as well. Many tools (eg. editors) have no
support for UTF-8 which makes working with ADPs in
UTF-8 very difficult. You can of course write your
custom parser that uses the same C function as default
parser but reads ADPs in given encoding. In long term I
see no point in maintaining such parser so I would
like  this feature to be added to default parser during
work on International Support in AOLserver. I think it
would be nice to be able to specify different encodings
for different parts of the site to support mulitlingual
sites as well.






nobody

Ticket Summary Component Milestone Type Created
Description
#34 Patch for SEGV if 401 redirect is used Architecture: Server (nsd) Bugs 02/13/02
AOLserver 3.4.2 can generate a segmentation fault in 
FreeUrl when it tries to dereference a NULL pointer.  
This behavior happens ONLY if the server in question 
has a 401 redirect specified, and it can only be 
produced if a failure occurs in the Ns_ConnReadLine 
routine (via rapid browser refreshes, for example).  
Here's the relevant gdb output:

Program received signal SIGSEGV, Segmentation fault.
0x80798da in FreeUrl (request=0x0) at request.c:313
313         if (request->url != NULL) {
(gdb) bt
#0  0x80798da in FreeUrl (request=0x0) at request.c:313
#1  0x807986e in Ns_SetRequestUrl (request=0x0,
    url=0x8174168 "/error_pages/401.html") at 
request.c:286
#2  0x8077c75 in Ns_ConnRedirect (conn=0x81bc068,
    url=0x8174168 "/error_pages/401.html") at op.c:231
#3  0x807af90 in ReturnRedirect (conn=0x81bc068, 
status=401,
    resultPtr=0xbefff864) at return.c:1206
#4  0x807a922 in Ns_ConnReturnBadRequest 
(conn=0x81bc068,
    reason=0x8128593 "Invalid HTTP request") at 
return.c:838
#5  0x807e108 in ConnRun (connPtr=0x81bc068) at 
serv.c:822
#6  0x807dc3a in NsConnThread (arg=0x81b3de8) at 
serv.c:671
#7  0x811db42 in NsThreadMain (arg=0x81ffae0) at 
thread.c:228
#8  0x4001ebb5 in pthread_start_thread 
(arg=0xbefffe40) at manager.c:241

The problem stems from the fact that conn->request is 
always NULL within ConnRun just before the following 
code snippet is executed:

    if (Ns_ConnReadLine(conn, &ds, &n) != NS_OK ||
        (connPtr->request = Ns_ParseRequest
(ds.string)) == NULL) {
        (void) Ns_ConnReturnBadRequest(conn, "Invalid 
HTTP request");
        goto done;
    }

If Ns_ConnReadLine doesn't return NS_OK, conn->request 
will remain NULL; Ns_ConnReturnBadRequest will then be 
called, and it will in turn call ReturnRedirect(conn, 
401, &result).  If a 401 redirect exists, the calling 
sequence shown above will be followed, and FreeUrl
(request) will eventually be called with 
request==NULL, causing the SEGV.

I was able to reproduce this segmentation fault quite 
easily on a VAlinux 6.2.3 system simply by doing VERY 
rapid refreshes of a page (browser doesn't matter).  
I've also verified that this behavior was present in 
AOLserver 3.3.1 as well.  The simplest workaround is 
to remove the 401 redirect.

I created a patch for this problem which calls 
Ns_ParseRequest within Ns_ConnRedirect to fill in the 
conn->request structure if conn->request is NULL 
(rather than calling Ns_SetRequestUrl, as the current 
code does), and then also prevents the request from 
being reauthorized if conn->request is still NULL.  
Ns_ConnRedirect seemed to be the most logical point in 
the call sequence where a URL was available to be used 
to fill in the conn->request structure in this case.

This patch fixes the problem, but since I'm not aware 
of all the internals of AOLserver, it may not be the 
optimal approach.  There's also still the underlying 
problem that several routines (FreeUrl, SetUrl, and so 
on) reference pointers without validating them first.

Hopefully the horrible formatting in this web form 
corrects itself when the patch is submitted....

#14 ns_dbquotevalue doesn't escape backslash API: Tcl Bugs 10/24/01
Data with a literal backslash that is submitted to
ns_dbquotevalue will get mangled by insertion into the
database - I found this out when I tried to insert some
C source code with the text '\0' in it, which needed to
be quoted into \\0. The following should be added to
nsdb.tcl.

In ns_dbquotevalue, right after the 'regsub' line, add
another:

regsub -all {\B} $value "\\\\\\\\" value

Unfortunately, yes, that is indeed eight backslashes.
There's probably a way to do it with four \B's instead
- or maybe two. The above is what I did to make it work
for me.

#251 Win32: Implement optional systray icon None Feature Requests 09/07/04
On Win32, allow enabling of a systray icon from the
config .tcl script.

The systray icon might have several options: "stats" -
display some basic statistics (number of connections,
max connections, etc.); "control port" - open a simple
window which simulates the control port, taking input
and evaluating it and displaying the results; etc.


#264 Emulated poll() should be updated Architecture: Server (nsd) Bugs 09/29/04
AOLserver provides the emulated poll() for platforms
which do not have it (Win32, as well as any platform
where it's not detected by autoconf's "configure" script).

The emulated poll() is lifted from GNU's libc and
appears twice in AOLserver code, in nsd/nswin32.c and
in nsd/unix.c.

The latest version of GNU libc's poll() can be found here:

http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/bsd/poll.c

At some point, our version should be sync'ed up with
the latest and tested.


#443 nsperm segfaults on uninitialized mutex if skiplocks set Modules: nsperm (Permissions) Bugs 08/24/01
If the configuration parameter SkipLocks is "on" (the
default) then calling "ns_perm checkpass user pass"
with a user that exists (regardless of whether the
password is correct or not) will segfault the server.

The reason is quite simple: the mutex in the users
TclHashTable is not initialized if skiplocks is set,
but UserAuthProc does not check if skiplocks is set
before attempting to lock the mutex.  Checking
skiplocks before attempting to manipulate the mutex (as
its done nearly everywhere else in the code) fixes the
segfault.

SetPassCmd is similarly broken, but it should probably
not be allowed at all if skiplocks is set.

Also, Ns_MutexLock and Ns_LockMutex are both used
(similarly for Unlock); it seems that the first should
be preferres as LockMutex is from the 2.x compatability
code.

These reasons are likely partly behind the complete
rewrite of nsperm for 4.x, but that has not yet been
released and people running 3.4 or earlier may want to
know about this problem.


#92 nsoracle: Allow larger date formats in result sets Modules: nsoracle Bugs 10/08/02
Our NLS_DATE_FORMAT is set to YYYY-MM-DD HH24:MI:SS
which is apparently larger than whatever the default
size for date type colunms is for our driver.  This
caused aolserver to segfault when selecting date fields
from our database.

This patch seems to have fixed that problem.   There
may be a better solution, but I don't know that much
about OCI.  All this patch does is statically increases
the buffer size to allow 20 characters (which is what
we need).  If you need it bigger . . . make it bigger
:-).  If anyone knows how to dynamically determine what
the size needs to be, that would be good.

Matthew

#154 Debian Linux on parisc fails in Ns_SockRecv() API: C Bugs 05/30/03
Naveen Agnihotri <agni@MIT.EDU> reported problems running 
AOLserver 3.3.1+ad13 on his/her Debian Linux machine running 
on parisc architecture.

The symptom is that immediately after connecting to the HTTP 
port, AOLserver would immediately return a HTTP 400 Bad 
Request without even waiting for input from the socket.

strace output shows this happening:

28068 accept(3, {sin_family=AF_INET, sin_port=htons(48344), 
sin_addr=inet_addr("64.8.232.50")}}, [16]) = 13
28068 fcntl(13, F_GETFD)                = 0
28068 fcntl(13, F_SETFD, FD_CLOEXEC)    = 0
28068 ioctl(13, 0x5421, [1])            = 0
28068 gettimeofday({1054331619, 453952}, {240, 0}) = 0
28068 time(NULL)                        = 1054331619
28068 rt_sigprocmask(SIG_SETMASK, NULL, [HUP INT PIPE 
TERM RTMIN], 8) = 0
28068 write(5, "@/\200\0\0\0\0\0@/\215\360\0\26hV\0005\240\240
\0\0P\3\0"..., 148) = 148
28068 rt_sigprocmask(SIG_SETMASK, NULL, [HUP INT PIPE 
TERM RTMIN], 8) = 0
28068 rt_sigsuspend([HUP INT PIPE TERM] <unfinished ...>
28065 <... poll resumed> [{fd=4, events=POLLIN, 
revents=POLLIN}], 1, 2000) = 1
28065 getppid()                         = 28064
28065 read(4, "@/\200\0\0\0\0\0@/\215\360\0\26hV\0005\240\240
\0\0P\3\0"..., 148) = 148
28065 mmap(NULL, 69632, 
PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40309000
28065 mprotect(0x40319000, 4096, PROT_NONE) = 0
28065 clone(child_stack=0x40309460, 
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAN
D|0x26) = 28069
28065 kill(28068, SIGRTMIN <unfinished ...>
28068 --- SIGRTMIN (Real-time signal 0) ---
28068 <... rt_sigsuspend resumed> )     = -1 EINTR (Interrupted 
system call)
28068 rt_sigreturn(0x25)                = -1 EINTR (Interrupted system 
call)
28068 sched_yield()                     = 0
28068 _newselect(0xa, 0x402f85f0, 0, 0, 0 <unfinished ...>
28065 <... kill resumed> )              = 0
28065 poll( <unfinished ...>
28069 brk(0x398000)                     = 0x398000
28069 brk(0x399000)                     = 0x399000
28069 brk(0x39a000)                     = 0x39a000
28069 brk(0x39b000)                     = 0x39b000
28069 brk(0x39c000)                     = 0x39c000
28069 brk(0x39d000)                     = 0x39d000
28069 brk(0x39e000)                     = 0x39e000
28069 brk(0x39f000)                     = 0x39f000
28069 brk(0x3a0000)                     = 0x3a0000
28069 brk(0x3a1000)                     = 0x3a1000
28069 brk(0x3a2000)                     = 0x3a2000
28069 brk(0x3a3000)                     = 0x3a3000
28069 brk(0x3a4000)                     = 0x3a4000
28069 brk(0x3a5000)                     = 0x3a5000
28069 brk(0x3a6000)                     = 0x3a6000
28069 brk(0x3a7000)                     = 0x3a7000
28069 brk(0x3a8000)                     = 0x3a8000
28069 gettimeofday({1054331619, 561819}, {240, 0}) = 0
28069 gettimeofday({1054331619, 563088}, {240, 0}) = 0
*** 28069 recv(13, 0x3561d4, 16000, 0)      = -1 EAGAIN (Resource 
temporarily unavailable)
28069 time(NULL)                        = 1054331619
28069 send(13, "HTTP/1.0 400 Bad Request\r\nConten"..., 199, 0) 
= 199
28069 send(13, "<!DOCTYPE HTML PUBLIC \"-//IETF//"..., 538, 0) 
= 538
28069 send(10, "\0", 1, 0)              = 1
28068 <... _newselect resumed> )        = 1
28068 recv(9, "\0", 1, 0)               = 1
28068 time([1054331619])                = 1054331619
28068 close(13)                         = 0

The line starting with "***" is the culprit.

I suggest the following change in nsd/sock.c, in function 
Ns_SockRecv(), from:

int
Ns_SockRecv(SOCKET sock, void *buf, int toread, int timeout)
{
    int         nread;

    nread = recv(sock, buf, toread, 0);
    if (nread == -1
        && ns_sockerrno == EWOULDBLOCK
        && Ns_SockWait(sock, NS_SOCK_READ, timeout) == 
NS_OK) {
        nread = recv(sock, buf, toread, 0);
    }
    return nread;
}

to:

int
Ns_SockRecv(SOCKET sock, void *buf, int toread, int timeout)
{
    int         nread;

    do {
        nread = recv(sock, buf, toread, 0);
    } while (nread == -1
        && (ns_sockerrno == EWOULDBLOCK || errno == EAGAIN)
        && Ns_SockWait(sock, NS_SOCK_READ, timeout) == 
NS_OK);
    return nread;
}

I'm attaching a unified diff patch to this bug for this change.

After this change, strace output looks like this:

28943 accept(3, {sin_family=AF_INET, sin_port=htons(48641), 
sin_addr=inet_addr("64.8.232.50")}}, [16]) = 13
28943 fcntl(13, F_GETFD)                = 0
28943 fcntl(13, F_SETFD, FD_CLOEXEC)    = 0
28943 ioctl(13, 0x5421, [1])            = 0
28943 gettimeofday({1054333525, 868865}, {240, 0}) = 0
28943 time(NULL)                        = 1054333525
28943 rt_sigprocmask(SIG_SETMASK, NULL, [HUP INT PIPE 
TERM RTMIN], 8) = 0
28943 write(5, "@/\200\0\0\0\0\0@/\215\360\0\26hN\0005\240\300
\0\0P\3\0"..., 148) = 148
28943 rt_sigprocmask(SIG_SETMASK, NULL, [HUP INT PIPE 
TERM RTMIN], 8) = 0
28943 rt_sigsuspend([HUP INT PIPE TERM] <unfinished ...>
28940 <... poll resumed> [{fd=4, events=POLLIN, 
revents=POLLIN}], 1, 2000) = 1
28940 getppid()                         = 28939
28940 read(4, "@/\200\0\0\0\0\0@/\215\360\0\26hN\0005\240\300
\0\0P\3\0"..., 148) = 148
28940 mmap(NULL, 69632, 
PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40309000
28940 mprotect(0x40319000, 4096, PROT_NONE) = 0
28940 clone(child_stack=0x40309460, 
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAN
D|0x26) = 28944
28940 kill(28943, SIGRTMIN <unfinished ...>
28943 --- SIGRTMIN (Real-time signal 0) ---
28943 <... rt_sigsuspend resumed> )     = -1 EINTR (Interrupted 
system call)
28943 rt_sigreturn(0x25)                = -1 EINTR (Interrupted system 
call)
28943 sched_yield()                     = 0
28943 _newselect(0xa, 0x402f85f0, 0, 0, 0 <unfinished ...>
28940 <... kill resumed> )              = 0
28940 poll( <unfinished ...>
28944 brk(0x398000)                     = 0x398000
28944 brk(0x399000)                     = 0x399000
28944 brk(0x39a000)                     = 0x39a000
28944 brk(0x39b000)                     = 0x39b000
28944 brk(0x39c000)                     = 0x39c000
28944 brk(0x39d000)                     = 0x39d000
28944 brk(0x39e000)                     = 0x39e000
28944 brk(0x39f000)                     = 0x39f000
28944 brk(0x3a0000)                     = 0x3a0000
28944 brk(0x3a1000)                     = 0x3a1000
28944 brk(0x3a2000)                     = 0x3a2000
28944 brk(0x3a3000)                     = 0x3a3000
28944 brk(0x3a4000)                     = 0x3a4000
28944 brk(0x3a5000)                     = 0x3a5000
28944 brk(0x3a6000)                     = 0x3a6000
28944 brk(0x3a7000)                     = 0x3a7000
28944 brk(0x3a8000)                     = 0x3a8000
28944 gettimeofday({1054333525, 976599}, {240, 0}) = 0
28944 gettimeofday({1054333525, 977858}, {240, 0}) = 0
*** 28944 recv(13, 0x3561f4, 16000, 0)      = -1 EAGAIN (Resource 
temporarily unavailable)
28944 _newselect(0xe, 0x40309bb0, 0, 0, 0x40309c30 
<unfinished ...>
28940 <... poll resumed> [{fd=4, events=POLLIN}], 1, 2000) = 0
28940 getppid()                         = 28939
28940 poll( <unfinished ...>
28944 <... _newselect resumed> )        = 1
*** 28944 recv(13, "GET / HTTP/1.0\r\n", 16000, 0) = 16
*** 28944 recv(13, 0x3561f4, 16000, 0)      = -1 EAGAIN (Resource 
temporarily unavailable)
28944 _newselect(0xe, 0x40309e30, 0, 0, 0x40309eb0 
<unfinished ...>
28940 <... poll resumed> [{fd=4, events=POLLIN}], 1, 2000) = 0
28940 getppid()                         = 28939
28940 poll([{fd=4, events=POLLIN}], 1, 2000) = 0
28940 getppid()                         = 28939
28940 poll( <unfinished ...>
28944 <... _newselect resumed> )        = 1
*** 28944 recv(13, "\r\n", 16000, 0)        = 2
28944 newstat("[censored]/servers/server1/pages", 
{st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
28944 newstat("[censored]/servers/server1/pages/index.adp", 
0x40309d30) = -1 ENOENT (No such file or directory)
28944 newstat("[censored]/servers/server1/pages/index.html", 
{st_mode=S_IFREG|0644, st_size=1706, ...}) = 0
28944 newstat("[censored]/servers/server1/pages/index.html", 
{st_mode=S_IFREG|0644, st_size=1706, ...}) = 0
28944 time(NULL)                        = 1054333533
28944 open("[censored]/servers/server1/pages/index.html", 
O_RDONLY) = 14
28944 read(14, "<!--\nThis is the default page th"..., 1706) = 1706
28944 close(14)                         = 0
28944 time(NULL)                        = 1054333533
28944 time(NULL)                        = 1054333533
28944 send(13, "HTTP/1.0 200 OK\r\nLast-Modified: "..., 237, 0) = 
237
28944 send(13, "<!--\nThis is the default page th"..., 1706, 0) = 1706
28944 send(10, "\0", 1, 0)              = 1
28944 gettimeofday({1054333533, 386092}, {240, 0}) = 0
28944 time(NULL)                        = 1054333533
28944 write(8, "64.8.232.50 - - [30/May/2003:18:"..., 77) = 77
28944 gettimeofday({1054333533, 389859}, {240, 0}) = 0
28944 time(NULL)                        = 1054333533
28944 gettimeofday({1054333533, 391583}, {240, 0}) = 0
28944 rt_sigprocmask(SIG_BLOCK, NULL, [HUP INT PIPE 
TERM RTMIN], 8) = 0
28944 rt_sigprocmask(SIG_UNBLOCK, [RTMIN], [HUP INT PIPE 
TERM RTMIN], 8) = 0
28944 gettimeofday({1054333533, 394976}, NULL) = 0
28944 nanosleep({119, 996607000},  <unfinished ...>
28943 <... _newselect resumed> )        = 1
28943 recv(9, "\0", 1, 0)               = 1
28943 time([1054333533])                = 1054333533
28943 shutdown(13, 1 /* send */)        = 0

The interesting lines are again prefixed with "***".

-- Dossy




#160 nsgd - Win32 support and memory free bug Architecture: Win32-specific Bugs 06/09/03
The attached patch for nsgd allows Win32 compilation
and fixes a crash-causing bug.

Tcl_GetOpenFile is not supported on Windows, so skip to
direct fopen on Win32 instead.  Fix by Tim Moss.

Also, free the buffer allocated by gdImagePngPtr with
gdFree instead of free.  free causes a crash on Win32
and is incorrect per the gd manual:
http://www.boutell.com/gd/manual2.0.15.html


#170 nsgd unstable on aolserver 4 Scripting: Other Bugs 08/21/03
nsgd become unstable on aolserver 4,
I had test on RH 8 + aolserver 4 , I feel "gd destroy" 
have memory leak problem , here is my test condition:
1. gd open ....
    gd destroy
2. gd open
    ... not destroy

in condition 1 , after process some request, I find may 
error --- "gd is not open ...." on log file , and my gd 
chart have some garbage image.

in condition 2 , my gd chart display more stable, after 
couple request, the resource become not enought 
(reasonable) 

from this simple test, I "guess" gd destroy have memory 
leak problem



#196 ns_adp_safeeval doesn't block script runat=server API: C Bugs 12/29/03
The ns_adp_safeeval command introduced in 4.0 seems to
only ignore <% %> and <%= %>, and will still execute
arbitrary commands that are in <script language=tcl
runat=server> tags.

#201 ns_sendmail should encode subject if it contains non-ASCII None Bugs 02/06/04
When sending mail with non-ASCII characters in the 
subject, it is the responsibility of the MUA (aolserver) to 
encode the subject accordingly. Aolserver's ns_sendmail 
currenly sends out the mail with non-ASCII characters in 
the subject without encoding. 
 
I got this bounce message from a MTA who did not accept 
the mail generated by aolserver: 
 
 
Non-encoded 8-bit data (char E4 hex) in message header 
'Subject' 
  Subject: Passwort ge\344ndert\n 
                      ^ 
 
This nondelivery report was generated by the 
amavisd-new program 
at host mail2. Our internal reference code for your 
message 
is 23623-01-57. 
 
 
WHAT IS AN INVALID CHARACTER IN MAIL HEADER? 
 
  The RFC 2822 standard specifies rules for forming internet 
messages. 
  It does not allow the use of characters with codes above 
127 to be used 
  directly (non-encoded) in mail header (it also prohibits 
NUL and bare CR). 
 
  If characters (e.g. with diacritics) from ISO Latin or other 
alphabets 
  need to be included in the header, these characters need 
to be properly 
  encoded according to RFC 2047. This encoding is often 
done transparently 
  by mail reader (MUA), but if automatic encoding is not 
available (e.g. 
  by some older MUA) it is the user's responsibility to avoid 
the use 
  of such characters in mail header, or to encode them 
manually. Typically 
  the offending header fields in this category are 'Subject', 
'Organization', 
  and comment fields in e-mail addresses of the 'From', 'To' 
and 'Cc'. 
 
  Sometimes such invalid header fields are inserted 
automatically 
  by some MUA, MTA, content checker, or other mail 
handling service. 
  If this is the case, that service needs to be fixed or 
properly configured. 
  Typically the offending header fields in this category are 
'Date', 
  'Received', 'X-Mailer', 'X-Priority', 'X-Scanned', etc. 
 
  If you don't know how to fix or avoid the problem, please 
report it 
  to _your_ postmaster or system manager. 
 
 

#211 ns_returnz params don't match ns_return API: C Bugs 05/10/04
  I had loaded the nsreturnz module and rename'd
ns_returnz as ns_return to get gzip compression across
a site, but it turns out that causes problems, because
the signature for ns_returnz is 

ns_returnz status type string

while ns_return is:

ns_return ?connid? status type string

 We had some old code that was passing $conn as the
first argument to ns_return, and ns_returnz would only
error if there were less than three arguments, so the
browser would sometimes report things like "unknown
response" or show "text/html" instead of the page.
  This could be fixed by changing the argv array
indices to be [argc-1] instead of [3] and so on and
checking that the length of the argv array is either 4
or 5.
  Also, the documentation at
http://aolserver.com/40drafts/tclapi/conn.html#ns_return
doesn't mention the connid parameter - is the
documentation incomplete or is this parameter deprecated?

#220 nsoracle: use of snprintf causes compile to fail on Win32 Modules: nsoracle Bugs 06/16/04
nsoracle.c contains snprintf(...) - This is shielded by an 
#IFDEF WIN32. The compilaton fails at this line.  To get 
around this, I've made the following change:

348c348
< #ifdef WIN32
---
> #ifndef WIN32

That satistifes the compiler and the resulting DLL works 
fine.

#221 Various errors in workspace ora8.dsw Modules: nsoracle Bugs 06/16/04
The package nsoracle-2.7.tar.gz contains a 'win32' 
directory. However, the ora8.dsw that is included in that 
directory is incomplete. It contains the following errors.

1. The workspace looks for a file called ora8.c
 
proposed fix: 
Since there is already a file called nsoracle.c, change 
the workspace to include this file instead.

2. snprintf function causes compilation to fail 
(http://sourceforge.net/tracker/?
func=detail&aid=974164&group_id=3152&atid=103152)

proposed fix:
 - Refer to bug report for bug #974164 for details

3. Linker has incorrect and incomplete libraries

proposed fix:
   - Remove references to nstcl.lib
   - add a reference to tclsh84t.lib

Please note that I'm not an expert and take these fixes 
with a grain of salt. These were the fixes that I did to 
get the module to build on Windows 2000.

Compiler used: Visual C++ 6.0
OS : Windows 2000 Service Pack 3

#242 nsodbc can't retrieve large values None Bugs 08/18/04
The attached patch addresses three problems with nsodbc.

1.  ODBCGetRow can't retrieve large values, e.g. from a
SQL Server TEXT column, as it only calls SQLGetData
once with a 8192 byte buffer.  In your server log you
will see something like: 

odbc message: SQLSTATE = 01004, Native err = 0, msg =
'[Microsoft][ODBC SQL Server Driver]String data, right
truncation'

  With the patch, we call SQLGetData until there is no
more data left, building up the result in a DString. 

2.  If an error is thrown while retrieving rows with
ns_db getrow, so that not all rows are retrieved, then
the next ns_db select will hang.  The patch makes
ODBCExec cancel the active select if there is one,
which I believe is the current behavior in at least
some other db drivers, like nsoracle.

3.  Wrap nsdb.h include in #ifndef NS_DML to build with
both AOLserver 3.x and 4.x.  (I haven't actually tested
this with 3.x)

#258 Setting logroll for server log does not work as expected Configuration: Server Bugs 09/19/04
One would think that setting logroll to true in the
parameters section would cause the server log to be
rolled, as is the case with ns_log, but it doesn't work
that way.  As Dossy says:

"while it's set up to roll the log on receipt of
SIGHUP, nothing actually sends it a SIGHUP.  The nslog
module schedules a daily proc that initiates the access
log roll, but the main nsd doesn't do the same for the
server log."

It would be great to see this get fixed; it has been
this way for a long, long time.

#265 win32/build.tcl INCLUDE and LIB are wrong Architecture: Win32-specific Bugs 10/01/04
On the Head, in order to get the win32/build.tcl script
to work for me on Windows XP, I had to change the two
lines setting the INCLUDE and LIB flags, to this.  This
change looks necessary for everybody to me - I'm
confused about how the script every worked for Dossy at
all as is.

I've attached a patch, but it is really tiny so here it
is inline as well:


Index: win32/build.tcl
===================================================================
RCS file: /cvsroot/aolserver/aolserver/win32/build.tcl,v
retrieving revision 1.6
diff -r1.6 build.tcl
188,189c188,194
< make::flag INCLUDE {-I./include}
< make::flag LIB "-libpath:\"$::TCLDIR/lib\"
-libpath:./nsd -libpath:./nsthread"
---
> make::flag INCLUDE "-I./include -I\"$::TCLDIR/include\""
> make::flag LIB "-libpath:./nsd -libpath:./nsthread
-libpath:$::TCLDIR/lib"
> 
> # TODO: Doing -libpath:"foo/lib" works just fine in
VC++ 6.0 project
> # files, but if you use double quotes like that
above, the Windows
> # link command will FAIL!  Why?  Fortunately, we
don't need to use any
> # directory names with spaces in them.


#270 Log dates are localized based on locale None Bugs 11/10/04
Should Log dates be localized based on locale?
If you set for example:
LANG=spanish
LC_ALL=es_ES
in the environment log dates (exactly the month) will
be localized to spanish.
Should aolserver not localize that so that log readers
just have to know a date format (in English)?
Example:
English
[10/Nov/2004:14:04:00 +0000]
Spanish
[10/nov/2004:17:06:11 +0000]
(Other months would be more different)

#273 ns_httppost: ns_log notice API: Tcl Bugs 11/22/04
ns_httppost always calls ns_log notice.

#275 nsd does not support semi-colon as query var separator Architecture: Server (nsd) Bugs 11/28/04
The latest version of htdig is using semi-colons to
separate query variables instead of ampersands.  They
reference the following suggestion at w3.org as
justification:

http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2

AOLserver does not seem to like this;  when the
semi-colons are used in a URL, the form does not
contain the variables.

There may not be much call for this, but if it's an
easy change to support both it would be appreciated.

#276 nslog naively believes X-Forwarded-For Modules: nslog (Access Logging) Bugs 11/29/04
nslog will allow any client which sends an
X-Forwarded-For HTTP header to override logging of the
"true" remote address of the client in favor of the
contents of the header. This allows an attacker to
disguise their source, can taint log accuracy, and can
hamper forensics post-attack. 

The behavior desired is:
- make honoring of X-Forwarded-For a configuration option
- option: allow a specific whitelist of remote addresses 
- option: retain actual remote IP in another field
- option: allow use of another header name instead of
X-Forwarded-For

#280 nsdb.so undocumented for 4.x series Other: Documentation Bugs 12/13/04
It is not mentioned anywhere in the 4.x documentation
(including the sample scripts!) that nsdb.so must be
loaded manually.  This is a change from the 3.x series.

missing in the database administrator's guide:

http://aolserver.com/docs/admin/dbadmin.html

and the reference config:

http://aolserver.com/docs/admin/config-reference.tcl.txt

and reference db config:

http://aolserver.com/docs/admin/sample-db-config.tcl.txt

Should also be included in the example .tcl file
included in the distribution, if it is not already (I
believe it is not).

#284 minor build(configure) problem in Linux + Tcl8.4.9 None Bugs 12/27/04
Hello folks. 

Today I found aolserver-4.0.9 configure can not
correctly add -nostartfiles to $LDLIB in Linux +
Tcl8.4.9, because it relies on existence of *gcc* in
$TCL_SHLIB_LD. In my understanding, in linux
$TCL_SHLIB_LD is normally:

TCL_SHLIB_LD='${CC} -shared -Wl,-soname,${@}'

so it fails.

Attached patch will solve this problem.

#286 ns_ldap can abort nsd upon certain search failures None Bugs 01/03/05
If  ldap_result() returns -1 during a search,
ldap_result2err is called with a null ldap message
pointer (held in result).  In error.c (OpenLDAP),
ldap_result2err asserts the result is non-null, and nsd
is aborted.

I think this is a bug in OpenLDAP, but it can be easily
worked around in nsldap.c.

#291 tDAV doesn't redirect from / to index page None Bugs 02/28/05
Howdy,

I've setup nsperm and tDAV to enable webDAV access to the 
server's pageroot for administrators and get/post/head methods for 
everyone else.  Using nsperm, I have permissions working correctly, 
but after adding tDAV from a web browser / fails to return the index 
page.


#292 tDAV "inherit" isn't a valid option None Bugs 02/28/05
Hello again,

When running tDAV with nsperm, at startup tDAV.tcl would throw this 
error"

[28/Feb/2005:11:24:45][29541.2684396012][-main-] Error: tcl: source 
/web/mars-h\q/tcl/tDAV.tcl failed: invalid option "inherit": should be 
-noinherit
NONE
invalid option "inherit": should be -noinherit
    while executing
"ns_perm denyuser inherit GET $uri """
    invoked from within
"if { ![string equal "" $tdav_shares] } {
        for {set i 0} {$i < [ns_set size $tdav_shares]} {incr i} {
            set tdav_share [ns_configsecti..."
    (file "/web/mars-hq/tcl/tDAV.tcl" line 2315)
    invoked from within
"source $file"

I patched this by stripping "inherit" from the ns_perm calls from 
tDAV.tcl line 2321 through 2333.


#293 Building aolserver on hpux Architecture: Server (nsd) Bugs 02/28/05
Hello.
It turned out, that building aolserver on  hpux is no5
trivial work :)
1. static  path to  /opt2/aol-hp/nsd/libnsd.sl
Nsd is linking statical path to libnsd.sl:

gcc -pipe -L../nsthread -L../nsd -o nsd main.o
libnsd.sl -lnsd -lnsthread -L/opt2/tcl/lib -ltcl8.5
-ldld  -lpthread -lxnet -lm  -lgcc_s   -Wl,-E 
-Wl,+s,+b,:./opt2/aolserver1/lib -Wl,+s,+b,:./opt2/tcl/lib

bash-2.04$ ./nsd
/usr/lib/dld.sl: Can't find path for shared library:
libnsd.sl
chatr nsd
...
shared library list:
             static    /opt2/aol-hp/nsd/libnsd.sl
             dynamic   ../nsthread/libnsthread.sl
...
 /opt2/aol-hp/nsd/l is building dir, not install dir

2. Dynamic initialization shared libs is missing

bash-2.04$ bin/nsd -f -t sample-config.tcl 
Ns_TlsGet: invalid key: 0: should be between 1 and 100
ABORT instruction (core dumped)
bash-2.04$

Please, try patches below.
I have hp-ux 11.11, gcc 3.3.4, ld from HP



--- aolserver-HEAD-20050208/include/Makefile.global.in
 2004-11-20 04:46:00.000000000 +0300
+++ Makefile.global.in  2005-02-28 23:41:48.000000000 +0300
@@ -109,14 +109,17 @@
         LIBS+=-lrt
     endif
 endif
-
 # Add dynamic library entry point flags.
 ifdef LIBINIT
-    ifneq (,$(fi