Commit graph

228 commits

Author SHA1 Message Date
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
Markus Goetz
a5967e4ecd CSync: Fix win32 compile 2014-06-16 16:53:10 +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
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
Daniel Molkentin
7fcf6f9f79 Merge branch '1.6' 2014-06-05 12:01:50 +02:00
Markus Goetz
4e28ba73bb Windows: Fix build harder. 2014-06-05 10:13:20 +02:00
Markus Goetz
d4d630b2e9 Windows: Fix build 2014-06-04 12:47:17 +02:00
Markus Goetz
2f81167164 CSync: Remove more unused things 2014-06-04 11:19:09 +02:00
Markus Goetz
6897c5d41f CSync: Always have statedb enabled 2014-06-04 11:06:41 +02:00
Markus Goetz
233450d850 CSync: Remove config dir setting 2014-06-04 10:56:56 +02:00
Markus Goetz
7428a8fa63 CSync: Remove unused std functions 2014-06-04 10:33:19 +02:00
Markus Goetz
18359d7871 StateDB: Remove _csync_win32_hide_file and use other implementation 2014-06-04 09:46:31 +02:00
Olivier Goffart
6605a89990 csync_statedb: Fix wrong % code in debug output
%ld is for long, but int64_t is larger than long on windows
2014-06-03 18:28:31 +02:00
Olivier Goffart
806ab8ea46 csync: remove the local mode
It is no longer used for a long time
2014-06-03 17:52:07 +02:00
Olivier Goffart
582a8fe7fd Merge branch '1.6' 2014-06-03 17:27:12 +02:00
Markus Goetz
e49b8981dd CSync: Shorten WebDAV property name 2014-06-03 16:41:57 +02:00
Markus Goetz
2e91557c28 CSync: Rename callback functions 2014-06-03 15:01:35 +02:00
Markus Goetz
4d4eab8b1c CSync & Propagator: Support a direct download URL
This is for server file backends that support sending a
direct URL.
2014-06-03 14:55:34 +02:00
Olivier Goffart
13f9970257 Fix some possible "Precondition Failed" bug
The problem was if there was a false conflict: the file has been touched
both on the server and the client.
 - etag has changed on the server
 - mtime has changed on the server and the client and is the same
 - and file size is the same on both the server and the client

This may also happen if the file is uploaded on the server, but the client
looses connection (or crashes) before it get notified of the etag.

In both tree, the instruction is EVAL, but we reduce it to a NONE because
we detected that the conflict is 'false'.  Still, we need to update the db
with the new etag.  (_should_update_db)
The problem was that we would set the flag on the wrong tree.
This was not a problem when the file was NEW on both side since  we checked
for null etag and used the other one then.
2014-06-03 12:23:30 +02:00
Markus Goetz
4d4ae9374b CSync: Remove old defines 2014-06-03 11:51:12 +02:00
Markus Goetz
b8e20b412c CSync: We can access the context directly 2014-06-03 11:51:12 +02:00
Markus Goetz
e36f3c5b10 CSync: Remove one VIO layering 2014-06-03 11:51:12 +02:00
Markus Goetz
8a55f831f4 CSync: Use context instead of global variable 2014-06-03 11:51:12 +02:00
Markus Goetz
0dcc9be5c1 CSync: Remove owncloud_stat
We get already all metadata with the readdir
2014-06-03 11:51:12 +02:00
Markus Goetz
5ee00a8df7 CSync: Simplify csync_owncloud stat/resource handling 2014-06-03 11:51:12 +02:00
Klaas Freitag
16d35c1489 Avoid crash on csync_ctx is NULL. 2014-06-03 09:50:09 +02:00
Olivier Goffart
3228fde4af Only set should_update_etag for directories in the update case
If there is an error during the local rename for a file, we don't
want to write the entry for the destination before because there might be
an error
2014-05-26 16:11:05 +02:00
Klaas Freitag
1303379c9e Remove useless global varialbe for auth callback. 2014-05-22 12:54:14 +02:00
Markus Goetz
667c835c49 Revert "remove auth callback setting in the csync module."
This commit broke syncing.
We need the callback to supply the password.

This reverts commit 8738128504.
2014-05-21 20:02:22 +02:00
Klaas Freitag
8738128504 remove auth callback setting in the csync module. 2014-05-21 11:09:02 +02:00
Klaas Freitag
069eaf9170 Clear the authentication callbacks set before. 2014-05-21 11:09:02 +02:00
Klaas Freitag
3705a42375 Remove misleading error message of "unknown error" for custom errnos. 2014-05-13 10:39:37 +02:00
Olivier Goffart
d7a226e0e6 Silent warning:
warning: no previous prototype for ‘set_csync_file_locked_or_open_ext’ [-Wmissing-prototypes]
2014-05-07 12:38:57 +02:00
Klaas Freitag
a50c39cd0c Maintain the original inode value for renamed files.
In case two renames are done on the same file/folder very quickly we
lost the information that the second operation was also a rename. That
was because we tried to get the inode value from a stat on the file once
the first rename was finished. But at that point, the file was already
gone because of the second rename.

