logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_xsendfile 1.0 :: updated
Author
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3214
Location: Hilversum, NL, EU

PostPosted: Fri 17 Feb '12 22:43    Post subject: mod_xsendfile 1.0 :: updated Reply with quote

Module mod_xsendfile is now available for 2.4.

Includes the fix at https://github.com/nmaier/mod_xsendfile/issues/8 , it fixes the famous " (70008) Partial results..." error.


What is mod_xsendfile ?

mod_xsendfile is a module that processes X-SENDFILE headers registered by the original output handler.

If it encounters the presence of such header it will discard all output and send the file specified by that header instead using Apache internals including all optimizations like caching-headers and sendfile or mmap if configured.

It is useful for processing script-output of e.g. php, perl or any cgi.

Steffen


Last edited by Steffen on Mon 27 Apr '26 15:56; edited 3 times in total
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 768

PostPosted: Sun 11 Jun '17 12:03    Post subject: Reply with quote

VC15 added
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 768

PostPosted: Mon 17 Jun '19 14:47    Post subject: Reply with quote

VS16 added
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3214
Location: Hilversum, NL, EU

PostPosted: Tue 08 Nov '22 13:19    Post subject: Reply with quote

Available now for VS17
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3214
Location: Hilversum, NL, EU

PostPosted: Mon 27 Apr '26 15:51    Post subject: Reply with quote

Updated to mod_xsendfile-1.0-P1.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7486
Location: EU, Germany, Next to Hamburg

PostPosted: Sat 02 May '26 9:00    Post subject: Reply with quote

I was a bit tired of patching the file over and over again for my build. So I made a fork on github and updated the source code. https://github.com/JBlond/mod_xsendfile
Back to top
MIP



Joined: 06 Feb 2026
Posts: 4

PostPosted: Tue 05 May '26 17:51    Post subject: Reply with quote

Hello,
after upgrading from VS17 to VS18, I am seeing an issue with UNC paths that worked correctly before.
With mod_xsendfile on VS17, serving files from a UNC path works fine.
With VS18, access is denied and Apache logs:
Code:
AH10504: check_unc: UNC path //example/share/... not allowed by UNCList


With both VS17 and VS18, local files served through xsendfile work correctly.
Simplified config (anonymized):
Code:
XSendFile On
XSendFilePath "//FILESERV01/share"

<Directory "//FILESERV01/share">
    Require all granted
</Directory>

UNCList FILESERV01


I have tried different UNCList combinations without success.
Is this behavior intentional in the VS18 builds?
Is there a recommended way to allow UNC paths now?
Thanks
Back to top
Laky



Joined: 08 Oct 2026
Posts: 2
Location: Europe

PostPosted: Fri 09 Oct '26 13:26    Post subject: Reply with quote

I am facing the same issue that MIP describes.
Downloading files from network share through this version of xsendfile is not working.

I tried to change the slashes "/" in XSendFilePath to "\".
In first case it won't parse the server name correctly and requested URL won't match the configured server name in the UNCList.
In the other case the path is not found by xsendfile, because it is invalid.

Code:
(13)Permission denied: [client 127.0.0.1:11111] xsendfile: unable to find file: \\server1.domain.some\data\file
...
(13)Permission denied: AH10504: check_unc: UNC path //server1.domain.some/ not allowed by UNCList
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 471
Location: UK

PostPosted: Fri 16 Oct '26 23:41    Post subject: Reply with quote

Re this UNC path problem, your error code appears to originate in Apache core's check_unc() function, so you could try enabling trace logging temporarily:
Code:
LogLevel trace4

Then reproduce the request and look for log messages such as:
    check_unc: check converted path ...
    check_unc: no match ...
    check_unc: UNC path ... not allowed by UNCList
The no match message should reveal which hostname Apache actually parsed and which configured hostname it compared against.

Apache documentation for UNCLIST says: "This directive should be placed before UNC paths used in httpd.conf. Multiple occurrences of the directive reset the list."

See https://httpd.apache.org/docs/current/mod/core.html#unclist

So what happens if you try this revised ordering in your configuration?
Code:
# Define the permitted network host first
#
UNCList FILESERV01

XSendFile On
XSendFilePath "//FILESERV01/share"

<Directory "//FILESERV01/share">
    Require all granted
</Directory>
Back to top
Laky



