9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Devon H. O'Dell" <devon.odell@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] another webfs question
Date: Fri, 27 Mar 2009 08:52:48 -0400	[thread overview]
Message-ID: <9ab217670903270552o64036bc6l822ca1f6e73ec82f@mail.gmail.com> (raw)
In-Reply-To: <5ab04e072064bfe53f47b5a785bc41ec@quanstro.net>

2009/3/27 erik quanstrom <quanstro@quanstro.net>:
>> It seems I'm hitting this error when sending some GET requests:
>>
>> In /sys/src/cmd/webfs/url.c:
>>
>>       if(strstr(url, "%00")){
>>               werrstr("escaped NUL in URI");
>>               return -1;
>>       }
>>
>> I haven't fully understood the comment above, especially if it is against
>> 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 specifying
>> the info hash of a specific torrent when sending a scrape request:
>>
>> http://bttracker.debian.org:6969/scrape?info_hash=%F1%AE%D2%E5%15%A0%BD%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
>
>



  reply	other threads:[~2009-03-27 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-26 23:11 Mathieu
2009-03-27 12:04 ` erik quanstrom
2009-03-27 12:52   ` Devon H. O'Dell [this message]
2009-03-27 13:10     ` Mathieu Lonjaret
2009-03-27 13:52     ` erik quanstrom
2009-03-27 14:07       ` Devon H. O'Dell
2009-03-27 14:35         ` erik quanstrom
2009-03-27 15:20           ` [9fans] porting sam Benjamin Huntsman
2009-03-29 16:22             ` Skip Tavakkolian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ab217670903270552o64036bc6l822ca1f6e73ec82f@mail.gmail.com \
    --to=devon.odell@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).