config: add a switch to control truncate before update
To avoid extra truncate on non WORM file systems, add a new config
option `localstorage.unlink_on_truncate`, which defaults to false.
The OC\Files\Storage\Local is update to respect that option.
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Change the quota to int from float, since the quota is a number of bits
and a bits can not be splitted.
Fix #34010
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Make config file saving safe against write failures
In case of disk space depletion, writing a new version of config fails,
leaving the config file empty.
This patch improves safety of updates to config.php by saving the new
version of the config into a randomly-named temporary file in the same
directory, and then renaming it to config.php, which renaming is atomic
in POSIX-compliant filesystems and shouldn't involve disk space
allocation. If writing the new config version is impossible, the current
config remains unchanged.
This patch drops the use of file locking as unnecessary. File locking
merely established order in which the concurrent independent processes
attempted file writing. In the end, the process which was last to update
the file "wins" - their changes persist and the changes of previous
writers are dropped as there's no conflict detection or change merging
mechanism anyway. With the current change, there is still some resulting
ordering, and the last writer still wins in the same way. Readers don't
need file locking as well, as opening config.php for reading always
provides a certain consistent version of the file.
Signed-off-by: Andriy Utkin <dev@autkin.net>
I dug into it again, and the issue is much simpler than I previously though.
- LDAP has an email address with capital letters
- NC store this address in lower case
- When the user logs in, we compare the [stored email with the new lower case email](https://github.com/nextcloud/server/blob/master/lib/private/AllConfig.php#L259-L261) before storing it. Here, both email will be the same, so we won't store the new email address with upper case letters. Which is what we want.
- We then [compare emails as they are before triggering an event](https://github.com/nextcloud/server/blob/master/lib/private/User/User.php#L202-L204), they won't match, so the user will receive an email signaling an email change every time he logs in.
The fix is to compare the old email with the new lower case email before sending the event.
Signed-off-by: Louis Chemineau <louis@chmn.me>
Spelling unification in Transifex.
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
l10n: Change to administration
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
l10n: Spelling unification
Spelling unification in Transifex.
Match the menu name to the header name of the settings page.
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
always apply the wrapper but have the wrapper get the quota lazily only when an operation where quota is applied is performed
Signed-off-by: Robin Appelman <robin@icewind.nl>