Joined: 08 Oct 2026
Posts: 2
Location: Europe

PostPosted: Mon 19 Oct '26 9:31    Post subject: Reply with quote

Seem like xsendfile VS18 handles slashes differently and we have to make sure to sanitize network share paths.

Hope this helps to replicate..

Apache/2.4.68 (Win64) PHP/8.5.9
Apache Lounge VS18 Server built: Jun 6 2026 11:03:46

Code:
UNClist NAS01
<IfModule xsendfile_module>
    XSendFile on
    XSendFilePath "//NAS01/WebData/xsendtest/"
</IfModule>


Code:
<?php
$filePath = '//NAS01\WebData\xsendtest/test.txt';


xsendfile VS17 - OK (notice, there is no check_unc?)
Quote:
[Mon Oct 19 09:10:27.925786 2026] [authz_core:debug] [pid 11028:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61420] AH01626: authorization result of Require all granted: granted
[Mon Oct 19 09:10:27.925786 2026] [authz_core:debug] [pid 11028:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61420] AH01626: authorization result of <RequireAny>: granted
[Mon Oct 19 09:10:27.925786 2026] [core:trace3] [pid 11028:tid 1324] request.c(360): [client 127.0.0.1:61420] request authorized without authentication by access_checker_ex hook: /
[Mon Oct 19 09:10:28.338212 2026] [http:trace3] [pid 11028:tid 1324] http_filters.c(1146): [client 127.0.0.1:61420] Response sent with status 200, headers:
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] X-Powered-By: PHP/8.5.9
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] Content-Disposition: attachment; filename=\\"test.txt\\"
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] Last-Modified: Sat, 17 Oct 2026 21:33:25 GMT
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] ETag: \\"5-65e2c18fcb2a0\\"
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] Content-Length: 5
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] Keep-Alive: timeout=5, max=100
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] Connection: Keep-Alive
[Mon Oct 19 09:10:28.338212 2026] [http:trace4] [pid 11028:tid 1324] http_filters.c(971): [client 127.0.0.1:61420] Content-Type: text/plain;charset=UTF-8


