You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2023/01/20 15:50:58 UTC

[Bug 66437] New: VirtualDocumentRoot %N.M method with multiple digit numbers not working

https://bz.apache.org/bugzilla/show_bug.cgi?id=66437

            Bug ID: 66437
           Summary: VirtualDocumentRoot %N.M method with multiple digit
                    numbers not working
           Product: Apache httpd-2
           Version: 2.4.18
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: mod_vhost_alias
          Assignee: bugs@httpd.apache.org
          Reporter: martin.valasik@wisdomfactory.sk
  Target Milestone: ---

Hello,

We have detected an issue with selecting substring for VirtualDocumentRoot
using "%N.M" method. We are using negative values for removing the part of the
domain.

Problem: when we need to use number with multiple digits the solution is not
working. Created path does not contains the expected path (only some
letters/chars).

* Sample domain: data-samplesubdomain.sub.example.com
* VirtualDocumentRoot "/opt/staging/%1.-16+"

When used shortened domain which requires only single digit numbers for the
rule, then everything works fine:
* Sample domain: data-sample.sub.example.com
* VirtualDocumentRoot "/opt/staging/%1.-8+"
* Result: /opt/staging/data


Martin

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66437] VirtualDocumentRoot %N.M method with multiple digit numbers not working

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66437

--- Comment #1 from Rich Bowen <rb...@apache.org> ---
I thought that this fact was documented (it's not) and I know that I've
mentioned it many times as a limitation, over the years, in presentations given
about this module.

Yes, N and M are limited to the range -9 to 9.

Which isn't to say that your bug report is false. Just that this is
known/expected behavior. (That said, this could certainly be a worthwhile
improvement to the module.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66437] VirtualDocumentRoot %N.M method with multiple digit numbers not working

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66437

--- Comment #2 from Christophe JAILLET <ch...@wanadoo.fr> ---
Created attachment 38484
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38484&action=edit
Patch to remove the <9 limitation for N and M

Hi,

attached a patch that should remove the limitation of N or M <= 9.

Basically, the improvements are:
  - parse the format string only once at start-up and stores each part in a
link chain
  - N and M can be up to an 'int'
  - handle the invariant parts of the "interpolated-directory" one string at a
time, instead of one char at a time

So, I hope that it should also save a few cycles at runtime and easy any other
format extension.

This passes the test-framework modified with:
   VirtualDocumentRoot htdocs/modules/vhost_alias/%2/%1.15/%-2/%2+
                                                       ~~~~


Feedback on the WIP welcomed.


I'll continue on it next week in order to:
   - use varbuf to avoid the final copy of the string and remove the
HUGE_STRING_LEN (8192) limitation

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org