Problem
Home-directories are not writeable in Nextcloud after update to version 19.04.
Environment
Folderredirection is in use and points to the homeshare of the users.
Solution
Locate /apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php
root@dc0:~ # updatedb
root@dc0:~ # locate NativeFileInfo.php
root@dc0:~ # vi /var/lib/docker/overlay2/2b15192d1a1c94b92a9cfdb2aa10e1ad3681203ed73e3019ff1ac6ccddbbe53a/merged/var/www/html/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php
Change the file from:
public function isReadOnly() {
$mode = $this->getMode();
if ($mode > 0x1000) {
return !(bool)($mode & 0x80); // 0x80: owner write permissions
} else {
return (bool)($mode & IFileInfo::MODE_READONLY);
}
}
to
public function isReadOnly() {
$mode = $this->getMode();
if ($this->isDirectory()) {
return false;
} elseif ($mode > 0x1000) {
return !(bool)($mode & 0x80); // 0x80: owner write permissions
} else {
return (bool)($mode & IFileInfo::MODE_READONLY);
}
}
Root Cause
Microsoft specifies (read Cause) the Readonly Attribute of a directory different to a readonly Attribute of a file. Nextcloud do not distinguish between file or directory.
See nextcloud discussion about that topic with the original fix included.