[vlc-devel] [RFC] sanitize MRL format
Rémi Denis-Courmont
rem at videolan.org
Wed Jun 6 19:13:57 CEST 2007
Le mercredi 6 juin 2007, Subversion daemon a écrit :
> r20427 | courmisch | 2007-06-06 18:40:48 +0200 (Wed, 06 Jun 2007) | 4
> lines Changed paths:
> M /trunk/src/input/input.c
>
> - Only allow letters, digits and slash in access/demux specification
> (fixes problem with most-but-not-all filenames with : in the,)
> - Only allow letters as Windows drives
>
> > http://trac.videolan.org/vlc/changeset/20427
Hmm, Antoine pointed out that this prevents passing options to the demux
within the MRL, so this commit might not have been such a bright idea
of mine.
On Windows, the problem is trivial, since the colon can only be legally
used after drive letters; this works because none of access names are
always more than one letter-long.
On POSIX, there is no catch-all solution.
Ultimately, "http://www.google.com" may refer to the most popular
Internet search engine. But it may also refer to a file
called "www.google.com" in the "http:" directory, since multiples
consecutive slashes are equivalent to a single slash.
Still, I would say that the "cleanest" solution would to enforce that
the colon always be followed by two (or more) slashes, otherwise it
will be considered part of the filename. That will break lame MRL such
as udp:1.2.3.4 (but that's so inexcusably lame!) however. And it means
you have to use "http:/www.google.com" if you want to open
the "www.google.com" file from the "http:" directory.
Another potential problem (which would be a pre-existent bug in
MRLSplit()) regards the use of colon within demux parameters, which
makes me think that demux parameters-within-MRL are not a good idea in
any case, or then we need to come up with a *well-defined* and
*consistent* quoting mechanism.
Opinions, please.
--
Rémi Denis-Courmont
http://www.remlab.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070606/aeeba24d/attachment.sig>
More information about the vlc-devel
mailing list