public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Broken search on webserver
@ 2020-07-15 20:13 Marco Atzeri
  2020-07-16  4:25 ` Cygwin package search and cygcheck -p urlencoding still broken on new web server Brian Inglis
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Atzeri @ 2020-07-15 20:13 UTC (permalink / raw)
  To: cygwin


Problem: I want to search for
    libssh/libssh.h

Using https://cygwin.com/packages/

If I put the name and press Go the URL is changed in
https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh%2Flibssh.h&arch=x86_64
                                                         ^^^

and the output is
    Found 0 matches for libsshx2Flibssh.h
                              ^^^


Instead if I modify directly the URL in:
https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh/libssh.h&arch=x86_64

Found 3 matches for libssh/libssh.h
....


I guess that the current incapability is due to spurious urlencode in
cgi-bin2/package-grep.cgi
that is modifing the $param_grep

echo '<li><a href="package-cat.cgi?file='`urlencode 
$partfile`'&amp;grep='`urlencode $param_grep`'">'$file'</a> - '$desc'</li>'


Could someone double check my guess ?

Regards
Marco

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin package search and cygcheck -p urlencoding still broken on new web server
  2020-07-15 20:13 Broken search on webserver Marco Atzeri
@ 2020-07-16  4:25 ` Brian Inglis
  2020-07-16  7:44   ` Marco Atzeri
  0 siblings, 1 reply; 6+ messages in thread
From: Brian Inglis @ 2020-07-16  4:25 UTC (permalink / raw)
  To: cygwin, Overseers mailing list

On 2020-07-15 14:13, Marco Atzeri via Cygwin wrote:
> Problem: I want to search for
>    libssh/libssh.h
> Using https://cygwin.com/packages/
> If I put the name and press Go the URL is changed in
> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh%2Flibssh.h&arch=x86_64
> and the output is
>    Found 0 matches for libsshx2Flibssh.h
>                              ^^^
> Instead if I modify directly the URL in:
> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh/libssh.h&arch=x86_64
> Found 3 matches for libssh/libssh.h
> ....
> I guess that the current incapability is due to spurious urlencode in
> cgi-bin2/package-grep.cgi
> that is modifing the $param_grep
> echo '<li><a href="package-cat.cgi?file='`urlencode
> $partfile`'&amp;grep='`urlencode $param_grep`'">'$file'</a> - '$desc'</li>'
> Could someone double check my guess ?

No change since your report on May 2nd, and my cross-post to overseers:

	https://cygwin.com/pipermail/cygwin/2020-May/244684.html

	https://sourceware.org/pipermail/overseers/2020q2/017115.html

where Frank suggested replacing badly urlencoded characters by ".":

$ cygcheck -p libssh/libssh.h
Found 0 matches for libsshx2flibssh.h
$ cygcheck -p libssh.libssh.h
Found 3 matches for libssh.libssh.h
libssh-devel-0.7.3-1 - libssh-devel: SSH implementation library (installed
binaries and support files)
libssh-devel-0.7.5-1 - libssh-devel: SSH implementation library
libssh-devel-0.8.7-1 - libssh-devel: SSH implementation library

The previous break appears to have been fixed by or due to Achim:

	https://cygwin.com/pipermail/cygwin/2019-November/243112.html

Ping Achim?!

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin package search and cygcheck -p urlencoding still broken on new web server
  2020-07-16  4:25 ` Cygwin package search and cygcheck -p urlencoding still broken on new web server Brian Inglis
@ 2020-07-16  7:44   ` Marco Atzeri
  2020-07-16 13:42     ` Jon Turney
  0 siblings, 1 reply; 6+ messages in thread
From: Marco Atzeri @ 2020-07-16  7:44 UTC (permalink / raw)
  To: cygwin

