Project

General

Profile

Actions

Bug #14153

closed

t3lib_extfilefunc::func_copy() does not set file permissions properly

Added by Steffen Müller over 20 years ago. Updated over 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.8.0-dev
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If a file is being copied with the filelist modules, the permissions of the new one is 755 - no matter what perms the source file had.
This is somehow the "normal" behavior of PHPFileFunctions and exec('cp'), but I think this should be fixed.

A patch to fix this is attached as diff -urN

Can anyone verify if this does not produce errors on Win?

--
cheers,
Steffen

System:
Debian GNU/Linux (Woody 3.0)
Apache 1.3.26
PHP 4.1.2 (safe mode = off)

(issue imported from #M75)


Files

0000075-corrected_patch_func_copy.diff (571 Bytes) 0000075-corrected_patch_func_copy.diff Administrator Admin, 2004-05-11 20:58
bug_75.diff (563 Bytes) bug_75.diff Administrator Admin, 2006-01-18 21:59

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #14154: t3lib_div::writeFile() changes permissions without needClosedMichael Scharkow2004-05-11

Actions
Actions #1

Updated by Steffen Müller over 20 years ago

Sorry for submitting the wrong diff.
Corrected version is attached: corrected_patch_func_copy.diff (571 bytes) 11.05.04 20:58

Actions #2

Updated by Ingmar Schlecht over 20 years ago

I think it's argueabel whether or not this is a bug or a feature.
I suggest starting a discussion in the dev mailing list about this issues.

Actions #3

Updated by Robert Lemke over 20 years ago

I also suggest to discuss this. My reason for closing this bugrepot (for now) is that cp and other copy functions usually have the default behaviour like we have now.

However, it would maybe make sense to make this configurable. If there is a need for it.

Actions #4

Updated by Steffen Müller over 20 years ago

I reopen this bug, because otherwise I don't have a chance to comment Roberts note.

A note on discussion this bug in typo3.dev: I already started one on May,15th. There was very little feedback and as I interpret it, there has been a 2:0 opinion for fixing this bug. See: http://typo3.org/documentation/mailing-lists/dev-list-archive/thread/47850/

A note on default permission behaviour: I cannot follow Roberts argumentation. Is there a reason, why the default behaviour is be the right way in our case? I argue it is not.

Last, I don't see a reason to make this configurable. If there is one, please enlighten me.

Actions #5

Updated by Robert Lemke over 20 years ago

Sorry, I didn't see the discussion.

Ingmar, could you implement that as you have access to Windows and we don't? It seems like with windows the octal values passed to chmod don't work, so you probably have to only call chmod if it's non windows.

Thanks!
robert

Actions #6

Updated by Michael Scharkow about 19 years ago

I just tested this on Win2k with PHP 5.0.5 and it breaks silently. Since neither fileperms nor chmod works reliably on Windows (since NTFS acls are completely ignored), adding this patch would not hurt.
Steffen, while I see this is nice we could still argue if it is better to mimic UNIX standards (which does not copy perms) or provide a better solution at the risk of pissing UNIX admins off.
Stucki, Ingmar, Robert - any final preferences, or should we leave this to Kasper? If not, I will try to commit this.

Actions #7

Updated by Michael Stucki about 19 years ago

I think TYPO3 has it's very own way of dealing with files: All files which are generated have these file permissions:

- the files belong to the user of the webserver
- the group owner is set to the group of the webserver or (if set) the value of $TYPO3_CONF_VARS[BE][createGroup]
- the permissions of files are set according to $TYPO3_CONF_VARS['BE']['fileCreateMask']
- the permissions of directories are set according to $TYPO3_CONF_VARS['BE']['folderCreateMask']

I vote for doing everything this way, therfore call the function t3lib_div::fixPermissions($path) after the file is copied. I think you could use this for both cases of the if() statement$this->PHPFileFunctions.

- michael

Actions #8

Updated by Michael Stucki about 19 years ago

Hi Michael, will you still look at this or should I make that change?

Actions #9

Updated by Michael Stucki almost 19 years ago

I'm unsure whether clearstatcache() should be called before or after my new line?

Actions #10

Updated by anoop atre almost 19 years ago

Just a note from #typo3-dev chat.

I did a little reading on clearstatcache just now and to me it seems like it should be after your fixPermissions line. That way the file's information is cleared for future use. Does this sound logical?

Actions #11

Updated by Michael Stucki almost 19 years ago

Fixed in CVS

Actions

Also available in: Atom PDF