[Bug 648509] New: PHP copy function fails when destination would overwrite a file
https://bugzilla.novell.com/show_bug.cgi?id=648509 https://bugzilla.novell.com/show_bug.cgi?id=648509#c0 Summary: PHP copy function fails when destination would overwrite a file Classification: openSUSE Product: openSUSE 11.2 Version: Final Platform: x86-64 OS/Version: openSUSE 11.2 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: reg@capiogroup.com QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.10) Gecko/20100914 SUSE/3.6.10-30.2 Firefox/3.6.10 I don't know if this should be reported here, or to the PHP developers. If this is the wrong place, please write back so I know to report it over there or let me know that you sent it "up the line"... if that's how it works. With the following PHP code: $src='/tmp/filehQMSWX' $dst='sites/mysite.com/files/js/gmap_markers.js' copy($src, $dst); The copy function fails. This is PHP5.3 running under Apache 2.2. My OS version is openSUSE 11.2. All available updates are installed as of this date. Knowing this I did the shell commands below to make sure the copy was legitimate and you can see the results: # sudo -u wwwrun cp /tmp/filehQMSWX sites/mysite.com/files/js/gmap_markers.js cp: cannot create regular file `sites/mysite.com/files/js/gmap_markers.js': Operation not permitted (above failed) # sudo -u wwwrun cp -f /tmp/filehQMSWX sites/mysite.com/files/js/gmap_markers.js (above worked) Clearly, the copy is possible with the user wwwrun. I also added file_exists($src), and file_exists($dst) just above the copy command and sure enough it only fails when the destination exists, however it should just overwrite as far as I can see. At least according to the documentation here: http://us2.php.net/manual/en/function.copy.php. As one last test I changed the copy command to: copy($src, real_path($dst)); just in case it was taking the relative dest. path as a URL, it still fails. Reproducible: Always Steps to Reproduce: 1.See above 2. 3. Actual Results: copy fails Expected Results: copy should overwrite file. The destination directory is a subdirectory of a drupal "files" directory. This means the permissions are 777. However, the owner, for my own purposes is web:web not wwwrun:www. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=648509 https://bugzilla.novell.com/show_bug.cgi?id=648509#c3 --- Comment #3 from Michal Vyskocil <mvyskocil@novell.com> 2010-10-22 13:27:23 UTC --- The previous comment was accidentally private - let's open that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=648509 https://bugzilla.novell.com/show_bug.cgi?id=648509#c4 --- Comment #4 from Michal Vyskocil <mvyskocil@novell.com> 2010-10-26 11:32:52 UTC --- ping -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=648509 https://bugzilla.novell.com/show_bug.cgi?id=648509#c5 Reg Proctor <reg@capiogroup.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|reg@capiogroup.com | --- Comment #5 from Reg Proctor <reg@capiogroup.com> 2010-10-27 21:24:53 UTC --- (In reply to comment #4)
ping
Actually Michal I just got a major update (kernel requiring reboot). And once that was done, the problem went away. What I don't know is whether it went away because of an update or because reboot just allowed something screwed up to be purged from RAM. However, the permissions are: 6777 and just for good measure I had ACL's set the same. The only thing that would lead me to suspect it was the update is that I have restarted Apache more than once already to fix this problem and that never helped. In any case, it is fixed - so great! I do have a different problem with MySQL that is persisting through this upgrade but I'll open that up as a new issue. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=648509 https://bugzilla.novell.com/show_bug.cgi?id=648509#c6 Michal Vyskocil <mvyskocil@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution| |FIXED --- Comment #6 from Michal Vyskocil <mvyskocil@novell.com> 2010-11-12 11:00:09 UTC --- ok, then let's close it -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com