Commit Graph

86 Commits

Author SHA1 Message Date
Andy Scherzinger
130668c3b9
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-29 09:00:19 +02:00
Matthieu Gallien
2bcf7ce54e
fix(filesystem): still use std::filesystem::remove for folders
this API has a way to provide an error when failing to delete a folder

we may want to know why teh folderf ailed to be deleted

QDir::rmdir does not provide any error when failing to delete a folder

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-24 10:29:20 +02:00
Matthieu Gallien
86205ff49f
fix(rmdir): switch to another API for folder removal
current QDir::rmdir API does not provide an error message when failing
to delete

retuse FileSystem::remove that may just works with folders

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:27 +02:00
Matthieu Gallien
a071ea76ea
refactor(logs): improve logs around deletions and permissions
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:26 +02:00
Matthieu Gallien
83e9dbb617
fix(read only folder): allow renaming new file inside read-only folders
needed to download a new file inside a read-only folder

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:32:26 +02:00
Matthieu Gallien
67942022e6
feat(windows native API): use windows specific API for read-only folders
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-18 16:31:53 +02:00
Matthieu Gallien
98f8ce7a9c
fix: do not interrupt sync when cleaning invalid read-only items
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-14 17:00:55 +02:00
Jyrki Gadinger
8cd1beebe6 fix FileSystem::setModTime on x64 Windows with times > 2038
also removes some unused Utility methods

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-04-08 23:18:20 +02:00
Matthieu Gallien
faceb32558 when deleting a folder starts by making it read-write permissions
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-07 11:48:17 +02:00
Matthieu Gallien
1d1c2b1bb4 if we are going to need modified permissions: always change
we might need to change the permissions, so do it instead of trying to
be smart

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-07 11:48:17 +02:00
Matthieu Gallien
a9293fd25b Qt 6.8 requires macSO 12 or higher: no need to compile against older
clean up preprocessor directives for older macOS releases that are not
supported by macOS minimum required release from the Qt 6.8 release we
require

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-04-07 11:48:17 +02:00
Camila Ayres
8542c10714 Improve logging when error occurs while changing folder permissions.
Signed-off-by: Camila Ayres <hello@camilasan.com>
2025-02-06 18:02:20 +01:00
Matthieu Gallien
b2b5fb793c ensure no crash due to uncatched exception from std c++ lib
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2025-01-02 10:20:27 +01:00
Matthieu Gallien
5b2af166d3 ensure no any user writable permissions in Nextcloud sync folder
past versions may have wrongly set the write permissions for other users
(UNIX style permissions)

remove this under the hypothesis that newly created files or folders
gets more restrictive permissions and that past files or folders should
be updated to get the same permissions

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-11-21 12:06:57 +01:00
Fabian Creutz
0f85a0bd10 Add null check for resultDacl after calling GetSecurityDescriptorDacl
Signed-off-by: Fabian Creutz <fabian.creutz@kaskadee.eu>
2024-11-15 09:28:05 +01:00
Matthieu Gallien
34c25ecb43 let FileSystem::removeRecursively be able to delete read-only folders
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-12 08:40:50 +02:00
Matthieu Gallien
9fc15d4401
Merge pull request #6949 from suiso67/fix/excessive-folder-permission
Narrow down ReadWrite folder permission to owner
2024-09-09 16:03:49 +02:00
Matthieu Gallien
0b3a019d19
add missing exception handling
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-09-06 16:02:38 +02:00
suiso67
a270756402 Narrow down ReadWrite folder permission to owner
Signed-off-by: suiso67 <suiso67@macadamia.rocks>
2024-08-21 22:12:42 +09:00
Matthieu Gallien
8dcbdebd02 make folders read-write when needed when deleting local items
if a folder is read-only, when deleting content inside this folder, it
may be needed to make it temporary read-write

do this as required by the automated tests

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-08-21 14:38:21 +02:00
alex-z
f70d1c1079
Support Windows .lnk files with VFS Cf API.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-07-10 10:29:21 +02:00
Claudio Cambra
051a225d83 Do not wrap macOS ifdefs in filesystem when parent function already wrapped in ifdef
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-06-28 15:55:18 +08:00
Claudio Cambra
26eab22ca4 Do not re-generate standard string path twice
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-06-28 15:55:18 +08:00
Claudio Cambra
c34edbee82 Ensure we are re-adding same permissions as removed
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-06-28 15:55:18 +08:00
alex-z
dbde9e3a2b Detect office files for locking on new upload. Notify FolderWatcher.
Signed-off-by: alex-z <blackslayer4@gmail.com>
2024-04-13 15:46:37 +02:00
Claudio Cambra
42504d0a0f Wrap all use of std::filesystem in ifdefs to fix legacy build for <macOS 10.15
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-03-28 19:11:57 +08:00
Matthieu Gallien
4844f326c1 newly created folders will be read-only when needed
Close #6296

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2024-03-12 23:30:02 +01:00
Matthieu Gallien
602b8db5e2
handle case clash conflicts in a similar way to content conflicts
introduce a new type of conflict for case clash filename conflicts

