Project

General

Profile

Actions

Bug #14154

closed

t3lib_div::writeFile() changes permissions without need

Added by Steffen Müller over 20 years ago. Updated about 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
-
Start date:
2004-05-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.6.2
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)


Files

0000076-patch_writeFile.diff (937 Bytes) 0000076-patch_writeFile.diff Administrator Admin, 2004-05-11 22:08
bug_76.diff (1.18 KB) bug_76.diff Administrator Admin, 2005-10-20 14:19

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #14153: t3lib_extfilefunc::func_copy() does not set file permissions properlyClosedMichael Stucki2004-05-11

Actions
Actions #1

Updated by Steffen Müller over 20 years ago

This will only be the case, if the owner of the file is the apache-user.

Case 1:
rw-rw-r- www-data www-data testfile.txt
will be affected.

Case 2:
rw-rw-r- username www-data testfile.txt
will NOT be affected, because typo3 (apache) isn't the owner and thus doesn't have the permission to chmod.

As new files/directories (uploads and new creations of filelist module) are touched with owner www-data (apache user), case No.1 will be very likely. (Most files will be affected)

edited on: 19.05.04 17:13

Actions #2

Updated by Robert Lemke over 20 years ago

Hey Ingmar,

this is similar work like bug #14153 so maybe you want to take this one, too?
If you don't, just unassign it ...

robert

Actions #3

Updated by Michael Stucki almost 19 years ago

Fixed in CVS.

Actions

Also available in: Atom PDF