php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17390 dump_file doesn't work if path is not absolute
Submitted: 2002-05-23 11:02 UTC Modified: 2002-10-28 11:01 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: sysadmin at alexdupre dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 4.0CVS-2002-05-23 OS: FreeBSD and Windows 2000
Private report: No CVE-ID: None
 [2002-05-23 11:02 UTC] sysadmin at alexdupre dot com
I think to have found a bug in the dump_file() function of the domxml extension. If the path passed to the function is relative, the file is not saved anywhere (first issue) and the function returns anyway the number of bytes written (second issue).
From the sources it seems that dump_file simply calls xmlSaveFile from libxml2, so maybe a path check should be done before the call.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-04 14:42 UTC] rrichards at digarc dot com
what version of libxml2 are you running? there was a bug in it which would causes this error and has been fixed since 2.2.12.
 [2002-06-04 14:56 UTC] sysadmin at alexdupre dot com
2.4.20 on FreeBSD, 2.4.9 on Windows.
 [2002-06-05 12:40 UTC] rrichards at digarc dot com
this is a possible apache2 problem (BSD running apache2). when run with apache 1.3 it works correctly. unable to test with apache 2 now to confirm. the windows issue was due to the libxml version. once upgraded it works fine.
 [2002-09-14 07:16 UTC] rrichards at digarc dot com
This is still a problem running under windows with any version of apache (though different behavior than Apache2 on FreeBSD at least). see bug 17779 for more information as they are related. This specific bug can be fixed if the file path, being passed or when domxml is writing to a file, is converted to the full path before being sent to the libxml2 function calls.

I have a patch for this specific bug, but not sure about adding it as the DTD issue (bug 17779) would still remain which would result in an inconsistant implementation of file directory handling. (passing in filesnames as parameters would work, but DTD references in the xml would not unless they were full path names).
 [2002-10-09 14:31 UTC] iliaa@php.net
domxml, not Apache 2 issue. Possibly a duplicate of bug #17779.
 [2002-10-28 11:01 UTC] sterling@php.net
domxml, operating system, user issue - not a php issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC