Project

General

Profile

Actions

Bug #68545

closed

Logical mistake in checkFileActionPermission?

Added by Hannes Gesmann over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2015-07-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Hey there,

I am a bit confused about a check in method RecourceStorage->checkFileActionPermission.
File: sysext/core/Classes/Resource/ResourceStorage.php

It says (TYPO3 Version 6.2.14), line 606ff.:

// Check 4: Check the capabilities of the storage (and the driver)
if ($isWriteCheck && ($isMissing || !$this->isWritable())) {
    return FALSE;
}

In human readable language:
IF (a write action is required AND (the file does not exists OR the storage is not writable)), THEN the required permissions are not granted.

So this check returns FALSE as soon as the file is missing – also in case that the storage IS writable…

From my point of view the code should be adopted like this:

// Check 4: Check the capabilities of the storage (and the driver)
if ($isWriteCheck && $isMissing && !$this->isWritable()) {
    return FALSE;
}

Am I wrong?
Feedback wanted. :)

P.S: Why is $isMissing checked anyway?

Actions

Also available in: Atom PDF