Ticket #2470 (new defect)
Truncated file served up from htdocs through symlink
| Reported by: | abudinsz@… | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11-retriage |
| Component: | general | Version: | 0.9 |
| Severity: | normal | Keywords: | symlink htdocs chrome |
| Cc: |
Description
I ran into an interesting problem yesterday while trying to add some static content in the htdocs folder. I added a couple of symlinks to some files that are really not that static in terms of content (nightly build logs and such). The size of the symlink when doing a ls -l is basically the length of the path you are pointing to; this is to be expected.
Here is an example of what I'm seeing:
[root@system /opt/trac/project/htdocs] ls -l test.* -rw-r--r-- 1 apache apache 51 Dec 8 17:49 test.cfg [root@system /opt/trac/project/htdocs] ln -s test.txt test.ln.txt [root@system /opt/trac/project/htdocs] ls -l test.* -rw-r--r-- 1 apache apache 51 Dec 8 17:49 test.txt lrwxrwxrwx 1 apache apache 8 Dec 9 11:03 test.ln.txt -> test.txt
Now if I use the following URL everything works (I get the full test.txt file):
http://trac/chrome/site/test.log
If on the other hand I use this URL then it is busted (I only get the first 8 bytes of test.txt):
http://trac/chrome/site/test.ln.log
I'm using Apache 2.0.46 to server up Trac 0.9
I actually tested using a longer file name (even a fully qualified path) and I actually got more data, always correlating with the symlink size. Even though htdocs is under my DocumentRoot I tried to force a FollowSymlinks option for the entire VirtualHost but to no avail. BTW if I take Trac out of the picture and serve up those files through my same VirtualHost directly then the symlinked URL works perfectly. So my guess is (from the name of the URL) that chrome may be munging something... when looking at the file system it doesn't use the right API to get the file size and it instead gets the symlink size.


