From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <58c9642d045fccb81dc7201341856fa2@ipgp.jussieu.fr> To: 9fans@9fans.net From: "Mathieu Lonjaret" Date: Fri, 27 Mar 2009 14:10:48 +0100 In-Reply-To: <9ab217670903270552o64036bc6l822ca1f6e73ec82f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-vehxeelocwfhhrpbttfazpscst" Subject: Re: [9fans] another webfs question Topicbox-Message-UUID: cb1e19e8-ead4-11e9-9d60-3106f5b1d025 This is a multi-part message in MIME format. --upas-vehxeelocwfhhrpbttfazpscst Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Ok, thanks to both. In the meanwhile, mjl pointed me to http://www.ietf.org/rfc/rfc3986.txt, sect. 7.3, where this can found: "Note, however, that the "%00" percent-encoding (NUL) may require special handling and should be rejected if the application is not expecting to receive raw data within a component." This apparently could be the reason behind the current behaviour of webfs. I'll try and fix that in webfs unless somebody beats me to it (please do! ;) ). Cheers, Mathieu --upas-vehxeelocwfhhrpbttfazpscst Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: lejatorn@smgl.fr.eu.org Delivered-To: lejatorn@smgl.fr.eu.org Received: by serenity.smgl.fr.eu.org (Postfix, from userid 58) id 48C347E838; Fri, 27 Mar 2009 13:55:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on serenity.smgl.fr.eu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, HTTP_EXCESSIVE_ESCAPES,WEIRD_PORT autolearn=no version=3.2.5 Received: from mail-bw0-f170.google.com (mail-bw0-f170.google.com [209.85.218.170]) by serenity.smgl.fr.eu.org (Postfix) with ESMTP id 5C87D7E81B for ; Fri, 27 Mar 2009 13:55:55 +0100 (CET) Received: by bwz18 with SMTP id 18so1178278bwz.11 for ; Fri, 27 Mar 2009 05:55:54 -0700 (PDT) Received: by 10.204.103.209 with SMTP id l17mr691973bko.152.1238158554206; Fri, 27 Mar 2009 05:55:54 -0700 (PDT) X-Forwarded-To: lejatorn@smgl.fr.eu.org X-Forwarded-For: lejatorn@gmail.com lejatorn@smgl.fr.eu.org Delivered-To: lejatorn@gmail.com Received: by 10.204.99.77 with SMTP id t13cs101094bkn; Fri, 27 Mar 2009 05:55:53 -0700 (PDT) Received: by 10.150.206.1 with SMTP id d1mr4081424ybg.6.1238158552382; Fri, 27 Mar 2009 05:55:52 -0700 (PDT) Received: from gouda.swtch.com (gouda.swtch.com [67.207.142.3]) by mx.google.com with ESMTP id 21si1688518gxk.78.2009.03.27.05.55.51; Fri, 27 Mar 2009 05:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of 9fans-bounces+lejatorn=gmail.com@9fans.net designates 67.207.142.3 as permitted sender) client-ip=67.207.142.3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of 9fans-bounces+lejatorn=gmail.com@9fans.net designates 67.207.142.3 as permitted sender) smtp.mail=9fans-bounces+lejatorn=gmail.com@9fans.net Received: from localhost ([127.0.0.1] helo=gouda.swtch.com) by gouda.swtch.com with esmtp (Exim 4.67) (envelope-from <9fans-bounces@9fans.net>) id 1LnBYK-0003yL-4A; Fri, 27 Mar 2009 12:52:52 +0000 Received: from an-out-0708.google.com ([209.85.132.249]) by gouda.swtch.com with esmtp (Exim 4.67) (envelope-from ) id 1LnBYH-0003yG-Kj for 9fans@9fans.net; Fri, 27 Mar 2009 12:52:49 +0000 Received: by an-out-0708.google.com with SMTP id b2so1108562ana.42 for <9fans@9fans.net>; Fri, 27 Mar 2009 05:52:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.19.70 with SMTP id z6mr445852iba.24.1238158368652; Fri, 27 Mar 2009 05:52:48 -0700 (PDT) In-Reply-To: <5ab04e072064bfe53f47b5a785bc41ec@quanstro.net> References: <3587eb7837ae411c3c512564d9997e1c@smgl.fr.eu.org> <5ab04e072064bfe53f47b5a785bc41ec@quanstro.net> Date: Fri, 27 Mar 2009 08:52:48 -0400 Message-ID: <9ab217670903270552o64036bc6l822ca1f6e73ec82f@mail.gmail.com> From: "Devon H. O'Dell" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] another webfs question X-BeenThere: 9fans@9fans.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.9fans.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: 9fans-bounces@9fans.net Errors-To: 9fans-bounces+lejatorn=gmail.com@9fans.net 2009/3/27 erik quanstrom : >> It seems I'm hitting this error when sending some GET requests: >> >> In /sys/src/cmd/webfs/url.c: >> >> =A0 =A0 =A0 if(strstr(url, "%00")){ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 werrstr("escaped NUL in URI"); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return -1; >> =A0 =A0 =A0 } >> >> I haven't fully understood the comment above, especially if it is agains= t >> the RFC to have an escaped NUL in an url, but this can actually happen, >> at least with queries to a bittorrent tracker. For example when specifyi= ng >> the info hash of a specific torrent when sending a scrape request: >> >> http://bttracker.debian.org:6969/scrape?info_hash=3D%F1%AE%D2%E5%15%A0%B= D%F1%41%54%9D%44%00%47%AB%97%81%2B%69%16 >> (13th char in the info hash is a NUL) >> >> I get a reply to that one both with wget on linux or hget on plan 9, >> while webfs gives the error from the code above. >> >> So is it webfs that needs fixing for that case, or are the other tools >> breaking some RFC with that? > > rfc2396 doesn't mention any restrictions; %00 is legal. Yeah, there aren't any. That's the point of URL encoding; NULL bytes are as acceptable as any other, and your client should be able to handle them -- so I think that webfs check is just bogus. It should just encode it as a \0 and pass it through. --dho > - erik > > --upas-vehxeelocwfhhrpbttfazpscst--