Now the original inode is kept and written to db in case the file can
not be stat'ed.

This fixes bug #1737
2014-05-06 12:55:54 +02:00
Markus Goetz
6c44f53645 Set network timeout to 300 sec
As per previously used values (see source and changelog)
2014-05-02 15:35:40 +02:00
Olivier Goffart
988c162d2f Have only one place where we read the timeout 2014-05-02 13:04:53 +02:00
Olivier Goffart
752112dbaa Initialize the size properly on windows 2014-04-30 12:06:55 +02:00
Markus Goetz
3bf15541c6 Add set_csync_file_locked_or_open_ext
Without using function, there were problems with DLL import/export
2014-04-29 18:37:34 +02:00
Olivier Goffart
0bffdfb256 Fix compiler warnings, and be less spammy in the log 2014-04-29 12:30:13 +02:00
Olivier Goffart
9f0848ba15 Merge remote-tracking branch 'origin/libowncloudsync_noqtgui' 2014-04-29 12:23:15 +02:00
Markus Goetz
7f752c7e93 Csync: Plug code for csync_file_locked_or_open 2014-04-28 16:57:56 +02:00
Markus Goetz
b39359c929 Csync: Add hook for checking if a file is in use already 2014-04-28 14:18:58 +02:00
Klaas Freitag
b42d3ced15 Another fix for make install on MacOSX 2014-04-28 11:19:25 +02:00
Klaas Freitag
1c73a8d4ad Fix installation for MacOSX 2014-04-28 10:24:12 +02:00
Olivier Goffart
9da261acd8 Do not read from the database when upgrading from 1.5
We need to make sure that the file id are updated (if the user
had upgraded from owncloud 5 to owncloud 6 while using owncloud 1.5)
2014-04-25 13:31:44 +02:00
Olivier Goffart
cc7826e087 Add a compile option to disable renaming when the extension changes
This is only used for a very specific server that do not support
changing the extension of files without re-uploading the file.

Since the change is small and self contained, it is guarded by a #ifdef

(Removed old BLACKLIST_ON_ERROR option that is no longer in use)
2014-04-24 11:51:48 +02:00
Markus Goetz
94f380c1f0 Updater: Ignore files matching with CSYNC_CONFLICT_FILE_USERNAME 2014-04-22 17:05:59 +02:00
Klaas Freitag
521373f075 More specific log output. 2014-04-22 09:33:07 +02:00
Olivier Goffart
7d3b0fe0c5 Fix memory leak: Don't need to call strdup here
The other_node outlive the trav structure, so we can just use the same pointer
2014-04-18 19:16:10 +02:00
Olivier Goffart
fa38bf7029 Make sure the fileid are saved to the database when upgrading from owncloud5 to owncloud6
We fetch the id from the server, but don't save them in the database.

I Could have used INSTRUCTION_UPDATED for that, but then i would need to update the
reconcile algorithm to take in account the fact that UPDATED is possible there.

Instead, use should_update_etag  which means the db is going to be written again

Remove reference to old instruction _UPDATED and _DELETED which does not make sens with
the new propagator

Improve the test to test this case,  and that etags are properly writen to the DB
when there is a fake conflict
2014-04-18 18:27:27 +02:00
Klaas Freitag
30a14b9f45 Install ocsync library to private lib directory, use rpath to find it. 2014-04-11 13:28:11 +02:00
Olivier Goffart
20e850501d Make sure we do not remove files that are replaced by a symlink
As we ignore symlink, we should not remove on the server the files that
are ignored.

Change tested in t4.pl

