New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCRE expressions with capture groups are not being handled properly #1300
Comments
Your newer ProFTPD version was built using the |
Hmm. There are some interesting discrepancies in your reported logs. For example, from the ProFTPD 1.3.6c logs you provided:
Why do we see both POSIX and PCRE regexes reported, if your ProFTPD 1.3.6c was not built with PCRE support? And for the provided 1.3.7a log messages:
where is that
Are you saying that your |
Hi @Castaglia. I tried pushing the settings from the 1.3.6c server to the 1.3.7a server, but the co-worker that created the new server created it very differently and I could not get it to work. I tried to modify them to get it to work, but to no avail. Every time I logged in and it tried to get the folder list, it would just hang. I believed the issue was because mod_rewrite was not rewriting the path properly, but perhaps it is because of the |
I recall seeing some kind of conflicts when given an example for this kind of rewrite rule: |
The number of backslash (
The reason for the extra backslashes in the second construction is that it is enclosed in double quotes, which add extra escaping requirements. |
However, the more I dig into this locally, the more evidence I find that this is a bug in ProFTPD's handling of matched PCRE (vs POSIX) regular expressions; it is not processing the matched groups properly. In addition, I think it would be nice if ProFTPD had a way to say "I only want to use POSIX regexes, even if PCRE support is enabled" as well. |
That is odd because in the VirtualHost on the 1.3.6c server it has this which works correctly:
Perhaps on the 1.3.7a server I need to use |
FYI, if you look at #1282, you will see that on our 1.3.6c server, it is also built using the |
Due to the bug where matched PCRE expressions do not have the matched/captured groups handled properly, it won't matter what number of backslashes are used, unfortunately. It's a code bug. What's interesting, then, is that your 1.3.6c server, with
which is probably why it is working as you expect, given that it is matching as a POSIX regular expression, not a PCRE expression. |
That is why I was wondering if perhaps PCRE is using BRE instead of ERE. What I do find interesting is that this is in the rewrite logs, which indicates that maybe it is not capturing the data??:
|
FYI, I just tried |
…sue1300 Issue #1300: Properly implement capturing groups for PCRE expressions.
This should now be fixed in master; fix was backported to the 1.3.7 branch. |
Wow! Thank you. |
Looking at the commit more closely, it appears that the change is not specific to mod_rewrite.c. |
Unfortunately, the core issue/problem was in the core Regexp API in ProFTPD; the |
…ndle all regular expressions as POSIX, regardless of PCRE support.
…ndle all regular expressions as POSIX, regardless of PCRE support.
As a follow-on to Issue #1300, make it possible to tell ProFTPD to ha…
I believe I have informed the package maintainers of this issue (hopefully correctly). |
So apparently launchpad.net was the wrong place to log this for the package maintainers to be made aware. Apparently they can only be logged using the reportbug app or by email (boooo, hiss!), sigh. |
What was done
We are setting up a new ftp server because we need to move it off site for dumb reasons IMHO.
I used the same rewrite entries that are currently working in the 1.3.6c version, but cannot get it to work.
I enabled all kinds of logging and see something that seems peculiar in the trace logs.
On the v1.3.6c server I see this:
On the v1.3.7a server I see this instead (where it does not work):
Notice that the new server is not mentioning POSIX. This makes me think I need to somehow enable POSIX support. I hope it just requires a minor change to the proftpd.config files, or the installation of a missing package as opposed to an issue with the proftpd package available for this version of Ubuntu.
Note that I checked to see if a new version of the proftpd package was available, but it did not find any.
**Also
decoded '/folder1/folder2' into '/folder1/folder2'
seems wrong. I would think it should bedecoded '/folder1\folder2' into '/folder1/folder2'
.ProFTPD Version and Configuration
ProFTPD Version 1.3.7a installed on Ubuntu 21.04 (GNU/Linux 5.11.0-25-generic x86_64)
It appears to be the "proftpd-core" package.
Output from
proftpd -V
:proftpd.conf:
The text was updated successfully, but these errors were encountered: