X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E51F938930E8
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1594925326;
	bh=WHQ+pWXShOpxe2Fj9PSPDPWZNKZNrOE4bO1aL0SfWKc=;
	h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=WxNtCVH1gSZ0rfM4+Z3JfzC3XELJjUiArctQ6H7MdHgYUmXgqTdGqgMeLr4sGfzEq
	 wSAsXvUOsjxsFGhOjIgWcafVVF/TvgX78GUOmVQrAGb4lnQOgasUN8is5E69XEXiK4
	 I3CKHgX3SBUi6gOvya4uj23Iso6uoExcTJB2fBgE=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D34C83857C45
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:subject:to:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=kHDDA2sUWUDhFjcpeDvMczedFwBruD6kfEbM9Tun7oI=;
 b=mxCGYKGARetbG8TF9g2x9YamgDthDHs8P1FfzObb7w9VwD/BoxFwAn93KwPOUvbexy
 p71FC37QbxyA7Cx3f7Hg0YX0SVc42RuKTCGDz1Idh9D1kBpPtnF0W+Ryu2/uXvVYu3uL
 CwvY3j9YUPu8aHx9jUlDW3V+/kqU2aW9TlPA19pO+kbObj3t7YpvCaC+dZG05FeMeDUg
 QOGtj3Y1I0pjpBOXqINCtjhkp+sbrki8E5jXrD3v/IGpcxQl9B9ueR3UEmIl7hzBCYUW
 48iJUthYDqC0ydkD7Oga0ccnZ7QfRuSpX4sTNoCfciHxPp6VFdvpbAEytm1Lz46PJ0Z8
 3ypw==
X-Gm-Message-State: AOAM530/uWyWXGPjJ6/kgGfXfO/BxJmk0Jj75z6FmqBwGw2fiZd1kHwp
 6MjgRmRGwWJspmf0JiWDjbcsng2N2Tc=
X-Google-Smtp-Source: ABdhPJxfYtBf98kC1XNaEi5DTNPixic5d7QbSZipf0RqhHvR9AEKv4fpUfLKnbYPNMOL44c57VYoDg==
X-Received: by 2002:a17:906:4dd4:: with SMTP id
 f20mr5391890ejw.170.1594925321630; 
 Thu, 16 Jul 2020 11:48:41 -0700 (PDT)
Subject: Re: Cygwin package search and cygcheck -p urlencoding still broken on
 new web server
To: The Cygwin Mailing List <cygwin@cygwin.com>
References: <f78e2eaf-07d6-a9bd-ee84-e6414131b23b@gmail.com>
 <9c03bed5-da26-512c-3c31-ed6cd59f8043@SystematicSw.ab.ca>
 <f6e7d3b9-eef8-5991-59f8-905db3a8fc53@gmail.com>
 <acc98a4e-68e5-d70e-6271-50c6f0dfb364@dronecode.org.uk>
Message-ID: <e6132688-a797-c267-2eae-7eb79475506e@gmail.com>
Date: Thu, 16 Jul 2020 20:48:39 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <acc98a4e-68e5-d70e-6271-50c6f0dfb364@dronecode.org.uk>
Content-Language: it
X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00, BODY_8BITS,
 DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM,
 RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <http://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <http://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Marco Atzeri via Cygwin <cygwin@cygwin.com>
Reply-To: Marco Atzeri <marco.atzeri@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: cygwin-bounces@cygwin.com
Sender: "Cygwin" <cygwin-bounces@cygwin.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 06GInCC5000376

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

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

