Commit graph

200 commits

Author SHA1 Message Date
Markus Goetz
6d94acee8f permissions: Fix root properties if no permissions used 2014-09-25 10:24:51 +02:00
Olivier Goffart
1cd5681967 permissions: Remember the permissions for the root folder 2014-09-19 10:58:52 +02:00
Olivier Goffart
76f0f3cbf2 csync_vio_local on windows: fix overflow when computing the size of file > 4GiB
MAXDWORD is 0xFFFFFFFF, so if we add one, it overflows and is 0.
We need to cast it to 64 bits before
2014-09-11 11:10:58 +02:00
Markus Goetz
449abace66 CSync: Ignore OS X files with hidden flag 2014-08-21 16:43:24 +02:00
Klaas Freitag
12f5e4b46e csync oC Util: set field flag correctly to avoid etag memleak.
The fields varialbe should contain or'ed flags of the fields set
in the csync_vio_file_stat_t struct. The problem was that the field
for CSYNC_VIO_FILE_STAT_FIELDS_PERM was assigned rather than or'ed
which makes the release function for the struct not freeing the
etag memory => memleak.
2014-08-07 23:14:21 +02:00
Olivier Goffart
6d24bd0361 journaldb: Fix that fileid might be missing in the db
When recovering from a inalid move operation, we call
avoidReadFromDbOnNextSync. This will remove the fileid from the db so
we don't detect a move on the next sync.  But we want the next sync to fetch
the file id again, and this can only happen if we don't read them
from the db and do the actual PROPFIND, this is done by avoidReadFromDbOnNextSync

However, if there is propagation in that source directory later, it
will overide the invalid etag with the real one and we will not uissue the PROPFIND
to fetch the fileid.
We must therefore also protect the future write to the DB when calling
avoidReadFromDbOnNextSync
2014-08-07 12:14:45 +02:00
Markus Goetz
22c1629dd3 SyncEngine: Keep csync_journal with proper values for fileId and remotePerm
Before this patch, we had a lot of empty rows because we created
the SyncFileItems with the wrong(=local) data.
2014-08-07 10:14:14 +02:00
Olivier Goffart
336e74b992 csync_owncloud: fix the name of the permissions property 2014-07-18 16:52:04 +02:00
Olivier Goffart
2f284209d8 Permissions: When moving is not allowed, fallback to delete and upload
We decided that we never want to rename a directory behind the
back of the user as the user may be using files in the directory
during the sync.
If moving is not allowed, we just erase the inode form the database so
the next sync will try to do an upload and delete and recover from there
using normal resolution.

This also add some code to update the inode back to the db when it is detected
as changed.
2014-06-27 15:30:08 +02:00
Olivier Goffart
9066ad5790 t7.pl: Test that deleting a directory restores it and all its sub directories 2014-06-27 11:31:35 +02:00
Olivier Goffart
62d0e670dc Add t7.pl Test for operation of files with restrictions 2014-06-27 11:22:53 +02:00
Olivier Goffart
fbadadc377 propagator: Fix folder duplication if the folder is renamed on the server while uploading
While uploading a new folder, if the folder is renamed on the server
when still uploading, the result will be that the files that are already
uploaded will end up in the new filder name, but the file that were
not still are in the old folder.

After renaming, all the new uploads wil fail with an error on this sync
because the parent directory don't exist.
But they were uploaded with the old name in the next sync because
the renaming was not detected because the file id was not in the DB

Fix the problem by fetching the file id always when creating a new
directory, on the next sync, and saving it in the database ummediatly

https://github.com/owncloud/enterprise/issues/191
2014-06-24 12:00:13 +02:00
Olivier Goffart
8de3bda0b1 csync_update: update the permission in the db when they change
The current code only update the permissions in the DB when
the permission becomes non-empty.
Now we update the permission each time they change.

That way the code is the same for file id and permission so it is
simpler.
2014-06-24 11:10:50 +02:00
Olivier Goffart
9c0a21a5fb Permission: keep a space if the permission is empty
To distinguish no permission present to nothing is allowed.
That was the intention of the old code but it did not work as
the first if was always taken
2014-06-24 10:52:42 +02:00
Olivier Goffart
02704cdf74 Merge remote-tracking branch 'origin/1.6' into il
Conflicts:
	VERSION.cmake
	csync/src/csync_statedb.c
	src/mirall/syncengine.cpp
	src/mirall/syncfileitem.h
2014-06-23 12:48:34 +02:00
Klaas Freitag
041066a252 Exclude: Add a missing free in case of empty lines.
This fixes Coverity CLT 12893
2014-06-20 15:15:35 +02:00
Olivier Goffart
b29a757b18 Revert "csync file util: Remove compare file function, not needed anymore."
This break the test.
And the function is aleady gone in master anyway

