From nobody Tue Mar 1 13:45:25 2022 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 69D6F19EFBF4 for ; Tue, 1 Mar 2022 13:45:31 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4K7JRG1pHBz4rJT for ; Tue, 1 Mar 2022 13:45:30 +0000 (UTC) (envelope-from ronald-lists@klop.ws) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=klop.ws; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References: To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=t566FO524Wkk5EeeT8Ozy6YaymFqTK+YxUeWKcEvq9g=; b=SnUqi3dh/AbhqLFLxx+JFXwQI4 ZIzfkJgtYRjUxQxdY571mAyu4CaTegPSea59MQS6yZWg6DqN0wTupngEFXD4/whbqRcG5LakmpWnY WEEVfLqUAWOzmNXntGWSdYf8j06bYy2pFaF2Wh5OsRoqbzyW1Pe0bjmVs4VX1cuza/8s=; Message-ID: Date: Tue, 1 Mar 2022 14:45:25 +0100 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: pkgs contain non URL safe characters Content-Language: en-US To: Aristedes Maniatis , freebsd-ports@FreeBSD.org References: <378a27ca-dbfe-d6f4-45f6-2ff90265874e@ish.com.au> From: Ronald Klop In-Reply-To: <378a27ca-dbfe-d6f4-45f6-2ff90265874e@ish.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.greenhost.nl X-Spam-Level: / X-Spam-Score: -0.4 X-Spam-Status: No, score=-0.4 required=5.0 tests=ALL_TRUSTED,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.2 X-Scan-Signature: ba572e8a3bde05b4b19613c12a9e49fc X-Rspamd-Queue-Id: 4K7JRG1pHBz4rJT X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=mail header.b=SnUqi3dh; dmarc=pass (policy=quarantine) header.from=klop.ws; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[klop.ws:s=mail]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.190.28.64/27]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RWL_MAILSPIKE_EXCELLENT(0.00)[195.190.28.88:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[klop.ws:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[195.190.28.88:from]; NEURAL_HAM_SHORT(-0.99)[-0.994]; DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine]; MLMMJ_DEST(0.00)[freebsd-ports]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 3/1/22 14:25, Aristedes Maniatis wrote: > On 1/3/2022 10:57pm, Ronald Klop wrote: > >> >> The + character is not special in this part of the URL. The request send by pkg is compliant to the specs. >> >> I'm aware of having specs and having what browsers and servers do in real life. >> Why does Cloudfront decode a + to a space in this part of the URL? >> >> Regards, >> Ronald. > > > You are exactly correct. Turns out that AWS S3 is not following RFC 1866 and hasn't since the beginning. And I'm guessing it is now too late. With this new information I've finally found a thread complaining about this (it affects other repos like apt). > > https://forums.aws.amazon.com/thread.jspa?threadID=55746 > > > My little hack of renaming openjdk packages will have to stay I guess. > > > Thanks > > Ari > You could try the untested patch below as "compatibility fix", but I'm not sure if that will not break other valid URLs passed to fetch/pkg. Apparently pkg embeds libfetch statically: https://github.com/freebsd/pkg/tree/master/external/libfetch . This patch is against the FreeBSD base. diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 82a3c5e451a..496425cea47 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -451,7 +451,7 @@ fetchParseURL(const char *URL) } u->doc = doc; while (*p != '\0') { - if (!isspace((unsigned char)*p)) { + if (!isspace((unsigned char)*p) && *p != '+') { *doc++ = *p++; } else { *doc++ = '%';