Relates to #1299
2014-04-03 17:47:49 +02:00
Olivier Goffart
eaf5681f61 Put the sync log in the actual folder 2014-04-02 16:36:32 +02:00
Klaas Freitag
8625ec250b Add a trust ssl certificate switch 2014-04-01 16:14:24 +02:00
Daniel Molkentin
4e0b6179f9 Libocsync is a library, not a plugin
This is needed to deploy the library correct in OS X.
2014-03-28 14:46:08 +01:00
Olivier Goffart
8de9bec122 Remove progress info from csync
csync doesn't do no propagation no more
2014-03-28 10:50:15 +01:00
Olivier Goffart
5204a992b2 Remove HBF stuff from csync_owncloud
csync doesn't do no propagation no more
2014-03-28 10:41:48 +01:00
Markus Goetz
67f4d0c85b CSync: Debug message if no exclude file defined 2014-03-27 17:11:19 +01:00
Klaas Freitag
033fee6f53 Fix include path 2014-03-26 18:16:27 +01:00
Klaas Freitag
67ae541e2a Safe use of c_strdup 2014-03-26 18:16:27 +01:00
Klaas Freitag
c5100a789b Collect data from the "other" tree for the treewalk functions.
This enables us to log all relevant information that were used
to decide on sync activity.
2014-03-26 18:12:22 +01:00
Markus Goetz
7bef166d6c CSync: Debug file_id on walk 2014-03-26 15:32:45 +01:00
Olivier Goffart
98d7ff5116 Don't create .ctmp of sync journal
Fixes #1559
2014-03-26 10:25:50 +01:00
Markus Goetz
384eef4d6d csync_owncloud: Add a debug message 2014-03-21 17:19:07 +01:00
Olivier Goffart
8e6674e784 Merge branch '1.5'
Conflicts:
	src/owncloudcmd/owncloudcmd.cpp
2014-03-21 10:06:45 +01:00
Olivier Goffart
922e004fc6 Make it an error instead of a crash when dav_connect fails.
Fixes #1591
2014-03-21 09:54:26 +01:00
Klaas Freitag
a5ede054d6 Fix statedb tests. 2014-03-20 12:35:16 +01:00
Klaas Freitag
f7866aabde Add C++ extern "C" 2014-03-20 11:15:28 +01:00
Klaas Freitag
eb59f98ec9 Fix quoting of query by text. 2014-03-20 11:15:28 +01:00
Klaas Freitag
c3cee3426e Improved database access code for csync.
- Use precompiled database statements
- Store them in the csync context struct
- Hand whole context as parameter to db access functions
2014-03-20 11:15:28 +01:00
Klaas Freitag
f21dd05c2d Streamline logging. 2014-03-20 11:15:28 +01:00
Klaas Freitag
6005b9c16e Remove some superflous logging. 2014-03-20 11:15:28 +01:00
Klaas Freitag
9d1208baa4 Also allow http and https protocols. 2014-03-18 17:10:03 +01:00
Klaas Freitag
8e914deb99 Revert "Do not rely on the url scheme owncloud(s) any more."
This reverts commit 34dd3b207e.
It can be implemented simpler.
2014-03-18 16:57:01 +01:00
Klaas Freitag
34dd3b207e Do not rely on the url scheme owncloud(s) any more.
If it is not owncloud or ownclouds, rely on the scheme
that was given by the user.
2014-03-18 14:16:50 +01:00
Klaas Freitag
68e8d659fb Remove unused code. 2014-03-18 14:16:06 +01:00
Olivier Goffart
33289bde29 Merge remote-tracking branch 'origin/1.5'
Conflicts:
	CMakeLists.txt
	VERSION.cmake
	src/CMakeLists.txt
2014-03-14 17:27:50 +01:00
Markus Goetz
d5fd6309ed CMake: Fix target_link_libraries parameters 2014-03-12 15:03:11 +01:00
Markus Goetz
4e7e25c569 Improve libowncloudsync
* Introduce TokenCredentials
* Introduce static compiling
* Have compile flags for smaller compile
2014-03-11 17:05:44 +01:00
Klaas Freitag
aa4e90acfc Put ocsync to a private library - WIP 2014-03-11 10:18:07 +01:00
Olivier Goffart
e5a8cd4521 Merge branch '1.5'
Conflicts:
	VERSION.cmake
2014-03-06 14:10:08 +01:00
Markus Goetz
eb7074e9f0 csync: Don't free proxy settings on commit
Should fix #1502 and #1524
and #1459 and #1521
2014-03-04 18:44:52 +01:00
Markus Goetz
1c8f279214 csync: Remove more vio abstraction 2014-02-28 09:13:40 +01:00
Markus Goetz
5d58a8164c csync: Remove get_etag 2014-02-27 14:03:17 +01:00
Markus Goetz
71cc74a0d6 csync: Remove csync_get_local_username 2014-02-27 13:55:34 +01:00
Markus Goetz
77d9256e03 csync: Remove more unneeded code 2014-02-27 13:52:30 +01:00
Markus Goetz
e7fb84a491 csync: Remove capabilities 2014-02-27 13:42:20 +01:00
Markus Goetz
a652fec5a0 csync: Remove more unused stuff 2014-02-27 13:33:22 +01:00
Markus Goetz
0d34a2bca5 csync: Remove unused vio stuff 2014-02-27 13:25:31 +01:00
Markus Goetz
a2e8bfd962 csync: Remove unix_extensions 2014-02-27 13:23:35 +01:00
Markus Goetz
eff2427a03 csync: Remove time_sync_required 2014-02-27 13:12:21 +01:00
Olivier Goffart
869793592d Merge branch '1.5'
Conflicts:
	VERSION.cmake
	src/mirall/owncloudpropagator.cpp
	src/mirall/owncloudpropagator.h