On 16.07.2020 06:25, Brian Inglis wrote:
> On 2020-07-15 14:13, Marco Atzeri via Cygwin wrote:
>> Problem: I want to search for
>>     libssh/libssh.h
>> Using https://cygwin.com/packages/
>> If I put the name and press Go the URL is changed in
>> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh%2Flibssh.h&arch=x86_64
>> and the output is
>>     Found 0 matches for libsshx2Flibssh.h
>>                               ^^^
>> Instead if I modify directly the URL in:
>> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh/libssh.h&arch=x86_64
>> Found 3 matches for libssh/libssh.h
>> ....
>> I guess that the current incapability is due to spurious urlencode in
>> cgi-bin2/package-grep.cgi
>> that is modifing the $param_grep
>> echo '<li><a href="package-cat.cgi?file='`urlencode
>> $partfile`'&amp;grep='`urlencode $param_grep`'">'$file'</a> - '$desc'</li>'
>> Could someone double check my guess ?
> 
> No change since your report on May 2nd, and my cross-post to overseers:
> 
> 	https://cygwin.com/pipermail/cygwin/2020-May/244684.html
> 
> 	https://sourceware.org/pipermail/overseers/2020q2/017115.html
> 
> where Frank suggested replacing badly urlencoded characters by ".":

this works as the dot is not changed

case $c in
             [a-zA-Z0-9.~_-]) printf "$c" ;;
             *) printf '%%%02X' "'$c"

> $ cygcheck -p libssh/libssh.h
> Found 0 matches for libsshx2flibssh.h
> $ cygcheck -p libssh.libssh.h
> Found 3 matches for libssh.libssh.h
> libssh-devel-0.7.3-1 - libssh-devel: SSH implementation library (installed
> binaries and support files)
> libssh-devel-0.7.5-1 - libssh-devel: SSH implementation library
> libssh-devel-0.8.7-1 - libssh-devel: SSH implementation library
> 
> The previous break appears to have been fixed by or due to Achim:
> 
> 	https://cygwin.com/pipermail/cygwin/2019-November/243112.html
> 
> Ping Achim?!
> 

the git logs says that only Frank and Jon have recently worked on

    cgi-bin2/package-grep.cgi

I would like to doble check any possible modification before proposing a
patch to change the web server...

Regards
Marco




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin package search and cygcheck -p urlencoding still broken on new web server
  2020-07-16  7:44   ` Marco Atzeri
@ 2020-07-16 13:42     ` Jon Turney
  2020-07-16 18:48       ` Marco Atzeri
  2020-07-16 20:22       ` Brian Inglis
  0 siblings, 2 replies; 6+ messages in thread
From: Jon Turney @ 2020-07-16 13:42 UTC (permalink / raw)
  To: The Cygwin Mailing List

On 16/07/2020 08:44, Marco Atzeri via Cygwin wrote:
> On 16.07.2020 06:25, Brian Inglis wrote:
>> On 2020-07-15 14:13, Marco Atzeri via Cygwin wrote:
>>> Problem: I want to search for
>>>     libssh/libssh.h
>>> Using https://cygwin.com/packages/
>>> If I put the name and press Go the URL is changed in
>>> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh%2Flibssh.h&arch=x86_64 
>>>
>>> and the output is
>>>     Found 0 matches for libsshx2Flibssh.h
>>>                               ^^^
>>> Instead if I modify directly the URL in:
>>> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh/libssh.h&arch=x86_64 

I think that this is an invalid URL, that just happens to work, so it's 
correct that the link we produce is urlencoded.

