Issue Bug Closed

#14154t3lib_div::writeFile() changes permissions without need

Steffen Müller 05/11/04, 22:08 updated 09/08/06, 15:09

Description

Playing around with the filelist module, I discovered the following bug:
If a file has been edited via filelist, the permissions are changed to 775 after saving (or whatever given in [‘TYPO3_CONF_VARS’][‘BE’][‘fileCreateMask’]).
The editor uses t3lib_div::writeFile(), but this function does not check if a file did exist before writing and so does not preserve its permissions.

A patch to fix this is attached as diff -urN

1) open a shell, browse to a directory in /fileadmin
2) create a testfile, e.g. test.txt and spend some 664 permissions.
3) go to filelist module, browse to the directory, edit the testfile and save it.
4) go back to shell and compare file permissions of the edited file (ls -l).

(issue imported from #M76)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.