From: Daniel Veillard (Daniel.Veillard@imag.fr)
Date: Tue Jan 23 2001 - 04:54:06 EST
On Tue, Jan 23, 2001 at 12:44:46AM -0500, Alejandro Forero Cuervo wrote:
[...]
> When we call xmlParseFile and pass a directory as the filename, libxml
> opens the directory and attempts to read from it. We consider this a
> bug and would rather have it notice it was told to read XML from a
> directory and consider this an error.
[...]
> We can make those checks right before calling xmlParseFile, but it
> doesn't feel right: we believe it should be done inside
> xmlParserInputBufferCreateFilename (or other appropiate functions in
> libxml) and xmlFdOpen, xmlFileOpen and xmlGzfileOpen (or other
> appropiate functions in libxml2).
>
> Making those checks will be as simple as calling stat(2) on the
> filename and using the S_ISDIR macro.
[...]
> Where should we send patches with this simple changes so, if
> considered worthy, they are incorporated into the next releases?
I have no problem adding this check (patch welcome !), my only concern
is about portability of the check (on Windows for example). Is S_ISDIR()
part of the Posix definition (I think so) and does it work on Windows ?
Daniel
-- Daniel Veillard | Red Hat Network http://redhat.com/products/network/ veillard@redhat.com | libxml Gnome XML toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ ---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net
This archive was generated by hypermail 2b29 : Tue Jan 23 2001 - 06:43:39 EST