Ticket #228 (closed defect: fixed)

Opened 5 months ago

Last modified 4 months ago

wrong permissions check when attempting to set last modified time on file

Reported by: Bruce Weirdan <weirdan@gmail.com> Assigned to: hans
Priority: major Milestone:
Component: phing-core Version: devel
Keywords: Cc:

Description

On linux file systems (at least on ext2 and ext3) to be able to change file attributes you have to be either owner of the file or superuser (root). Phing's io subsystem assumes that to change file modification time it has to have write permissions to the file, which is not required in this case.

The problematic area (File::setLastModified()) already marked with FIXME marker. What I propose is to remove the check completely and rely on touch() results (FileSystem::setLastModifiedTime() throws exception if it failed to touch the file).

Additionally, the exception message used by FileSystem::setLastModifiedTime() is misleading: it says: throw new Exception("Could not create directory due to: $php_errormsg"); , but it should be something along the lines of: throw new Exception("Could not touch the file ' . $path . ' due to: $php_errormsg");

Attachments

Change History

03/08/08 10:08:12 changed by mrook

  • status changed from new to closed.
  • resolution set to fixed.

Good call, both have been fixed in r362, thanks!


Add/Change #228 (wrong permissions check when attempting to set last modified time on file)




Action