This reverts commit 407b3bebfe.
2014-06-20 14:29:43 +02:00
Klaas Freitag
db3d2eed5f csync core: Remove logically dead code: Can never be reached.
This fixes Coverity CID 12881
2014-06-20 13:08:03 +02:00
Olivier Goffart
b34afa1afc reconcile: use the proper enum type
thankfully the value hapenned to be the same, but the type
is of CSYNC_FTW_..  and not CSYNC_VIO_FILE_TYPE
Detected by coverity (CID 12887)
2014-06-20 11:51:07 +02:00
Olivier Goffart
b7c9fa6d5f csync_owncloud: silent CID 12883 2014-06-20 11:51:07 +02:00
Klaas Freitag
407b3bebfe csync file util: Remove compare file function, not needed anymore.
This also fixes Coverity CID 12890 and CID 12898
2014-06-20 11:39:28 +02:00
Olivier Goffart
f04c80dd0e httpbf: silent coverity issue 12905 2014-06-20 11:33:29 +02:00
Klaas Freitag
b144a5bbf9 csync_exclude: Add a missing free of path components.
This fixes Coverity CID 12895
2014-06-20 11:14:50 +02:00
Olivier Goffart
5225fe07e0 csync_owncloud_recursive_propfind: "fix" possible memory leak
This was only leaking memory if ne_path_parent returns 0, which
should never happen

This fixes coverity issue 12897
2014-06-20 11:12:45 +02:00
Klaas Freitag
85cdbd1f1d stateDB: Close the file descriptor even if stat failed.
This fixes Coverity CID 12897
2014-06-20 11:05:40 +02:00
Klaas Freitag
e4f8a136f1 StateDB: Free locale string also if attribs are invalid.
This fixes Coverity CID 12898
2014-06-20 11:05:40 +02:00
Daniel Molkentin
c263c38cdf statedb.c: fix potential memory leak on win32
This fixes coverity issue 12898
2014-06-20 10:58:03 +02:00
Daniel Molkentin
df8553e878 httpbf.c: Fix resource leak
This fixes Coverity CID 12902
2014-06-20 10:58:03 +02:00
Daniel Molkentin
bec66c85d4 Fix potential memory leak
This fixes Coverity CID 12893
2014-06-20 10:58:03 +02:00
Daniel Molkentin
f9710cc1d5 c_time: Fix resource leak in error case
This fixes Coverity CID 12903
2014-06-20 10:58:03 +02:00
Klaas Freitag
d0c992c991 Updater: Free tmp variable that might point to temp malloced memory
This fixes Coverity CID 12900
2014-06-20 10:41:01 +02:00
Klaas Freitag
9ee86cf06b Fix resource leak in win32 code path, added free of locale filename.
This fixes Coverity CID 12901
2014-06-20 10:25:00 +02:00
Olivier Goffart
38254125c9 csync: fix the size in strncpy for the remote perms
We must only do strncpy with size one smaller than
the size of the buffer in order to leave at least
one '\0' at the end
2014-06-18 15:56:13 +02:00
Olivier Goffart
e5b3363ecf csync_statedb: remove noisy output 2014-06-18 15:40:26 +02:00
Olivier Goffart
0a953b91f9 csync_vio_local: fix memory leak on windows 2014-06-17 16:40:38 +02:00
Olivier Goffart
ade92d8ac1 csync test: fix warning 2014-06-17 14:16:42 +02:00
Markus Goetz
a5967e4ecd CSync: Fix win32 compile 2014-06-16 16:53:10 +02:00
Olivier Goffart
2f361278d2 Merge remote-tracking branch 'origin/1.6' into 'il' 2014-06-16 16:41:48 +02:00
Markus Goetz
319cf76417 CSync: Move compiler ifdef outwards 2014-06-16 16:26:00 +02:00
Markus Goetz
be7b08b50a CMake: Fix token auth compile 2014-06-16 15:34:46 +02:00
Markus Goetz
61999a67cd CSync: Give ctx to proxy callback
This fixes a crash.
2014-06-13 15:36:00 +02:00
Klaas Freitag
e1db834ec9 Add missing cmakedefine for HAVE_ASPRINTF and minor cleanup.
Fixes windows build.
2014-06-13 13:30:59 +02:00
Olivier Goffart
d5bd3190d4 csync unit tests: fix cimpilation 2014-06-07 12:08:58 +02:00
Markus Goetz
8dbfcd782b CSync: Fetch permissions from server for whole tree on server update 2014-06-06 17:10:07 +02:00
Markus Goetz
70ff928381 CSync & statedb: Parse 'perm' from server
ownCloud 6 sends this.
2014-06-06 15:24:17 +02:00
Markus Goetz
b48ab79a92 CSync & statedb: Remove uid/gid
Columns are still in the DB as we don't want to break any compatibility.
2014-06-06 13:41:16 +02:00
Markus Goetz
9a7fbd4f71 csync_owncloud: Parse properties in one function 2014-06-06 13:41:16 +02:00
Olivier Goffart
6dd248e527 csync: fix warnings
warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
2014-06-05 15:48:53 +02:00
Olivier Goffart
7d00c3646a csync: remove unused variable 2014-06-05 15:45:15 +02:00
Olivier Goffart
e355e12385 Fix crash in tests 2014-06-05 15:43:27 +02:00