diff mbox

[FFmpeg-devel,2/2] Revert "lavf/utils: Allow url credentials to contain a slash."

Message ID 20190505185109.20957-2-cus@passwd.hu
State Accepted
Commit c61d16cf3b815388c076c2a35b5c91e84b45d7be
Headers show

Commit Message

Marton Balint May 5, 2019, 6:51 p.m. UTC
This reverts commit dd06f022b07438d650c82255dff16908ba04244a.

Fixes ticket #7871 and reopens ticket #7816.

The introduced regression caused URL's with @ in them to be parsed incorrectly
which is a bigger issue then not being able to specify the slash character as a
password.

I think there are better ways to fix the original issue, like being able to
specify HTTP username and password as a protocol option, or adding a protocol
option to percent-decode the URL first.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/utils.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Carl Eugen Hoyos May 5, 2019, 7:07 p.m. UTC | #1
Am So., 5. Mai 2019 um 20:51 Uhr schrieb Marton Balint <cus@passwd.hu>:
>
> This reverts commit dd06f022b07438d650c82255dff16908ba04244a.
>
> Fixes ticket #7871 and reopens ticket #7816.

I'll send an alternative patch in a moment.

Carl Eugen
Marton Balint May 14, 2019, 8:34 p.m. UTC | #2
On Sun, 5 May 2019, Carl Eugen Hoyos wrote:

> Am So., 5. Mai 2019 um 20:51 Uhr schrieb Marton Balint <cus@passwd.hu>:
>>
>> This reverts commit dd06f022b07438d650c82255dff16908ba04244a.
>>
>> Fixes ticket #7871 and reopens ticket #7816.
>
> I'll send an alternative patch in a moment.

Ping for this, I still think the revert is the best we can do here.

Regards,
Marton
Hendrik Leppkes May 14, 2019, 8:43 p.m. UTC | #3
On Tue, May 14, 2019 at 10:34 PM Marton Balint <cus@passwd.hu> wrote:
>
>
>
> On Sun, 5 May 2019, Carl Eugen Hoyos wrote:
>
> > Am So., 5. Mai 2019 um 20:51 Uhr schrieb Marton Balint <cus@passwd.hu>:
> >>
> >> This reverts commit dd06f022b07438d650c82255dff16908ba04244a.
> >>
> >> Fixes ticket #7871 and reopens ticket #7816.
> >
> > I'll send an alternative patch in a moment.
>
> Ping for this, I still think the revert is the best we can do here.
>

I agree. Slashes are flat out not allowed in that part of the URI and
will always result in ambigious parsing.

- Hendrik
Marton Balint May 18, 2019, 2:48 p.m. UTC | #4
On Tue, 14 May 2019, Hendrik Leppkes wrote:

> On Tue, May 14, 2019 at 10:34 PM Marton Balint <cus@passwd.hu> wrote:
>>
>>
>>
>> On Sun, 5 May 2019, Carl Eugen Hoyos wrote:
>>
>> > Am So., 5. Mai 2019 um 20:51 Uhr schrieb Marton Balint <cus@passwd.hu>:
>> >>
>> >> This reverts commit dd06f022b07438d650c82255dff16908ba04244a.
>> >>
>> >> Fixes ticket #7871 and reopens ticket #7816.
>> >
>> > I'll send an alternative patch in a moment.
>>
>> Ping for this, I still think the revert is the best we can do here.
>>
>
> I agree. Slashes are flat out not allowed in that part of the URI and
> will always result in ambigious parsing.

Will apply soon.

Regards,
Marton
Carl Eugen Hoyos May 18, 2019, 9:05 p.m. UTC | #5
> Am 18.05.2019 um 16:48 schrieb Marton Balint <cus@passwd.hu>:
> 
> 
> 
>>> On Tue, 14 May 2019, Hendrik Leppkes wrote:
>>> 
>>> On Tue, May 14, 2019 at 10:34 PM Marton Balint <cus@passwd.hu> wrote:
>>> 
>>> 
>>> 
>>>> On Sun, 5 May 2019, Carl Eugen Hoyos wrote:
>>>> 
>>>>> Am So., 5. Mai 2019 um 20:51 Uhr schrieb Marton Balint <cus@passwd.hu>:
>>>>> 
>>>>> This reverts commit dd06f022b07438d650c82255dff16908ba04244a.
>>>>> 
>>>>> Fixes ticket #7871 and reopens ticket #7816.
>>>> 
>>>> I'll send an alternative patch in a moment.
>>> 
>>> Ping for this, I still think the revert is the best we can do here.
>> 
>> I agree. Slashes are flat out not allowed in that part of the URI and
>> will always result in ambigious parsing.
> 
> Will apply soon.

Please do if you don’t see a better solution.

Carl Eugen
Marton Balint May 18, 2019, 10:42 p.m. UTC | #6
On Sat, 18 May 2019, Carl Eugen Hoyos wrote:

>
>
>> Am 18.05.2019 um 16:48 schrieb Marton Balint <cus@passwd.hu>:
>> 
>> 
>> 
>>>> On Tue, 14 May 2019, Hendrik Leppkes wrote:
>>>> 
>>>> On Tue, May 14, 2019 at 10:34 PM Marton Balint <cus@passwd.hu> wrote:
>>>> 
>>>> 
>>>> 
>>>>> On Sun, 5 May 2019, Carl Eugen Hoyos wrote:
>>>>> 
>>>>>> Am So., 5. Mai 2019 um 20:51 Uhr schrieb Marton Balint <cus@passwd.hu>:
>>>>>> 
>>>>>> This reverts commit dd06f022b07438d650c82255dff16908ba04244a.
>>>>>> 
>>>>>> Fixes ticket #7871 and reopens ticket #7816.
>>>>> 
>>>>> I'll send an alternative patch in a moment.
>>>> 
>>>> Ping for this, I still think the revert is the best we can do here.
>>> 
>>> I agree. Slashes are flat out not allowed in that part of the URI and
>>> will always result in ambigious parsing.
>> 
>> Will apply soon.
>
> Please do if you don’t see a better solution.

Thanks, applied.

Regards,
Marton
diff mbox

Patch

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a63d71b0f4..6ef94239a4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4730,7 +4730,7 @@  void av_url_split(char *proto, int proto_size,
                   char *hostname, int hostname_size,
                   int *port_ptr, char *path, int path_size, const char *url)
 {
-    const char *p, *ls, *ls2, *ls3, *at, *at2, *col, *brk;
+    const char *p, *ls, *ls2, *at, *at2, *col, *brk;
 
     if (port_ptr)
         *port_ptr = -1;
@@ -4760,9 +4760,6 @@  void av_url_split(char *proto, int proto_size,
     /* separate path from hostname */
     ls = strchr(p, '/');
     ls2 = strchr(p, '?');
-    ls3 = strchr(p, '@');
-    if (ls3 && ls3 > ls && (!ls2 || ls2 > ls3))
-        ls = strchr(ls3, '/');
     if (!ls)
         ls = ls2;
     else if (ls && ls2)