gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] multi-committer functionality revisited


From: Robert Collins
Subject: Re: [Gnu-arch-users] multi-committer functionality revisited
Date: Sun, 23 Nov 2003 23:40:03 +1100

On Sun, 2003-11-23 at 23:15, address@hidden wrote:
> > the uri.
> 
> According to the RFCs file: is localhost per definition, this extra is not
> needed and should be filtered before being fed to the parsing mechanisms.
> Naturally multiple slashes in unix are ignored..

Actually, both of these are incorrect.
file://foobar.example.org/boot/grub/menu.lst refers to the
/grub/menu.lst file on foobar.example.org. The special thing about
file:// is that it has the implied localhost which is triggered by ///.
file://path/to ... is the path /to on the host path.

As for multiple slashes being ignored, no. If your file system
interprets /foo//bar and /foo/bar as being the same - well thats local
choice and fine. But applications processing, parsing, accepting via
input etcetera file:// urls, MUST NOT assume that a // in the abs_path
is accidental and equivalent to a single /.

> > sftp://address@hidden/path/to/your/archive?umask=XXX
> > 
> > http://address@hidden/path/to/archive?umask=XXX
> > 
> > etc.
> > 
> > the ? delimits the abs_path from the query_part.
> 
> So a questionmark in a filename would be encoded as:
>     %3f
> ?

Yes. As should everything required by rfc1738. The unsafe chars must be
escaped. The reserved chars have special meaning in the standards, and
to have as a literal in any part of the uri must be escaped.

(From lib/rfc1738.c in squid )

/*  
 *  RFC 1738 defines that these characters should be escaped, as well
 *  any non-US-ASCII character or anything between 0x00 - 0x1F.
 */
static char rfc1738_unsafe_chars[] =
{
    (char) 0x3C,                /* < */
    (char) 0x3E,                /* > */
    (char) 0x22,                /* " */
    (char) 0x23,                /* # */
#if 0                           /* done in code */
    (char) 0x25,                /* % */
#endif
    (char) 0x7B,                /* { */
    (char) 0x7D,                /* } */
    (char) 0x7C,                /* | */
    (char) 0x5C,                /* \ */
    (char) 0x5E,                /* ^ */
    (char) 0x7E,                /* ~ */
    (char) 0x5B,                /* [ */
    (char) 0x5D,                /* ] */
    (char) 0x60,                /* ` */
    (char) 0x27,                /* ' */
    (char) 0x20                 /* space */
};

static char rfc1738_reserved_chars[] =
{
    (char) 0x3b,                /* ; */
    (char) 0x2f,                /* / */
    (char) 0x3f,                /* ? */
    (char) 0x3a,                /* : */
    (char) 0x40,                /* @ */
    (char) 0x3d,                /* = */
    (char) 0x26                 /* & */
};


> Roberts version looks fully RFC complient to me.

:). I'd be embarrassed if it weren't.

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]