(See e.g. https://en.wikipedia.org/wiki/Query_string#URL_encoding)

>>> Found 3 matches for libssh/libssh.h
>>> ....
>>> I guess that the current incapability is due to spurious urlencode in
>>> cgi-bin2/package-grep.cgi
>>> that is modifing the $param_grep
>>> echo '<li><a href="package-cat.cgi?file='`urlencode
>>> $partfile`'&amp;grep='`urlencode $param_grep`'">'$file'</a> - 
>>> '$desc'</li>'
>>> Could someone double check my guess ?

So it seems the urlencode is correct, but the urldecode isn't working.

I've applied a one-character change which appears to fix things.

> the git logs says that only Frank and Jon have recently worked on
> 
>     cgi-bin2/package-grep.cgi
> 
> I would like to double check any possible modification before proposing a
> patch to change the web server...

This was actually fairly easy to reproduce locally, once I realized what 
was going on:

$ export url="libssh%2Flibssh.h" ; printf '%b' "${url//%/\x}"
libsshx2Flibssh.h

$ export url="libssh%2Flibssh.h" ; printf '%b' "${ur//%/\\x}"
libssh/libssh.h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin package search and cygcheck -p urlencoding still broken on new web server
  2020-07-16 13:42     ` Jon Turney
@ 2020-07-16 18:48       ` Marco Atzeri
  2020-07-16 20:22       ` Brian Inglis
  1 sibling, 0 replies; 6+ messages in thread
From: Marco Atzeri @ 2020-07-16 18:48 UTC (permalink / raw)
  To: The Cygwin Mailing List

On 16.07.2020 15:42, Jon Turney wrote:
> On 16/07/2020 08:44, Marco Atzeri via Cygwin wrote:
>> On 16.07.2020 06:25, Brian Inglis wrote:
>>> On 2020-07-15 14:13, Marco Atzeri via Cygwin wrote:
>>>> Problem: I want to search for
>>>>     libssh/libssh.h
>>>> Using https://cygwin.com/packages/
>>>> If I put the name and press Go the URL is changed in
>>>> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh%2Flibssh.h&arch=x86_64 
>>>>
>>>> and the output is
>>>>     Found 0 matches for libsshx2Flibssh.h
>>>>                               ^^^
>>>> Instead if I modify directly the URL in:
>>>> https://cygwin.com/cgi-bin2/package-grep.cgi?grep=libssh/libssh.h&arch=x86_64 
> 
> 
> I think that this is an invalid URL, that just happens to work, so it's 
> correct that the link we produce is urlencoded.
> 
> (See e.g. https://en.wikipedia.org/wiki/Query_string#URL_encoding)
> 
>>>> Found 3 matches for libssh/libssh.h
>>>> ....
>>>> I guess that the current incapability is due to spurious urlencode in
>>>> cgi-bin2/package-grep.cgi
>>>> that is modifing the $param_grep
>>>> echo '<li><a href="package-cat.cgi?file='`urlencode
>>>> $partfile`'&amp;grep='`urlencode $param_grep`'">'$file'</a> - 
>>>> '$desc'</li>'
>>>> Could someone double check my guess ?
> 
> So it seems the urlencode is correct, but the urldecode isn't working.
> 
> I've applied a one-character change which appears to fix things.
> 
>> the git logs says that only Frank and Jon have recently worked on
>>
>>     cgi-bin2/package-grep.cgi
>>
>> I would like to double check any possible modification before proposing a
>> patch to change the web server...
> 
> This was actually fairly easy to reproduce locally, once I realized what 
> was going on:
> 
> $ export url="libssh%2Flibssh.h" ; printf '%b' "${url//%/\x}"
> libsshx2Flibssh.h
> 
> $ export url="libssh%2Flibssh.h" ; printf '%b' "${ur//%/\\x}"
> libssh/libssh.h

Thanks Jon

now the search works fine also with cygcheck -p


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin package search and cygcheck -p urlencoding still broken on new web server
  2020-07-16 13:42     ` Jon Turney
  2020-07-16 18:48       ` Marco Atzeri
@ 2020-07-16 20:22       ` Brian Inglis
  1 sibling, 0 replies; 6+ messages in thread
From: Brian Inglis @ 2020-07-16 20:22 UTC (permalink / raw)
  To: cygwin

On 2020-07-16 07:42, Jon Turney wrote:
> On 16/07/2020 08:44, Marco Atzeri via Cygwin wrote:
>> On 16.07.2020 06:25, Brian Inglis wrote:
>>> On 2020-07-15 14:13, Marco Atzeri via Cygwin wrote:

> So it seems the urlencode is correct, but the urldecode isn't working.
> 
> I've applied a one-character change which appears to fix things.

>> the git logs says that only Frank and Jon have recently worked on
>>
>>     cgi-bin2/package-grep.cgi
>>
>> I would like to double check any possible modification before proposing a
>> patch to change the web server...

> This was actually fairly easy to reproduce locally, once I realized what was
> going on:
> 
> $ export url="libssh%2Flibssh.h" ; printf '%b' "${url//%/\x}"
> libsshx2Flibssh.h
> 
> $ export url="libssh%2Flibssh.h" ; printf '%b' "${ur//%/\\x}"
> libssh/libssh.h

Doh! Good catch! Been an annoyance for months.
I didn't realize cgi-bin scripts were visible under cygwin-htdocs/cgi-bin2.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-16 20:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 20:13 Broken search on webserver Marco Atzeri
2020-07-16  4:25 ` Cygwin package search and cygcheck -p urlencoding still broken on new web server Brian Inglis
2020-07-16  7:44   ` Marco Atzeri
2020-07-16 13:42     ` Jon Turney
2020-07-16 18:48       ` Marco Atzeri
2020-07-16 20:22       ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).