Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix file permissions for SMB (read-only folders will be writeable)
Read-only folders won't be deletable
  • Loading branch information
jvillafanez authored and Vincent Petry committed Aug 11, 2016
commit aae231d4a204b1570b73e9944cf88b947113b368
13 changes: 13 additions & 0 deletions apps/files_external/lib/smb.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,19 @@ public function isReadable($path) {
}

public function isUpdatable($path) {
try {
$info = $this->getFileInfo($path);
// following windows behaviour for read-only folders: they can be written into
// (https://support.microsoft.com/en-us/kb/326549 - "cause" section)
return !$info->isHidden() && (!$info->isReadOnly() || $this->is_dir($path));
} catch (NotFoundException $e) {
return false;
} catch (ForbiddenException $e) {
return false;
}
}

public function isDeletable($path) {
try {
$info = $this->getFileInfo($path);
return !$info->isHidden() && !$info->isReadOnly();
Expand Down