add proper handling including a new utility class to solve them and a
new dialog for the user to pick a fix

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2023-01-25 16:37:35 +01:00
Matthieu Gallien
9a201a8963 force download from server for local files that have invalid dates
will trigger if local state is incoherent
like the file itself haveing 0 or negative modtime and the database not

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-12-14 10:00:59 +01:00
Matthieu Gallien
76c8d7287e do not consider that a file has changed if its mtime is invalid
a mtime should never be 0 or negative

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
2021-12-08 07:22:24 +00:00
Hannah von Reth
48f4c1e9e1 Log fallback result 2021-08-23 09:44:34 +02:00
Hannah von Reth
789e0e45d5 Fix Windows long path issue introduced in dd641fae99 2021-08-23 09:40:27 +02:00
Valdnet
7ebbb499e0 l10n: Replace apostrophe with double quotation
Signed-off-by: Valdnet <47037905+Valdnet@users.noreply.github.com>
2021-07-30 06:21:05 +00:00
Hannah von Reth
51d73e27ea
Clarify comment 2020-12-30 16:17:46 +01:00
Hannah von Reth
3f873ed2ee
Simplify file comparison 2020-12-30 16:17:46 +01:00
Hannah von Reth
4589772393
Remove more legacy C code 2020-12-15 10:59:15 +01:00
Hannah von Reth
47dc7e6c49
Remove custome string functions 2020-12-15 10:59:15 +01:00
Christian Kamm
2b20985875
winvfs: initial work
Done by ckamm and dschmidt
2020-12-15 10:58:21 +01:00
Christian Kamm
f62be57ef2
FileSystem: make removeRecursively() reusable
We want to use it for deleting directory conflicts.
2020-10-22 16:39:17 +02:00
Olivier Goffart
5d0aa5f039 Remove unused c_path 2018-01-13 13:58:17 +01:00
Jocelyn Turcotte
bd25225045 Move non-csync-dependent parts of FileSystem to src/common
This keep the csync-dependent parts in src/libsync, slitting the namespace
over two files.
This will allow moving SyncJournalDB to src/common as well.
2017-09-18 14:00:52 +02:00
Helmut K. C. Tessarek
709aa27031 remove qt4 code 2017-09-15 07:11:05 +02:00
Jocelyn Turcotte
e8f7adc7ca Replace csync_vio_file_stat_t with csync_file_stat_t
Also move csync_normalize_etag to common/utility since we
don't need the char* function anymore.

Remove the single space file_stat->remotePerm codepath since
this won't be used in csync anymore since
8de3bda0b1.

Issue #1817
2017-09-06 13:08:23 +02:00
Jocelyn Turcotte
cf15cbf0b3 Move Utility to a new common static library
Now that csync builds as C++, this will avoid having to implement
functionalities needed by csync mandatorily in csync itself.

This library is built as part of libocsync and symbols exported
through it.
This requires a relicense of Utility as LGPL. All classes moved into
this library from src/libsync will need to be relicensed as well.
2017-09-05 17:25:19 +02:00
Jocelyn Turcotte
4e5898efd7 Compile almost all of csync as C++
This will allow us to unify data structures between csync and libsync.

Utility functions like csync_time and c_std are still compiled as C
since we won't need to be coupled with Qt in the short term.
2017-08-22 15:22:56 +02:00
Jocelyn Turcotte
5a1bf7d8fe windows: Fix a memory leak in FileSystem::longWinPath
Also use c_path_to_UNC directly instead of doing an extra
UTF-8->wchar conversion.
2017-07-24 17:54:29 +02:00
Christian Kamm
c8d0f788e0 Apply clang-format 2017-05-17 12:26:27 +02:00
Jocelyn Turcotte
b7553d5bdf Upgrade some qCDebug to qCInfo or qCWarning
Use qCInfo for anything that has general value for support and
development. Use qCWarning for any recoverable error and qCCritical
for anything that could result in data loss or would identify a serious
issue with the code.

Issue #5647
2017-05-11 17:22:59 +02:00
Jocelyn Turcotte
4ad190a558 Use Qt logging categories for logging
This gives more insight about the logs and allow setting fine-tuned
logging rules. The categories are set to only output Info by default
so this allows us to provide more concise logging while keeping the
ability to extract more information for a specific category when
developping or debugging customer issues.

Issue #5647
2017-05-11 17:22:59 +02:00
Markus Goetz
2e3a3bcf84 Folder: Make folder only accessible by user #5282 (#5315)
Because on OS X the parent folder might not protect
against access.
2016-11-23 11:05:41 +01:00