2014-02-27 11:40:34 +01:00
Daniel Molkentin
d4fa06c4e1 Fix potential crash in c_iconv on Mac OS X 2014-02-25 12:48:40 +01:00
Olivier Goffart
75cff87316 add missing copyright header 2014-02-24 19:32:41 +01:00
Olivier Goffart
f92cf3dee3 ammand last commit
We should not close the directory twice in the normal case
2014-02-21 19:09:38 +01:00
Olivier Goffart
a71cb1d3ef Fix potential crash in case of abort while update:
We need to reset ctx->remote.read_from_db  BEFORE caling vio_closedir
Otherwise, it may interpret the handle as a 'bdtree' handle instead of
a owncloud handle.

Should fix #1442
2014-02-21 16:57:24 +01:00
Markus Goetz
4630244b51 Windows: Special case csync_vio_local_stat
By not calling tstat _and_ GetFileInformationByHandle, but only
GetFileInformationByHandle, we can save some precious msec in the local
update phase.
2014-02-21 14:15:34 +01:00
Markus Goetz
f1fa1f125d Fix previous commit 2014-02-19 17:39:11 +01:00
Markus Goetz
141f005c34 Ignore conflict files all the time
The OwncloudCmd currently does not load the exclude files.
It is safer to just always ignore conflict files.
2014-02-19 17:16:10 +01:00
Markus Goetz
fcc0e89044 Update phase: Allow benchmarking / progress update 2014-02-18 21:41:20 +01:00
Olivier Goffart
93f31fa9d7 Merge branch '1.5' 2014-02-12 16:44:24 +01:00
Olivier Goffart
1a9a14bdec Fix problems if a file is moved, and another file is created with the same name 2014-02-12 13:44:32 +01:00
Klaas Freitag
593d528b6a Removed unused function. 2014-02-07 11:57:10 +01:00
Klaas Freitag
3649869650 Optimize restoring of the remote tree from database.
If the etag of a directory hasn't changed, the content for the csync
tree can be restored from database. The code doing that is now optimized
so that this does not take so long any more.
2014-02-07 11:53:58 +01:00
Olivier Goffart
bb378902ae Also force an update of the etag in case of renames
Imagine we have a file:
  foo/bar/moo
if we do     mv 'foo' 'foo2' and that we issue a MOVE on the server
and will update the entry 'foo' in the database with the new etag
If we write the etag of foo but not the etag of the sub item, when
we read from db on the next sync, we will miss them and beleive they
have been removed on the server
2014-02-06 17:56:27 +01:00
Olivier Goffart
ee3df45fd8 remove csync_lock
It is not used anymore for a long time
2014-02-05 17:31:34 +01:00
Daniel Molkentin
44e09892f4 Remove cmake warning 2014-02-02 22:59:08 +01:00
Klaas Freitag
08d08e1f29 SAFE_FREE added as result to valgrind check. 2014-02-02 12:51:19 +01:00
Daniel Molkentin
93db6ca6ab Properly install cmake in OS X app bundle 2014-01-30 22:09:37 +01:00
Olivier Goffart
5119d5d366 Remove csync_config
commit c585c73044 removed the use of it.
So remove this code completely as it is no longer used
2014-01-26 18:39:47 +01:00
Klaas Freitag
c585c73044 Do not load the config file and csync exclude list. 2014-01-24 13:43:05 +01:00
Daniel Molkentin
86eb68df7f csync_rename.cc: Remove superflous semicolon 2014-01-24 10:50:33 +01:00
Klaas Freitag
d868df3b9b Fix windows compilation after having merged in csync. 2014-01-23 15:19:27 +01:00
Olivier Goffart
19a19978b7 fix csync BINARYDIR and SOURCEDIR 2014-01-20 16:16:29 +01:00
Olivier Goffart
b93efbaefe EIO is not necessarily a proxy error.
Should change error message such as
   "CSync failed to connect through a proxy. 500 Internal Server Error"
To:
   "CSync processing step update failed. 500 Internal Server Error"
2014-01-20 13:58:54 +01:00
Olivier Goffart
c7227297af Make it compile with the merge of csync mirall 2014-01-15 12:20:03 +01:00
Olivier Goffart
bf7ca60bec Move csync in order to merge it with mirall 2014-01-13 14:39:50 +01:00