xsendfile VS18 - fail
Quote:
[Mon Oct 19 09:10:56.938957 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61447] AH01626: authorization result of Require all granted: granted
[Mon Oct 19 09:10:56.938957 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61447] AH01626: authorization result of <RequireAny>: granted
[Mon Oct 19 09:10:56.938957 2026] [core:trace3] [pid 22768:tid 1324] request.c(360): [client 127.0.0.1:61447] request authorized without authentication by access_checker_ex hook: /
[Mon Oct 19 09:10:56.939986 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01\\WebData\\xsendtest/test.txt allowed 1
[Mon Oct 19 09:10:56.939986 2026] [core:trace4] [pid 22768:tid 1324] core.c(5710): check_unc: no match NAS01\\WebData\\xsendtest NAS01
[Mon Oct 19 09:10:56.939986 2026] [core:error] [pid 22768:tid 1324] (13)Permission denied: AH10504: check_unc: UNC path //NAS01\\WebData\\xsendtest/test.txt not allowed by UNCList
[Mon Oct 19 09:10:56.939986 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01/WebData/xsendtest/ allowed 1
[Mon Oct 19 09:10:56.939986 2026] [core:trace4] [pid 22768:tid 1324] core.c(5704): check_unc: match NAS01 NAS01
[Mon Oct 19 09:10:56.939986 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01\\WebData\\xsendtest/test.txt allowed 1
[Mon Oct 19 09:10:56.939986 2026] [core:trace4] [pid 22768:tid 1324] core.c(5710): check_unc: no match NAS01\\WebData\\xsendtest NAS01
[Mon Oct 19 09:10:56.939986 2026] [core:error] [pid 22768:tid 1324] (13)Permission denied: AH10504: check_unc: UNC path //NAS01\\WebData\\xsendtest/test.txt not allowed by UNCList
[Mon Oct 19 09:10:56.939986 2026] [:error] [pid 22768:tid 1324] (13)Permission denied: [client 127.0.0.1:61447] xsendfile: unable to find file: //NAS01\\WebData\\xsendtest/test.txt
[Mon Oct 19 09:10:56.939986 2026] [http:trace3] [pid 22768:tid 1324] http_filters.c(1146): [client 127.0.0.1:61447] Response sent with status 404, headers:


When i change path to file:

<?php
$filePath = '\\NAS01\WebData\xsendtest/test.txt';

Quote:
[Mon Oct 19 09:11:25.991857 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61458] AH01626: authorization result of Require all granted: granted
[Mon Oct 19 09:11:25.991857 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61458] AH01626: authorization result of <RequireAny>: granted
[Mon Oct 19 09:11:25.991857 2026] [core:trace3] [pid 22768:tid 1324] request.c(360): [client 127.0.0.1:61458] request authorized without authentication by access_checker_ex hook: /
[Mon Oct 19 09:11:25.991857 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01/WebData/xsendtest/ allowed 1
[Mon Oct 19 09:11:25.991857 2026] [core:trace4] [pid 22768:tid 1324] core.c(5704): check_unc: match NAS01 NAS01
[Mon Oct 19 09:11:25.991857 2026] [:error] [pid 22768:tid 1324] (20023)The given path was above the root path: [client 127.0.0.1:61458] xsendfile: unable to find file: \\NAS01\\WebData\\xsendtest/test.txt
[Mon Oct 19 09:11:25.991857 2026] [http:trace3] [pid 22768:tid 1324] http_filters.c(1146): [client 127.0.0.1:61458] Response sent with status 404, headers:


<?php
$filePath = '\\NAS01\WebData\xsendtest\test.txt';

Quote:
[Mon Oct 19 09:12:42.298746 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61489] AH01626: authorization result of Require all granted: granted
[Mon Oct 19 09:12:42.298746 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61489] AH01626: authorization result of <RequireAny>: granted
[Mon Oct 19 09:12:42.298746 2026] [core:trace3] [pid 22768:tid 1324] request.c(360): [client 127.0.0.1:61489] request authorized without authentication by access_checker_ex hook: /
[Mon Oct 19 09:12:42.298746 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01/WebData/xsendtest/ allowed 1
[Mon Oct 19 09:12:42.298746 2026] [core:trace4] [pid 22768:tid 1324] core.c(5704): check_unc: match NAS01 NAS01
[Mon Oct 19 09:12:42.298746 2026] [:error] [pid 22768:tid 1324] (20023)The given path was above the root path: [client 127.0.0.1:61489] xsendfile: unable to find file: \\NAS01\\WebData\\xsendtest\\test.txt
[Mon Oct 19 09:12:42.298746 2026] [http:trace3] [pid 22768:tid 1324] http_filters.c(1146): [client 127.0.0.1:61489] Response sent with status 404, headers:


<?php
$filePath = '//NAS01/WebData/xsendtest/test.txt';
- OK
Quote:
[Mon Oct 19 09:22:41.169366 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61743] AH01626: authorization result of Require all granted: granted
[Mon Oct 19 09:22:41.169366 2026] [authz_core:debug] [pid 22768:tid 1324] mod_authz_core.c(815): [client 127.0.0.1:61743] AH01626: authorization result of <RequireAny>: granted
[Mon Oct 19 09:22:41.169366 2026] [core:trace3] [pid 22768:tid 1324] request.c(360): [client 127.0.0.1:61743] request authorized without authentication by access_checker_ex hook: /
[Mon Oct 19 09:22:41.170366 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01/WebData/xsendtest/test.txt allowed 1
[Mon Oct 19 09:22:41.170366 2026] [core:trace4] [pid 22768:tid 1324] core.c(5704): check_unc: match NAS01 NAS01
[Mon Oct 19 09:22:41.189557 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01/WebData/xsendtest/ allowed 1
[Mon Oct 19 09:22:41.189557 2026] [core:trace4] [pid 22768:tid 1324] core.c(5704): check_unc: match NAS01 NAS01
[Mon Oct 19 09:22:41.189557 2026] [core:trace4] [pid 22768:tid 1324] core.c(5692): check_unc: check converted path //NAS01/WebData/xsendtest/test.txt allowed 1
[Mon Oct 19 09:22:41.189557 2026] [core:trace4] [pid 22768:tid 1324] core.c(5704): check_unc: match NAS01 NAS01
[Mon Oct 19 09:22:41.367385 2026] [http:trace3] [pid 22768:tid 1324] http_filters.c(1146): [client 127.0.0.1:61743] Response sent with status 200, headers:
Back to top


Reply to topic   Topic: mod_xsendfile 1.0 :: updated View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules