1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2026-04-03 18:11:32 +02:00

Compare commits

..

918 Commits

Author SHA1 Message Date
Daniel Molkentin
17a4299f74 Fix nautilus python integration 2014-11-06 19:26:43 +01:00
Daniel Molkentin
776f4dc316 v1.7.0 2014-11-06 15:53:17 +01:00
Daniel Molkentin
5db55d9e29 Prettify Changelog 2014-11-06 15:41:23 +01:00
Christian Kamm
5c9564ac08 Add to 1.7 changelog. 2014-11-06 15:31:09 +01:00
Daniel Molkentin
5c5a89c1a4 Revert "Bump binary directory to current master"
This reverts commit af4e9c30f5.

This is consistent with 176413d312.
2014-11-06 15:21:39 +01:00
Daniel Molkentin
176413d312 Revert "Windows Shell Integration: Show status icon for root folder"
This reverts commit 5805ffebec.

There is no good way to fix this on the Mirall side without risk.
Delay until after 1.7.0
2014-11-06 15:18:54 +01:00
Olivier Goffart
b70ecc3dd3 Never overwrite the mtime from the local file system in the db when updating the metadata
Attempt to fix #2431
2014-11-06 15:13:10 +01:00
Christian Kamm
174e1acbc7 Folder::wipe(): Remove partial downloads and -shm,-wal db files. 2014-11-06 12:49:02 +01:00
Christian Kamm
1f09a24a72 Resync button: Remove partial downloads too. #2445 2014-11-06 12:17:04 +01:00
Christian Kamm
eed91ddf46 Legacy propagator: Don't use mtime retrieved via _fstat64.
May be the cause of #2431
2014-11-06 12:16:55 +01:00
Klaas Freitag
6eec896282 FolderWatcher: Check for hidden outside of loop 2014-11-06 09:23:30 +01:00
Klaas Freitag
a78bb252de Nautilus shell: Remove some useless logging. 2014-11-06 09:23:30 +01:00
Jenkins for ownCloud
0ba07f19f7 [tx-robot] updated from transifex 2014-11-06 01:25:24 -05:00
Christian Kamm
a49a6bfd88 Logging: Report setModTime failures.
Ths may be helpful for #2252 and maybe even #2431.
2014-11-05 13:20:19 +01:00
Christian Kamm
b87931c0a9 Logging: Print etags, not just result of comparison. 2014-11-05 13:08:53 +01:00
Christian Kamm
9b640d586b Wizard: Fix local folder warning in advanced setup wizard. #2362
The _oldLocalFolder should always be the previously configured
folder, not the one that was most recently chosen on the wizard
page.
2014-11-05 12:10:41 +01:00
Christian Kamm
7440ffc0e6 Download: Fix data loss when rename fails. #2428 2014-11-05 11:00:46 +01:00
Jenkins for ownCloud
63e901cd0b [tx-robot] updated from transifex 2014-11-05 01:25:23 -05:00
Daniel Molkentin
af4e9c30f5 Bump binary directory to current master 2014-11-04 09:33:04 +01:00
Daniel Molkentin
5805ffebec Windows Shell Integration: Show status icon for root folder 2014-11-04 09:30:29 +01:00
Jenkins for ownCloud
39bfacf1d5 [tx-robot] updated from transifex 2014-11-04 01:25:23 -05:00
Daniel Molkentin
8d30fc2718 Update binary subrepo to master 2014-11-03 22:51:55 +01:00
Daniel Molkentin
19daff36b0 Windows Overlay: Fix icon refresh
The condition for the refresh was inverse of what it should have been.
2014-11-03 20:46:35 +01:00
Daniel Molkentin
c34c8ff358 Windows Overlay: Use FLUSHNOW everywhere to speed up updates 2014-11-03 20:45:38 +01:00
Daniel Molkentin
af68cb6029 Move binary submodule to current master 2014-11-03 11:17:04 +01:00
Jenkins for ownCloud
6b6b212643 [tx-robot] updated from transifex 2014-11-03 01:25:21 -05:00
Jenkins for ownCloud
dd2a71fa8f [tx-robot] updated from transifex 2014-11-02 01:25:21 -04:00
Jenkins for ownCloud
cd72d133a3 [tx-robot] updated from transifex 2014-11-01 01:25:22 -04:00
Jenkins for ownCloud
d3662d0e34 [tx-robot] updated from transifex 2014-10-31 01:25:27 -04:00
Markus Goetz
cf6219bb6f NetworkJobs: Improve timeout handling and increase timeout by 5 sec 2014-10-30 11:54:58 +01:00
Christian Kamm
45eeb5065f Download: Avoid overwriting file with case conflict. #1914 2014-10-30 09:06:53 +01:00
Jenkins for ownCloud
f563eb1f63 [tx-robot] updated from transifex 2014-10-30 01:25:30 -04:00
Klaas Freitag
1029f9521c tests: exit t5.pl if running against ownCloud 6
t5.pl checks the environment variable SERVER_VERSION and if that equals
"owncloud6" it bails out after a check of the sharing ocs api.
2014-10-29 14:24:36 +01:00
Klaas Freitag
825eca078d tests: make t1.pl work on jenkins, for that disable a size compare. 2014-10-29 14:01:58 +01:00
Olivier Goffart
1eccfb798f Add missing license headers
Part of #2068
2014-10-29 13:30:46 +01:00
Olivier Goffart
7810da51a8 Propagator: report error when deleting directories
Will help to understand why a directory cannot be removed

Will help for #2348
2014-10-29 12:23:48 +01:00
Olivier Goffart
a470138450 Windows Shell Integration: refresh the cache on UPDATE_VIEW
Attempt to fix #2383
2014-10-29 11:00:51 +01:00
Markus Goetz
7bad731ad2 CheckServerJob: Guard again null reply
Lucia had reported a crash in this function
2014-10-29 09:38:20 +01:00
Jenkins for ownCloud
eeb54290b3 [tx-robot] updated from transifex 2014-10-29 01:25:27 -04:00
Markus Goetz
782463589e ownSql: Also mention filename 2014-10-28 21:50:09 +01:00
Markus Goetz
ff570c4a6b ownSql: Don't set busy timeout on bad object 2014-10-28 21:46:30 +01:00
Klaas Freitag
105ff694f2 SyncEngine: Handle 503 condition as soft error to properly handle etags.
Otherwise the ETags could be removed from the db and cause file
deletes.
2014-10-28 17:13:21 +01:00
Jenkins for ownCloud
26ff6be63c [tx-robot] updated from transifex 2014-10-28 01:25:42 -04:00
Daniel Molkentin
47e3da9ebf Merge pull request #2414 from owncloud/fix_2365
Doc: Fix build documentation, adjust it to 1.7.
2014-10-27 16:15:14 -04:00
Daniel Molkentin
b7ce5ba82a Doc: Fix build documentation, adjust it to 1.7.
Fixes #2365
2014-10-27 16:14:32 -04:00
Olivier Goffart
5723abe6eb Merge remote-tracking branch 'origin/fix_service_unavailable' into 1.7 2014-10-27 20:49:46 +01:00
Daniel Molkentin
95a9b0427c doc: Fix markup in build.rst 2014-10-27 14:54:23 -04:00
Klaas Freitag
0692fea9d8 discovery: handle 503 reply code from server for directories
503 for directories means that the dir is a mounted directory from an
external mount which currently is not available. The directory is
ignored and not traversed into during discovery phase.
2014-10-27 19:21:12 +01:00
Markus Goetz
b0882a5cd2 Fix compile 2014-10-27 17:18:49 +01:00
Markus Goetz
4c1a0005e6 Make two more asserts usable in nondebug 2014-10-27 16:01:18 +01:00
Markus Goetz
05ceed926c SyncEngine: Log for an assert, return -1 for nondebug compile 2014-10-27 15:52:17 +01:00
Klaas Freitag
b691521662 tests: Fix CSync Journal test, use real CSYNC struct from csync_private.
This fixes bug #2396
2014-10-27 13:15:33 +01:00
Olivier Goffart
ce300d88ee Wizard: show the choice to start a clean sync if the directory exist even on new accounts
Task #2406
2014-10-27 13:05:17 +01:00
Brandon Coleman
05c0249672 correct spelling on user is empty error. 2014-10-27 07:59:31 -04:00
Brandon Coleman
2498c13078 options are required at the beginning of owncloudcmd.
Conflicts:
	src/owncloudcmd/owncloudcmd.cpp
2014-10-27 07:59:31 -04:00
Klaas Freitag
ab5dae741a Show GIT SHA sum in cmake output. 2014-10-27 11:54:22 +01:00
Olivier Goffart
cddad94e45 Selective Sync: change the label text
to specify that the files will be removed from the local folder

Task #2404
2014-10-27 11:33:25 +01:00
Jenkins for ownCloud
2f0a40c1c8 [tx-robot] updated from transifex 2014-10-27 01:25:20 -04:00
Jenkins for ownCloud
3b1ff5bf41 [tx-robot] updated from transifex 2014-10-26 01:25:20 -04:00
Daniel Molkentin
1bd1c61c3c Merge pull request #2399 from r2evans/patch-1
add 64-bit windows registry location
2014-10-25 10:31:04 -04:00
r2evans
9cd81d87b2 add 64-bit windows registry location 2014-10-25 07:25:18 -07:00
Jenkins for ownCloud
59efea1b0e [tx-robot] updated from transifex 2014-10-25 01:25:22 -04:00
Daniel Molkentin
d0b40bab47 Merge pull request #2391 from owncloud/ignore_windows_reserved_characters
Ignore reserved words on Windows
2014-10-24 15:39:21 -04:00
Daniel Molkentin
d76192cce1 Ignore reserved words on Windows
Fixes #2385 and #2386
2014-10-24 13:18:57 -04:00
Klaas Freitag
0e828d802e Bump version to 1.7.0rc1 2014-10-24 18:20:41 +02:00
Klaas Freitag
9505d7cc51 Updated changelog for 1.7.0 2014-10-24 18:19:16 +02:00
Christian Kamm
1c4072e231 Selective sync ui: Fix #2390 2014-10-24 16:11:29 +02:00
Klaas Freitag
86e13ea06f FolderMan: Use folderForPath method to get the folder object for a path 2014-10-24 15:07:33 +02:00
Klaas Freitag
c12d3870cd Merging work branch for a bug fix for bug #2379.
It closes all db connections if the new local path is a already
synced folder path.
2014-10-24 14:43:48 +02:00
Christian Kamm
fce76a13cb Sync scheduling: Only do a follow-up sync 3 times. #2355
After trying again immediately for 3 times, no more fast follow-ups
are run until a sync finishes without needing a fast follow-up.
2014-10-24 13:31:48 +02:00
Christian Kamm
82b14370fc Sync scheduling: Only retry up to twice after fail. #2386
Previously when a sync failed, we'd retry very soon (30s) no matter how
often a sync had failed before. After this change we'll retry twice and
then back off to the regular 5min interval.
2014-10-24 13:31:48 +02:00
Klaas Freitag
a9d8e9dcd8 Setupwizard: Close the database in case of moving the folder. 2014-10-24 13:05:29 +02:00
Klaas Freitag
542e989046 Setup Dialog: Terminate sync if the new folder is a an actual folder. 2014-10-24 11:59:56 +02:00
Klaas Freitag
f5c199740d Followup: To unregister a path in socket api use the alias of folder. 2014-10-24 11:36:01 +02:00
Klaas Freitag
f37b81c8b7 Unregister path in socketapi before removing it. 2014-10-24 11:12:06 +02:00
Christian Kamm
c0ea69ee24 SqlQuery: Reset after each successful exec().
In e5269a4151 I moved the reset calls to
before the first bindValue() because we didn't consistently reset()
after exec().

However, some queries may keep a lock on the database so it is necessary
to reset() as soon as the data is read. This commit reintroduces these
reset() calls.
2014-10-24 10:11:00 +02:00
Christian Kamm
5640cbf653 SqlDatabase: Make it non-copyable. 2014-10-24 09:56:30 +02:00
Jenkins for ownCloud
6d81e5c87a [tx-robot] updated from transifex 2014-10-24 01:25:23 -04:00
Daniel Molkentin
3c7ff97ed4 SocketAPI: Don't use a theme dependent name for now
We will revert this once #2388 is implemented
2014-10-23 17:46:17 -04:00
Craig Morrissey
2120ff8037 fix resources path and permissions 2014-10-23 16:42:32 -04:00
Daniel Molkentin
92c35c6aa6 Update reference to binary submodule 2014-10-23 15:09:49 -04:00
Daniel Molkentin
149b16aefd Win32 Shell Integration: Use RegDeleteKey instead of RegDeleteKeyEx
RegDeleteKeyEx does not exist on Windows XP 32 bit

Fixes: #2165
2014-10-23 21:00:31 +02:00
Klaas Freitag
114c38c1ff csync tests: add some debug code to get behind the jenkins fails. 2014-10-23 17:33:47 +02:00
Christian Kamm
e5269a4151 Add SyncJournalDB autotests.
There also was a bug in syncjournaldb: in some error conditions the
sql query wasn't reset properly. We now always reset a query before
calling bindValue.
2014-10-23 15:15:47 +02:00
Markus Goetz
81584c6d51 VERSION.cmake: rc1 2014-10-23 12:22:07 +02:00
Markus Goetz
0d9ae241c9 OwnCloudFinder: Rename to SyncStateFinder
Project file names stay the same, only the output file(s) changed
2014-10-23 12:19:19 +02:00
Klaas Freitag
e726e7aad8 util: Use canonicalFilePath to clean the path opened by explorer.
This fixes bug #2299
2014-10-23 10:41:07 +02:00
Jenkins for ownCloud
c7c05ea869 [tx-robot] updated from transifex 2014-10-23 01:25:33 -04:00
Daniel Molkentin
83880aed52 Add proper background for OS X installer
Fixes #2335
2014-10-22 18:02:19 -04:00
Olivier Goffart
de56b753d1 protocolwidget: fix string that need to use plural translation 2014-10-22 18:26:40 +02:00
Olivier Goffart
dab01e3f3f csync_update: add the perms in the log 2014-10-22 17:25:38 +02:00
Olivier Goffart
e46ab72718 SocketAPI: Show error when we are not allowed
Issue #1931
2014-10-22 17:25:38 +02:00
Klaas Freitag
9f6d7eb587 tests: use the ocs_url in the same semantics as the 1.6 branch. 2014-10-22 16:06:39 +02:00
Daniel Molkentin
bbd9098e44 Switch git submodule for qtmacgoodies back to shadone 2014-10-22 09:58:08 -04:00
Markus Goetz
47ad4e3fe8 CSync: Close/Reopen DB between update and reconcile
update and reconcile happen in different threads. This code is safer.
(Even though depending on sqlite3 version it should work anyway)
2014-10-22 15:42:13 +02:00
Olivier Goffart
9330d2e1e8 SocketAPI: always clean the path and use the normal slash 2014-10-22 15:33:35 +02:00
Olivier Goffart
020e19f770 SocketAPI: Fix all files are new
(Introduced because of bad resolution of merge conflict
in my last commit)
2014-10-22 15:32:09 +02:00
Olivier Goffart
3be5600caf t6.pl: fix missing space in curl command 2014-10-22 15:16:22 +02:00
Olivier Goffart
22dd275b15 SocketAPI: Fix the shared symbol, including for owncloud6 Shared dir
The shared symbol would not appear if the status came for estimateState

Also added the shared symbol for the Shared/ directories (owncloud 6 compat)
2014-10-22 15:10:21 +02:00
Markus Goetz
6342e76e19 Wizard: Change misleading text 2014-10-22 15:06:33 +02:00
Markus Goetz
55dd149a03 SocketAPI: Less verbose 2014-10-22 14:43:23 +02:00
Markus Goetz
39a0f28753 Move qtmacgoodies module forward 2014-10-22 14:43:03 +02:00
Olivier Goffart
dd45b448d9 t6.pl: pass the --insecure flag to curl so it works on the test machine 2014-10-22 13:57:22 +02:00
Olivier Goffart
7740150576 Selective Sync widget: add a "Loading..." label
Task #2088
2014-10-22 13:48:05 +02:00
Olivier Goffart
4f367faf4d SocketAPI: Show an error for files inside the selective sync folders
Task #2283
2014-10-22 13:31:20 +02:00
Olivier Goffart
3840186dd8 Utility: fix function signature 2014-10-22 13:31:20 +02:00
Christian Kamm
d77fcea365 Csync tests: Don't use sqlite3_close_v2. 2014-10-22 12:44:33 +02:00
Daniel Molkentin
ed51a45187 Add title to selective sync dialog 2014-10-22 06:29:22 -04:00
Christian Kamm
ba86988101 Csync tests: Fix broken tests.
It is no longer ok to call csync_statedb_load() on a non-existant
database since it opens readonly only.
2014-10-22 12:22:13 +02:00
Olivier Goffart
6073e3f345 SocketAPI: do not show a progress icon in case of errors 2014-10-22 12:19:57 +02:00
Olivier Goffart
d31ccacf57 SocketAPI: show an ignored icon for paused folders 2014-10-22 12:19:57 +02:00
Christian Kamm
de48e65091 Csync tests: Fix compile. 2014-10-22 11:45:48 +02:00
Klaas Freitag
3243365210 JournalDb: Do not longer always have a write operation on version table.
Rather read the value from the table and if it is what we expect do not
write it.
2014-10-22 10:59:58 +02:00
Jenkins for ownCloud
8dc3f2146a [tx-robot] updated from transifex 2014-10-22 01:25:37 -04:00
Markus Goetz
a993496ab4 SyncJournalDB/SyncEngine: Properly detect 1.5 upgrade
Else we end up never reading file data from the DB.
2014-10-21 20:25:15 +02:00
Markus Goetz
61e72ef50b CSync: statedb sanity check changes 2014-10-21 18:09:23 +02:00
Markus Goetz
d7ac878efd SyncJournalDB: Fix deleteBatch 2014-10-21 16:37:51 +02:00
Markus Goetz
e5a0db8782 SyncJournalDB: Fix version table filling up 2014-10-21 16:37:39 +02:00
Markus Goetz
24d4840c93 SyncJournalDB: Set WAL files to hidden 2014-10-21 15:58:56 +02:00
Markus Goetz
fa70798fb5 SyncJournalDB: WAL checkpoint at end of sync 2014-10-21 15:41:11 +02:00
Markus Goetz
1af480ea3b CMake: Fix RPATH 2014-10-21 15:39:31 +02:00
Olivier Goffart
a76fc0ee5a SocketAPI: send the change of the parent folder in the broatcast
Also do not compute the status if there is nno listeners
2014-10-21 15:26:51 +02:00
Olivier Goffart
80e86d6c1b ownsql: fix warning with clang
warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
2014-10-21 14:59:42 +02:00
Olivier Goffart
dc13e39bb1 SocketAPI: do not have a special case for UPDATE_VIEW on windows
This is a relique on the old times when there was no persistant connection
in the windows plugin
2014-10-21 14:57:50 +02:00
Olivier Goffart
98c5871d38 Windows shell integration: Add SHCNF_FLUSHNOWAIT to SHChangeNotify
(TortoiseSVN have this flag)

Also do not call SHChangeNotify if there was no change
2014-10-21 14:51:18 +02:00
Olivier Goffart
5a109d9293 Fix t3.pl
The fix in commit 86d8079 made the detection of changes inside
a directory more robust.
As a result, changes are detected inside a directory, even if the
files that are changed were moved away on the other remote, the algorithm
won't let the directory be removed and the directory will be re-created
2014-10-21 12:10:12 +02:00
Olivier Goffart
56316bc980 csync_reconcile: remove useless debug output 2014-10-21 11:47:18 +02:00
Klaas Freitag
21c8e65d13 csync tests: Fix test after db changes. 2014-10-21 11:26:04 +02:00
Olivier Goffart
86d8079739 Reconcile: Make sure not to loose new files added in a directory removed on the server
Found while investigating #2296

The problem is that we should not remove a directory locally if it contains
modified files.
But the modification time of the directory is not necessarily chaning (so
the instruction of the directory may still be NONE)

We have to move the child_modified test a bit down to be recursive
2014-10-21 10:38:21 +02:00
Jenkins for ownCloud
d2be45bce1 [tx-robot] updated from transifex 2014-10-21 01:25:34 -04:00
Markus Goetz
5d048c18bc Sqlite3: Switch to WAL
This is faster.
2014-10-20 23:09:28 +02:00
Markus Goetz
0fb779d363 SyncEngine: De-initialize recursive PROPFIND value correctly 2014-10-20 22:24:28 +02:00
Daniel Molkentin
d0ed82a686 We need SqlDatabase and SqlQuery to be exported
Required due to 53b3e5af1b
2014-10-20 19:58:10 +02:00
Markus Goetz
d33b68ccc9 CSync: Error out if DB error 2014-10-20 19:32:06 +02:00
Klaas Freitag
26f068bcab SocketApi: Properly manage the database connections.
Removed the fishy closeDb() method of SqlQuery again.
2014-10-20 17:31:33 +02:00
Markus Goetz
f0dc3725e8 ownSql: Still also use sqlite3 busy handler 2014-10-20 17:26:25 +02:00
Markus Goetz
2de22b408b SyncEngine: Avoid transaction warning 2014-10-20 17:20:58 +02:00
Klaas Freitag
04b62b139d Fix compile error and add warning. 2014-10-20 17:10:34 +02:00
Klaas Freitag
2f20f3c65d SocketApi: Instanziate Object to call QFileInfo::exists
QFileInfo on Qt4 does not have static members.
2014-10-20 17:05:14 +02:00
Klaas Freitag
53b3e5af1b SocketAPI: Use new class SqlQuery to cache the sql queries.
This results in better handling of the BUSY condition through SqlQuery.
2014-10-20 16:55:37 +02:00
Markus Goetz
7dbb98c2e5 SyncEngine/SyncJournalDB: Don't keep transactions open 2014-10-20 16:50:55 +02:00
Markus Goetz
8b35cda4c6 SyncEngine: Refactor startSync() code 2014-10-20 15:51:50 +02:00
Markus Goetz
cb36a37779 SyncEngine/SyncJournalDB: Fix creation of .csync_journal 2014-10-20 14:27:00 +02:00
Markus Goetz
704c5f2de7 NetworkJobs: Higher timeout for pre-oC7
Pre-oc7 has PHP session locking for PROPFIND (by recursive PROPFIND in csync_update),
the oc7 doesn't.
2014-10-20 13:34:09 +02:00
Klaas Freitag
3fcb0d2d6b SocketAPI: Properly release precompiled statements. Use sqlite3_close
rather than its v2 equivalent. That should make it compile on older
linux platforms.
2014-10-20 10:51:03 +02:00
Klaas Freitag
2dfe0ed42e Remove unused variable, fixes compile warning. 2014-10-20 10:51:03 +02:00
Daniel Molkentin
ac48fbae9c 1.7.0 beta4 2014-10-20 10:28:47 +02:00
Daniel Molkentin
6048a7143a Revert "Remove references to qsqlite3"
QtWebkit needs it

This reverts commit b1c10c8454.
2014-10-20 10:27:34 +02:00
Jenkins for ownCloud
7c24db07c2 [tx-robot] updated from transifex 2014-10-20 01:25:25 -04:00
Daniel Molkentin
271cdac474 Really use internal SQLite on Windows 2014-10-19 08:51:01 +02:00
Jenkins for ownCloud
79e2c132cc [tx-robot] updated from transifex 2014-10-19 01:25:24 -04:00
Klaas Freitag
b5736fb5a7 Sql: Handle SQLITE_BUSY properly for sqlite3_step and sqlite3_prepare.
Repeat the statements a couple of times and sleep in between.
2014-10-18 16:16:29 +02:00
Klaas Freitag
7822a6b000 csync_statedb: Finalize the precompiled statements after discovery.
As described in http://www.sqlite.org/cvstrac/wiki?p=MultiThreading precompiled
statements should not be used across thread borders. However, the reconcile
phase would reuse the statements if defined (it calls statedb function from
a different thread) so it is saver to finalize them at the end of the
update run.
2014-10-18 14:18:11 +02:00
Jenkins for ownCloud
306b63599c [tx-robot] updated from transifex 2014-10-18 01:25:33 -04:00
Daniel Molkentin
3021fb546e NSIS: Fix copying of qtbase translations 2014-10-17 16:37:37 +02:00
Olivier Goffart
a5bd437d48 Propagator: Fix renaming of files and case confflicts
Better fix for #1385 and #2318
2014-10-17 16:15:03 +02:00
Olivier Goffart
08156186fa Revert "propagator: Do not check for case clash when renaming"
This caused test regressions in t8.pl (#2318)

This reverts commit dad8c1c27c.
2014-10-17 16:15:03 +02:00
Markus Goetz
f1006ca8b0 owncloudcmd: Always need exclude list
Try to load the system list or the user supplied list.

For #2322
2014-10-17 15:58:01 +02:00
Markus Goetz
93c85711d1 ownSql: Always use finish() 2014-10-17 13:39:48 +02:00
Markus Goetz
e5ef5f2410 Revert "socketapi: if the filename is empty, it's actually /"
Not needed, the socketapi checks for "".

This reverts commit 561e3c780d.
2014-10-17 13:29:34 +02:00
Daniel Molkentin
52a5729298 Merge pull request #2319 from owncloud/sqlite_capi
Introduce a common sqlite layer across csync and mirall.

This avoids conflicts that both each load different and/or updated sqlite versions.
2014-10-17 12:11:27 +02:00
Daniel Molkentin
b9849580f8 ReNautilus Shell Intgration: Remove debug output 2014-10-17 12:09:30 +02:00
Daniel Molkentin
4525161e7c Updater: allow overriding update URL through environment 2014-10-17 12:07:18 +02:00
Daniel Molkentin
dee6d18d69 Discovery phase: Improve UI by quoting folder names 2014-10-17 12:07:18 +02:00
Daniel Molkentin
d44179142f Discovery phase: Properly decode percent encoding 2014-10-17 12:07:18 +02:00
Klaas Freitag
c66c01245b Beautified some debug logging strings. 2014-10-17 11:35:06 +02:00
Jenkins for ownCloud
681c43631b [tx-robot] updated from transifex 2014-10-17 01:25:34 -04:00
Klaas Freitag
2f740fe471 tests: Added unicode read an write testcase for ownsql. 2014-10-16 21:21:47 +02:00
Markus Goetz
b1c10c8454 Remove references to qsqlite3 2014-10-16 17:51:17 +02:00
Markus Goetz
1d5b3aadea sqlite3: Bundle 3.8.6 for Mac and Windows
it is linked into ocsync.
2014-10-16 17:38:45 +02:00
Markus Goetz
2d420cd72c ownSql: Always use SQLITE_TRANSIENT
More safe.
2014-10-16 15:30:50 +02:00
Markus Goetz
707d6880a8 main: Show console message if already running 2014-10-16 15:25:33 +02:00
Markus Goetz
dbad1a8d45 ownSql: Don't allow copying of SqlQuery
This fixes a crash on OS X where the destructor
calls sqlite3 to invalidate the underlying handle.
2014-10-16 15:10:25 +02:00
Klaas Freitag
36eaff92e5 JournalDb: Some Sql statement fixes, make t7 work again.
plus some minor fixes.
2014-10-16 11:22:57 +02:00
Klaas Freitag
e51c299937 ownSql: create an null value of an empty string in bindValue. 2014-10-16 11:20:50 +02:00
Klaas Freitag
8c7953a47c ownSql: Proper initialization of result value plus assert on it. 2014-10-16 11:20:21 +02:00
Daniel Molkentin
4527784905 Second part of #1661
- QT_INSTALL_TRANSLATIONS was not defined in Qt5
- Some languages have been split up in multiple qm's. We only need qtbase for now
2014-10-16 11:08:29 +02:00
Klaas Freitag
ee8a93ae9a ownSql: Proper initialization of errId 2014-10-16 10:39:10 +02:00
Jenkins for ownCloud
6096362052 [tx-robot] updated from transifex 2014-10-16 01:25:36 -04:00
Klaas Freitag
89c51e7649 ownsql: Implement the transaction functions. 2014-10-15 19:47:25 +02:00
Klaas Freitag
6c92076ec3 tx.pl: Adopt test t6.pl to the new way of handling precondition failed. 2014-10-15 19:25:34 +02:00
Olivier Goffart
2bba4134fb owncloudgui: Fix a small leak
The systray icon were not destroyed while qutting
2014-10-15 18:11:52 +02:00
Daniel Molkentin
10175c8d57 Update binary/ sha 2014-10-15 16:52:16 +02:00
Olivier Goffart
7804bf0a9a Windows Shell Integration: Use the right parametter to SHChangeNotify 2014-10-15 16:47:08 +02:00
Klaas Freitag
336c95ce5b ownsql: Cleanups: In modern C++, we use 0 instead of NULL 2014-10-15 16:46:39 +02:00
Klaas Freitag
babe891242 SyncEngine: Show a warning if post update script can not be exec. 2014-10-15 16:43:58 +02:00
Olivier Goffart
bb37e93f52 Windows shell integration: Do proper wait 2014-10-15 16:09:35 +02:00
Olivier Goffart
aa0f2c64ff Windows Shell Integration: fixeWindows Shell Integration: fixe 2014-10-15 15:57:15 +02:00
Olivier Goffart
e66ca267f4 Windows Shell Integration: try to wait for connection 2014-10-15 15:13:04 +02:00
Klaas Freitag
eeb5ca42e0 ownsql: Added some paranthisis to make clear whats happening. 2014-10-15 13:29:25 +02:00
Klaas Freitag
74ec90c725 tx.pl: Fix sharing api url, some whitespace fixes. 2014-10-15 13:28:53 +02:00
Daniel Molkentin
03ee742981 Correct lookup logic for Qt translations
Fixes #1661
2014-10-15 09:33:38 +02:00
Jenkins for ownCloud
b4c86bcf40 [tx-robot] updated from transifex 2014-10-15 01:25:24 -04:00
Klaas Freitag
0094c1ecf5 Make the sync work with new sql implementation. 2014-10-14 20:51:51 +02:00
Klaas Freitag
6b5fcf53eb Test module for the new sql implementation. 2014-10-14 20:51:34 +02:00
Olivier Goffart
4b001a77b3 Windows Shell Integration: Use the QLocalSocket on windo and do the request assynchroniously
Squashed commit of the following:

commit 4d9b072f560fa171a1390b7c74425614aa20e955
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Tue Oct 14 16:04:02 2014 +0200

    Remove useless variable

commit 8e85de0307ec5f31bf3f92a7de793fed7d41c2ea
Author: Daniel Molkentin <danimo@owncloud.com>
Date:   Tue Oct 14 16:01:52 2014 +0200

    Make Windows Explorer Extension build

commit 8e2942cd9fd32e3af72d60cba0d06bd9d6222a45
Author: Daniel Molkentin <danimo@owncloud.com>
Date:   Tue Oct 14 11:39:37 2014 +0200

    Fix compilation

commit 0fc0c0e0e0c7e58ad97f62700256c7d1f8c0670b
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Tue Oct 14 11:48:32 2014 +0200

    Windows Shell Integration: Try to let the thread notify about changes when there are changes

commit 4a1712b7c03269ca3007f167b8f313ea47655967
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Tue Oct 14 11:35:20 2014 +0200

    Windows Shell Integration: Share the RemotePathChecker amongst all the OCOverlay instances

commit 2d87408e9af5a4d7ab71c460ce606ba1f367c09f
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Mon Oct 13 18:55:15 2014 +0200

    Windows Shell Integration: Attempts to wait on multiple objects (WIP)

commit e448e427b6d1561ad7a40d08fc6632f4d2b4ef44
Author: Daniel Molkentin <danimo@owncloud.com>
Date:   Mon Oct 13 17:58:02 2014 +0200

    Introduce a worker thread

commit 2344407ec0bc1ce173ebbacadcf3992d62d94078
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Mon Oct 13 17:03:47 2014 +0200

    Windows Shell Integration:  try to keep the socket open using a thread (WIP)

commit ea6d5273ed60d8bc3f1c5d5c6936364d783a1c0f
Author: Daniel Molkentin <danimo@owncloud.com>
Date:   Mon Oct 13 15:27:46 2014 +0200

    Make Explorer plugin work again with named pipes

    This is a temporary hack, which needs more refactoring.

commit 44a3437a44082379efa0078c9afd7b8bbde930de
Author: Daniel Molkentin <danimo@owncloud.com>
Date:   Sat Oct 11 07:31:24 2014 +0200

    Fix code

commit 123390a0f3516c0078309d7048c6d2acb9293676
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Fri Oct 10 16:29:35 2014 +0200

    Windows shell integration: Use named pipe  (WIP)

commit 9eea7e2321abeac6b8db0bd85bfce612dbf6bb20
Author: Olivier Goffart <ogoffart@woboq.com>
Date:   Wed Oct 1 12:04:13 2014 +0200

    Windows Shell Integration: Simplify StringUtil

    This fixes a memory leak in CommunicationSocket::ReadLine
2014-10-14 16:05:48 +02:00
Klaas Freitag
357c08c5b3 NewSQL: minor fixes to get stuff going 2014-10-14 12:18:33 +02:00
Klaas Freitag
e7d9ec50dc Merge branch 'sqlite_capi' of github.com:owncloud/mirall into sqlite_capi
Conflicts:
	src/mirall/socketapi.cpp
2014-10-14 11:43:10 +02:00
Klaas Freitag
09b0ba31ef Sql: New implementation of ownSql class to go away from Qt's own Sql 2014-10-14 11:14:57 +02:00
Jenkins for ownCloud
8231bc931b [tx-robot] updated from transifex 2014-10-14 01:25:23 -04:00
Klaas Freitag
26ffa078ef SocketAPI: Cache database conections and statements 2014-10-13 17:31:40 +02:00
Markus Goetz
eb60aca34f SyncJournalDB: Clarify debug message 2014-10-13 17:29:26 +02:00
Markus Goetz
4d3020421a SocketAPI: Remove old dbFileRecord function
We will use the _capi functions
2014-10-13 17:29:26 +02:00
Markus Goetz
f1ce0a1cf3 SocketAPI: Use non-recursive (heuristic) computation of icons 2014-10-13 17:29:26 +02:00
Klaas Freitag
dd28a645a1 SocketAPI: Cleanup, removed helper namespace, added as private methods. 2014-10-13 15:38:57 +02:00
Klaas Freitag
561e3c780d socketapi: if the filename is empty, it's actually / 2014-10-13 15:36:13 +02:00
Klaas Freitag
8371e34d87 Nautilus overlay: minor cleanups 2014-10-13 14:59:23 +02:00
Klaas Freitag
46fd79604d JournalDb: Do not use static variable for path. 2014-10-13 14:49:53 +02:00
Klaas Freitag
d08c2de619 Use sqlite C api. 2014-10-13 14:14:43 +02:00
Jenkins for ownCloud
a452a05e52 [tx-robot] updated from transifex 2014-10-13 01:25:23 -04:00
Daniel Molkentin
0a96aa3aaf Merge pull request #2307 from owncloud/fix-version-jw
owncloudcmd --version needs this.
2014-10-12 20:17:57 +02:00
Jürgen Weigert
07bcaaebf9 unreachable --version code made reachable.
error message improved.
2014-10-12 19:28:13 +02:00
Jenkins for ownCloud
0cde7c8ac1 [tx-robot] updated from transifex 2014-10-12 01:25:42 -04:00
Markus Goetz
b285e98988 SQlite: Print versions we use 2014-10-11 17:33:35 +02:00
Klaas Freitag
ab40ba2f75 owncloudcmd: Handle trust ssl switch correctly by overwriting trustssl
method in a subclass of HTTPCredentials.
2014-10-11 17:17:43 +02:00
Klaas Freitag
bbcb8ba3e7 credentials: Allow to trust ssl certs in subclasses of HTTPCredentials.
This allows to handle the --trust option in owncloudcmd. In the
owncloudcmd subclass of the httpcredentials, we allow to manually trust
the ssl certificate through a command line switch.
2014-10-11 17:17:43 +02:00
Markus Goetz
ef48de34f7 Logger: Log the thread pointer
Maybe we can somehow reduce this to make it not so many characters wide?
2014-10-11 16:58:47 +02:00
Olivier Goffart
7e898cf60c SelectiveSync: rename blacklist to selectiveSyncBlackList in some places
Issue #2301
2014-10-11 16:24:45 +02:00
Klaas Freitag
2f5cea0e73 owncloudcmd: Add a custom ssl verification callback for neon.
That fixes the SSL related problems we had with ci.owncloud.org
2014-10-11 15:55:37 +02:00
Olivier Goffart
282abdd804 Sync engine: Restart sync when we get a precondition failed error 2014-10-11 15:40:28 +02:00
Olivier Goffart
9b178c5bb2 Sync engine: Do not write to the database too early
It is possible that we have should_update_etag set to true for files
that we also need to propagate.  In which case we must not write to the DB
too early as this could cause data loss.  (cf: issue #2296)
2014-10-11 15:40:28 +02:00
Klaas Freitag
d491663143 owncloudcmd: Fix some slash screwup, to make the split succeed bug #2211 2014-10-11 15:14:07 +02:00
Klaas Freitag
8eaeba6486 owncloudcmd: Fix url handling with csync, make owncloudcmd sync again.
This fixes mirall issue #2211
2014-10-11 12:21:26 +02:00
Jenkins for ownCloud
631e67949e [tx-robot] updated from transifex 2014-10-11 01:25:35 -04:00
Daniel Molkentin
77d2cba155 owncloudcmd: don't prompt for password if it was provided 2014-10-10 18:04:00 +02:00
Daniel Molkentin
2149092c7a owncloudcmd: Fix crash 2014-10-10 18:04:00 +02:00
Olivier Goffart
100d1361b6 Add Folder wizard: Sort the folders when selecting the remote folder
Issue #1872
2014-10-10 16:56:05 +02:00
Daniel Molkentin
76f5266fa1 Fix small inefficiency in socketapi 2014-10-10 16:20:57 +02:00
Daniel Molkentin
3ebe3b1196 Use local socket (named pipe) connection also on Windows 2014-10-10 15:57:05 +02:00
Daniel Molkentin
c4f96c2fba owncloudcmd: Implement --version, fix strings
Part of #2211
2014-10-10 15:55:58 +02:00
Olivier Goffart
d880f2ffbc propagator: Do not show an error message saying it was done by user interaction if it was not
There is many reasons why we could abort (for example timeouts)
And in this case we should not show to the user it was aborted
by user interaction
2014-10-10 14:58:56 +02:00
Markus Goetz
f8f5a7ceaa OS X Overlay Icons: Fix static analyzer warnings 2014-10-10 11:44:40 +02:00
Markus Goetz
b01839e9a4 OS X: Remove dead JSON code 2014-10-10 11:44:40 +02:00
Markus Goetz
75dbf12ae6 CSync: Remove dead code 2014-10-10 11:44:40 +02:00
Klaas Freitag
9bb89dced5 Less offensive logging, only use error if there was one. 2014-10-10 10:16:59 +02:00
Olivier Goffart
661fe5df66 csync_statedb: fix inverted logic in testing if the sqlite was compiled with threads 2014-10-10 10:12:54 +02:00
Jenkins for ownCloud
8a93437e55 [tx-robot] updated from transifex 2014-10-10 01:25:39 -04:00
Olivier Goffart
b20752f13e Fix the build with clang and Qt4 2014-10-09 17:54:46 +02:00
Klaas Freitag
61967f6e1b csync tests: conform to read only db. 2014-10-09 17:45:20 +02:00
Markus Goetz
f0fef4f232 OS X: Fix .app creation for non-system Qt 2014-10-09 16:50:03 +02:00
Daniel Molkentin
7eb10a08b8 SSL error dialog: Remove debug noise 2014-10-09 16:49:31 +02:00
Olivier Goffart
4c83653d5d Selective sync: do not upload or rename file that would ends up in a not selected folder
Issue #2283
2014-10-09 16:50:03 +02:00
Christian Kamm
3149cd03be Sync scheduling: Never enqueue a folder while it is synced.
Issues: #2268, #2275
2014-10-09 15:55:10 +02:00
Christian Kamm
5314765410 fix compile 2014-10-09 15:55:10 +02:00
Olivier Goffart
621a37be15 Selective sync: Remove the etag of parent folders in the db when adding or removing items in the selective sync blacklist 2014-10-09 15:28:51 +02:00
Olivier Goffart
6de104a03a Selective Sync: ensure that the blacklist contains the last '/'
In the sync engine.  Because that makes tha tthe lower_bounds in selective sync works properly.

For example, if both "Test" and "Test Test" are in the list,  then "Test/Foo" would match the "Test Test"
 because slash is after space

Task #2289
2014-10-09 15:11:04 +02:00
Olivier Goffart
97560509ea Selective sync: change the text of the label.
Selective sync is a black list.  Unchecked folder are blacklisted
Partially checked folders are not in the blacklist and the files there
are sync'ed
2014-10-09 14:36:26 +02:00
Markus Goetz
32aaecd832 macdeployqt: Fix missing symbol 2014-10-09 12:07:00 +02:00
Christian Kamm
dfba8fbe5e CheckServerJob: Require status code 200. #2290 2014-10-09 11:06:00 +02:00
Klaas Freitag
32fea6523f Use climits for ULONG_MAX rather than modern C++ option 2014-10-09 11:03:07 +02:00
Klaas Freitag
d1c1a18226 SyncJournal: Use precompiled statement in blacklist query. 2014-10-09 10:05:20 +02:00
Klaas Freitag
04558beabe SyncJournal: Use the NOCASE Collate for blacklist query. 2014-10-09 10:05:20 +02:00
Klaas Freitag
425d0d77c5 Two little typo fixes. 2014-10-09 10:05:20 +02:00
Klaas Freitag
edf7cd29dd csync statedb: Set PRAGMA synchronous to NORMAL for read only db. 2014-10-09 10:05:20 +02:00
Klaas Freitag
27318dded6 csync statedb: Issue a warning if sqlite is not compiled thread safe. 2014-10-09 10:05:20 +02:00
Klaas Freitag
11fe0c5b4b csync statedb: Open the statedb in read only mode and with mutex set.
For that, sqlite3_open_v2 is used with the appropiate flags.
2014-10-09 10:05:20 +02:00
Christian Kamm
886f9d82f2 Sync scheduling: Improve logging. #2275 2014-10-09 09:01:35 +02:00
Jenkins for ownCloud
4f2fb4af5d [tx-robot] updated from transifex 2014-10-09 01:25:28 -04:00
Daniel Molkentin
6c8eab734e Remove C++11ism that doesn't work with older GCCs 2014-10-08 18:56:30 +02:00
Daniel Molkentin
9d5d6aff38 Q_DECL_OVERRIDE for Qt4 only for GCC >= 4.7 2014-10-08 18:55:41 +02:00
Christian Kamm
705cd571a5 Download: Don't store message body if status != 2xx #2280 2014-10-08 14:18:29 +02:00
Christian Kamm
48d3c75745 GET: Retry if bad range header used. #2280
* If a 416 is returned and we used a Range header, try again
  from scratch.
* The direct URL logic was also inconsistent for resumed downloads:
  it sent the Range header but didn't check the returned
  Content-Range header correctly. Now resuming is disabled for
  direct URL downloads.
2014-10-08 14:18:29 +02:00
Markus Goetz
6fbd28d228 Merge branch 'overlayicon_cache' into 1.7 2014-10-08 11:02:58 +02:00
Christian Kamm
285cb78962 Sync scheduling: Don't always force-sync. #2268
If lastEtag was null, a force sync was triggered. Force syncs
don't update the etag. The etag retrieval job would only run if
lastEtag was not null. So it could never become non-null.
2014-10-08 10:51:32 +02:00
Christian Kamm
708655d9b2 fix incomplete rename
from 9bd7ffe952
2014-10-08 09:36:47 +02:00
Christian Kamm
9bd7ffe952 blacklist: Fix stale blacklist removal. #2247
Use the right check to determine whether a file has a blacklist entry,
SyncFileItem::FileIgnored was incorrect because that denotes files from
the ignore list or blacklisted files with no retries left.

The blacklistedInDb flag does the right thing. Rename it to
hasBlacklistEntry to be more explicit.
2014-10-08 09:17:40 +02:00
Jenkins for ownCloud
51109ea485 [tx-robot] updated from transifex 2014-10-08 01:25:32 -04:00
Daniel Molkentin
1579c23ff1 Fix order in which credentials are getting fetched 2014-10-07 18:21:22 +02:00
Daniel Molkentin
961df010cb Propagator: Fix typo in Win32-only code 2014-10-06 15:39:49 +02:00
Jenkins for ownCloud
103986b320 [tx-robot] updated from transifex 2014-10-06 01:25:24 -04:00
Jenkins for ownCloud
764c0cdb03 [tx-robot] updated from transifex 2014-10-04 01:25:25 -04:00
Klaas Freitag
12b09fab67 CaseClash: more defensive logging on Windows. 2014-10-03 11:54:32 +02:00
Klaas Freitag
ed5a8ab090 Push version to beta3 2014-10-03 11:37:00 +02:00
Klaas Freitag
41fa562dce blacklisting: disable broken remove stale entries function for now. 2014-10-03 11:35:18 +02:00
Klaas Freitag
6c2ce06fea tx.pl: Set the SSL relaxing env variable. 2014-10-03 10:33:30 +02:00
Markus Goetz
ef019cdbfa OS X Overlay Icons: Fix Finder plugin crash
By enabling ARC for GCDAsyncSocket (as we should have done before
https://github.com/robbiehanson/CocoaAsyncSocket/wiki/ARC) there
is no chance anymore for a situation where the to-be-written NSData*
is deleted before the socket has had a chance to write it.
Interestingly, this only happened after switching to local sockets,
probably because of how immediatly the NSData* would be sent.

This commit also keeps the debug symbols for the Finder plugin.
2014-10-03 07:23:43 +02:00
Jenkins for ownCloud
1b02a1a6f3 [tx-robot] updated from transifex 2014-10-02 01:25:30 -04:00
Daniel Molkentin
1d8900dc19 OS X: write a qt.conf file 2014-10-01 23:57:14 +02:00
Daniel Molkentin
171fd22d91 Fix rpath for libraries 2014-10-01 21:41:56 +02:00
Daniel Molkentin
78d50f4033 CPack is still needed for Windows
This partially reverts commit dafd9c308f.
This partially reverts commit 7f836cc01b.
2014-10-01 21:16:18 +02:00
Klaas Freitag
fee18dd457 Push version to beta2 2014-10-01 21:04:13 +02:00
Klaas Freitag
81d3ce8257 cmake: Commented setting of the INSTALL_PREFIX var on Mac 2014-10-01 20:55:39 +02:00
Daniel Molkentin
5213970c3d OSX: fix signing script 2014-10-01 17:57:51 +02:00
Daniel Molkentin
bcc06af904 fix last commit 2014-10-01 17:46:29 +02:00
Daniel Molkentin
a98242a2b8 fix install target for macdeployqt 2014-10-01 17:32:17 +02:00
Daniel Molkentin
5f715ca063 OSX: fix Frameworks path in signing script 2014-10-01 16:04:24 +02:00
Daniel Molkentin
0ceeff62d6 Fix app signing on OS X 2014-10-01 15:34:42 +02:00
Daniel Molkentin
f53a7c0e4a Improve macdeploy script 2014-10-01 15:34:42 +02:00
Daniel Molkentin
41b07d045a OS X: Use a python script to fix for bundle fixup...
...rather than relying on cmake magic
2014-10-01 15:34:42 +02:00
Olivier Goffart
0d303f1d1f SelectiveSync: sort the item instead of using the order from the server
Task #2259
2014-10-01 13:47:24 +02:00
Markus Goetz
b6d97cfffb OS X Overlay Icons: Introduce a short term cache for rendered icons
This is for #2093
2014-10-01 13:21:29 +02:00
Jenkins for ownCloud
3e982ad34c [tx-robot] updated from transifex 2014-10-01 06:54:46 -04:00
Daniel Molkentin
dafd9c308f More removal of obsolete CMake code 2014-10-01 12:51:38 +02:00
Daniel Molkentin
7f836cc01b Kill obsolete Mac deployment code 2014-10-01 12:35:21 +02:00
Olivier Goffart
147fa60f81 Merge branch 'socketapi_localsocket' into 1.7 2014-10-01 12:34:22 +02:00
Olivier Goffart
a1b9405e2e Windows has not been ported back to QLocalSocket 2014-10-01 12:33:54 +02:00
Olivier Goffart
db02d44c6a No need to update mtime and etag after a move
The server keeps the mtime and etag anyway.
And changing the mtime also changes the etag and so make other clients re-download
the file instead of detecting the move
2014-10-01 11:22:00 +02:00
Klaas Freitag
dff1f77dfa SocketAPI: remove nonsense FIXME's. 2014-09-30 17:12:07 +02:00
Daniel Molkentin
1a2fff8ed8 OS X: Use a python script to fix for bundle fixup...
...rather than relying on cmake magic
2014-09-30 17:09:16 +02:00
Markus Goetz
52c12b33c3 OS X: CMD+H should hide the dialog 2014-09-30 15:21:55 +02:00
Klaas Freitag
29987ca2aa Overlays Linux: Add the state to the cache to save calls to add_emblem
The SocketAPI sends status updates for files without being asked for.
And in order to not draw the emblem again if it had not changed, the
state is compared before calling add_emblem
2014-09-30 13:57:06 +02:00
Markus Goetz
02f971b534 OS X Overlay Icons: Fix request for sync dir itself 2014-09-30 12:53:35 +02:00
Klaas Freitag
479b340d75 Folderman: Check if socketApi member is non zero, no crashes. 2014-09-30 12:33:51 +02:00
Klaas Freitag
06c48f58cc SyncEngine: Use proper start indicator, max unit64.
This avoids a warning.
2014-09-30 12:29:24 +02:00
Klaas Freitag
0ee81a2865 SocketAPI: Set permission of the socket Directory.
Set that to be accessible by the owner only.
2014-09-30 11:23:49 +02:00
Klaas Freitag
e78c251832 SocketAPI: Split up for specific linux and mac implementation. 2014-09-30 11:23:49 +02:00
Klaas Freitag
efbc495f79 overlays Nautilus: Adopt to the use a local unix socket not TCP.
Also, use the appname to find the correct branded icons.
2014-09-30 11:17:05 +02:00
Markus Goetz
f8b73eb9d9 SocketApi: Port OS X to use local sockets 2014-09-30 07:36:20 +02:00
Jenkins for ownCloud
f25a590af5 [tx-robot] updated from transifex 2014-09-30 01:25:39 -04:00
Markus Goetz
0539098371 OS X: Update GCDAsyncSocket
The two files are from the fork from
https://github.com/jdiehl/CocoaAsyncSocket/tree/socketUN
It supports unix domain sockets.

SHA1 was 7e97fc876522c7bf2a2a434cf40579ae9daf9da5
2014-09-30 07:09:39 +02:00
Klaas Freitag
788c27bf2f cmake: Fix installation of overlay icons on linux 2014-09-29 16:08:49 +02:00
Olivier Goffart
a587148c73 SocketApi: Save the socket in $XDG_RUNTIME/<appname>/socket 2014-09-29 13:54:13 +02:00
Olivier Goffart
9acd3a58ee SocketApi: Use QLocalSocket after all for windows and linux
Relates issue #2189
2014-09-29 12:19:33 +02:00
Jenkins for ownCloud
449f5adaba [tx-robot] updated from transifex 2014-09-28 01:25:20 -04:00
Jenkins for ownCloud
2380b7af3d [tx-robot] updated from transifex 2014-09-27 01:25:22 -04:00
Olivier Goffart
10989d13e4 Folder: Remove slotTerminateAndPauseSync
This make no sens to just set the pause config flag here. It make selective sync to mark
the folder as posed on restart
2014-09-26 12:43:54 +02:00
Olivier Goffart
fe1653ede6 csync_update: don't recurse into ignored directory.
This save some time when selective sync deselected a large tree
2014-09-26 12:35:56 +02:00
Olivier Goffart
b4071cec01 DiscoveryPhase: fix the name of a function
It was renamed from white list to black list long ago
2014-09-26 12:35:56 +02:00
Klaas Freitag
b1c842373d Add OWNCLOUDSYNC_EXPORT to make building on windows. 2014-09-26 10:07:50 +02:00
Olivier Goffart
a3d70b3cf6 Attempt to fix a crash
The reply might be null at the point we are timing out.
Issue #2246
2014-09-26 10:04:36 +02:00
Jenkins for ownCloud
70912c44de [tx-robot] updated from transifex 2014-09-26 01:25:28 -04:00
Klaas Freitag
98d9f7924d SocketAPI: Before reporting something new check for parent permissions.
In case it is not allowed to create files or dirs because of missing
permissions in shares, the socket API has to report an error state
rather than the NEW state.

As discussed in mirall issue #1931
2014-09-25 21:52:20 +02:00
Klaas Freitag
172295289e Permissions: If a top level shared dir is removed, do not restore files in it
A top level shared dir can always be removed on the client, even if it is
read only shared. In that case, the removal means "unsharing". Fixed the
permission check accordingly.

See bug #1918 for more information.
2014-09-25 15:39:14 +02:00
Klaas Freitag
8ba08d7e87 Activity View: honor error string even if no warning
that allows to specify a more specific user message to be displayed.
2014-09-25 15:03:54 +02:00
Klaas Freitag
8915f94931 Mac Overlays: handle filenames with slashes properly.
There are filenames with slashes on MacOSX, they can be created
in Finder. Internally they are converted to colons.
2014-09-25 12:24:32 +02:00
Klaas Freitag
31bf844452 DownloadJob: Refresh the FileInfo after renaming the target file.
Otherwise the activity view reports file size 0.
2014-09-25 10:59:08 +02:00
Jenkins for ownCloud
0c8b74a025 [tx-robot] updated from transifex 2014-09-25 01:25:30 -04:00
Olivier Goffart
dad8c1c27c propagator: Do not check for case clash when renaming
Issue #1385

When renaming, we would normaly already have an error if the file already exist.
And we want to allow the renaming to chang ethe case (Eg. "hello" -> "HELLO"
2014-09-24 16:43:01 +02:00
Klaas Freitag
2e12acdf32 doc: add a memo about the issue that defines the permission flags. 2014-09-24 16:35:50 +02:00
Jenkins for ownCloud
d6156dd755 [tx-robot] updated from transifex 2014-09-24 01:25:22 -04:00
Klaas Freitag
2c67a7ca71 progress: Set a clear start indication in the progress.
Before, 0 was used to indicate the sync start which wipes the activity
window. However, if there _are_ no synced items but only ignored items
the overall counter stays zero which wipes the list all the time.

This fixes bug #2171
2014-09-23 15:58:06 +02:00
Klaas Freitag
688b8dcc38 MacOverlays: Pass isDir flag to isRegisteredPath method
With that, a path can be added to directories to also detect the
sync top directory.

This fixes bug #2053
2014-09-23 10:25:11 +02:00
Klaas Freitag
280edee1db cmake: fix typo 2014-09-23 10:25:11 +02:00
Jenkins for ownCloud
b9ea72f189 [tx-robot] updated from transifex 2014-09-23 01:49:01 -04:00
Klaas Freitag
8f8265b219 Mac Installer: Add file name quoting. 2014-09-22 16:45:33 +02:00
Klaas Freitag
00ae3c3120 Mac Installer: Rename the final package to branded. 2014-09-22 16:38:51 +02:00
Klaas Freitag
1e49f152be Mac create pkg: Adjust background image path 2014-09-22 16:25:23 +02:00
Klaas Freitag
f72ca4d83e Mac installer: Use template value for bundle name 2014-09-22 16:18:30 +02:00
Klaas Freitag
5b10a9f3a7 Minor: Remove unused definition 2014-09-22 13:47:45 +02:00
Klaas Freitag
d0fb1acebb Win32: Define HANDLE variable, make win compile again. 2014-09-22 13:47:17 +02:00
Klaas Freitag
09be4d22ee Nautilus: Renamed nautilus plugin script to make it branding friendly 2014-09-22 12:24:06 +02:00
Klaas Freitag
11a64320f0 git: fix entry in .gitattributes to not export binary dir. 2014-09-22 11:24:24 +02:00
Jenkins for ownCloud
4eac66b84a [tx-robot] updated from transifex 2014-09-22 01:25:21 -04:00
Jenkins for ownCloud
497b7808b6 [tx-robot] updated from transifex 2014-09-21 01:25:21 -04:00
Jenkins for ownCloud
b10c2b5946 [tx-robot] updated from transifex 2014-09-20 01:25:29 -04:00
Christian Kamm
fa881ba1c7 Notifications: Don't emit one per error. #1777 2014-09-19 15:59:03 +02:00
Christian Kamm
eb1b17e8e4 CSync tests: Add t1.cfg to gitignore. 2014-09-19 14:21:14 +02:00
Christian Kamm
2eec85a97c NetworkJobs: Propagator jobs keep others from expiring. #2155
In some owncloud server setups multiple concurrent connections for the
same session are not supported: owncloud/core#11153

This causes issues with multiple uploads and downloads. A usual symptom
is the quota job failing and the sync aborting.

This workaround lets activity on the propagator's GET and PUT jobs
reset the timeout of all network jobs. That way, queries like the quota
job would not time out while a large up/download is in progress.
2014-09-19 11:22:57 +02:00
Jenkins for ownCloud
c85b6193d5 [tx-robot] updated from transifex 2014-09-19 01:25:29 -04:00
Klaas Freitag
fc36e7eccf tests: Add a csync exclude test to check toplevel excludes. 2014-09-18 15:34:24 +02:00
Klaas Freitag
0cc2bbf5d9 csync exclude: Export the csync_exclude_add function in debug mode 2014-09-18 15:34:24 +02:00
Jürgen Weigert
d2669debb9 Merge branch '1.7' of https://github.com/owncloud/mirall into 1.7 2014-09-18 12:37:17 +02:00
Jürgen Weigert
637fb449c6 Fixed https://github.com/owncloud/mirall/issues/1699
Added missing copyright headers.
2014-09-18 12:30:42 +02:00
Daniel Molkentin
e82b319ee7 Fix owncloud man page formatting 2014-09-18 12:30:20 +02:00
Klaas Freitag
e9248066df SyncJournal: Better error report for sql statements in updateDbStructure
Also, even if the updateDatabaseStructure fails, precompile the sql
statements.

This will help to debug and maybe solve bug #2106
2014-09-18 12:02:28 +02:00
Daniel Molkentin
819472d366 Fix owncloud man page formatting 2014-09-18 11:44:25 +02:00
Daniel Molkentin
21bbdd6f49 Update owncloudcmd documentation 2014-09-18 11:36:14 +02:00
Christian Kamm
a88ac00115 SyncEngine: Better reporting when ignoring hardlinks. #2217
Also touch csync to actually let us know it's ignoring the file
due to it having hard links.
2014-09-18 11:32:29 +02:00
Christian Kamm
30683b38a8 Updater: Add "didn't check for updates" message. #2175
Don't show "Checking server..." when we are not.

(cherry picked from commit ece11dc3d8)
2014-09-18 09:43:13 +02:00
Christian Kamm
45aefeb146 SelectiveSyncDialog: Change 'partial' behavior.
The real bug in #2219 actually was that the gui allowed users to
choose to not sync the root folder. That's not supported and no
longer possible in the UI.

Instead you may now sync a folder's files without syncing its sub-
folders.
2014-09-18 09:42:50 +02:00
Jenkins for ownCloud
580ecbff0c [tx-robot] updated from transifex 2014-09-18 01:25:28 -04:00
Daniel Molkentin
db3318886e Merge pull request #2214 from owncloud/2211
Implement (most of) #2211
2014-09-18 00:09:26 +02:00
Daniel Molkentin
54eb837950 Remove unused confdir option 2014-09-18 00:07:33 +02:00
Christian Kamm
0bd73788f4 Doc: Update csync test script README. 2014-09-17 16:18:55 +02:00
Christian Kamm
e395282e0e SelectiveSyncDialog: Fix sync-nothing case. #2219 2014-09-17 16:13:47 +02:00
Christian Kamm
1f129d0bcb Propagator: Don't upload files that were changed recently.
Instead skip them and try another sync later.

See #2167, #2169, #2210.
2014-09-17 15:30:18 +02:00
Christian Kamm
c2ae5e5fd1 FolderMan: Ensure a 1s delay between sync request and start.
That way the propagator can detect files that are still being
changed right now and skip them.
2014-09-17 15:30:18 +02:00
Olivier Goffart
292a7357bd t1.cfg.in: saner placeholder executable name
Now it is owncloudcmd and not csync
2014-09-17 14:39:34 +02:00
Christian Kamm
99aa2cdf2a Log: Print client version on sync start. #2178 2014-09-17 09:39:04 +02:00
Christian Kamm
0eb9401c62 File change detection: Also look at file sizes.
See #2167 and #2169.

* csync_detect_update: Reupload a file if the sizes differ, similar
  to how we reupload if the mtimes differ.
* PropagateUploadFileQNAM::slotPutFinished(): Abort an upload if the
  size changed, similar to how we abort an upload if the mtimes changed.
2014-09-17 09:05:13 +02:00
Jenkins for ownCloud
ab14a589c8 [tx-robot] updated from transifex 2014-09-17 01:25:27 -04:00
Daniel Molkentin
122fa596b3 Remove stray file that was not meant to be committed 2014-09-17 00:55:55 +02:00
Daniel Molkentin
5406407ed6 Implement --non-interactive as per Juergens' request 2014-09-17 00:12:16 +02:00
Daniel Molkentin
b72cee2783 Fix passing URLs not ending in /remote.php/webdav 2014-09-16 23:53:01 +02:00
Daniel Molkentin
fe023e2229 Allow passing user/pass explicitly or via netrc
#2211
2014-09-16 23:52:28 +02:00
Jenkins for ownCloud
1dae928a7c [tx-robot] updated from transifex 2014-09-16 01:25:22 -04:00
Olivier Goffart
9b1779bb06 Fix compilation
qFatal does not work with <<
2014-09-15 18:03:44 +02:00
Olivier Goffart
97cc05eeea journaldb: Assert in case of SQL error
relates issue #2106
2014-09-15 14:27:39 +02:00
Christian Kamm
20dd3b0a69 FolderMan: Fix startFromScratch logic. #1989
(cherry picked from commit 4566ca3127)
2014-09-15 13:53:38 +02:00
Christian Kamm
f348eabf19 Account: Fix cert save/restore from settings. #2160
(cherry picked from commit cc1121ef00)
2014-09-15 13:53:38 +02:00
Olivier Goffart
5870a57002 wizard: fix start a clean sync
The problem was that the backup function failed as we tried to
move  /home/xxx/ownCloud/  to /home/xxx/ownCloud/.oC_bak
The intention was to move it to /home/xxx/ownCloud.oC_bak

Issue #1989
2014-09-15 13:49:13 +02:00
Olivier Goffart
278bc5a8cd owncloudcmd: ask for the login and password and put it in the url (if it's not there already)
Because we cannot rely on HTTPCredentials to open windows in a command line tool

Fixes #1860
2014-09-15 13:24:31 +02:00
Jenkins for ownCloud
3c89415df1 [tx-robot] updated from transifex 2014-09-14 01:25:21 -04:00
Jenkins for ownCloud
5981f700f5 [tx-robot] updated from transifex 2014-09-13 05:16:21 -04:00
Olivier Goffart
af5e8ee18c AbstractNetworkJob
Abort the transfer in case of timeout.

This avoid that a connection that never replies blocks mirall

Issue #2148
2014-09-12 18:06:29 +02:00
Olivier Goffart
52e8343f76 ConnecitonValidator: Handle the timeout
otherwise the account may be stuck in a disconnect case if there is a timeout

Issue #2148
2014-09-12 18:06:17 +02:00
Olivier Goffart
a4dbf5942c owncloudcmd: restart the sync if required
Fixes #2038
2014-09-12 17:23:01 +02:00
Daniel Molkentin
ada1d42ebf Sparkle requirement bumped to 1.8 2014-09-12 16:08:52 +02:00
Daniel Molkentin
f27182ae05 fFx Utility::freeDiskSpace for win32 2014-09-12 16:08:52 +02:00
Markus Goetz
2fddf05515 OS X: Overlay Icons: Load from bundle-specific path
The client (in this case mirall) tells the Finder plugin where to get the icons.
This enables installation in different locations and in branded clients.
2014-09-12 15:09:47 +02:00
Markus Goetz
91d1864840 OS X: Overlay Icons: Less verbose debug output 2014-09-12 15:09:46 +02:00
Olivier Goffart
79052ba7c6 Blacklist: ignore problems that don't have HTTP error code and are possibly problem on the local file system
Issue #1985
2014-09-12 14:13:04 +02:00
Markus Goetz
0edd4d3c02 OS X: Overlay icons: Don't show if folder is not marked as being an oC folder 2014-09-12 11:46:53 +02:00
Jenkins for ownCloud
71516c480d [tx-robot] updated from transifex 2014-09-12 03:28:04 -04:00
Jenkins for ownCloud
1304c2c4ab [tx-robot] updated from transifex 2014-09-11 01:25:22 -04:00
Olivier Goffart
a84b7dc27e Restart the sync when we detect we need to redo a sync
Fixes #1968
Relates #2038
2014-09-10 17:27:33 +02:00
Daniel Molkentin
927af0adec Fix build on win32: add missing export 2014-09-10 16:31:47 +02:00
Daniel Molkentin
2dfbc2058f Win32: ignore files ending in '.' or at least one space
Fixes #416
Fixes #2176
2014-09-10 15:21:19 +02:00
Olivier Goffart
79ee6c2f3b 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-10 13:21:31 +02:00
Daniel Molkentin
f59a6862ca raiseDialog: Actually send the XEvent
Amendment to 25c274a0bd

Conflicts:
	src/mirall/owncloudgui.cpp
2014-09-10 13:21:27 +02:00
Olivier Goffart
fa962b7f53 csync_update: fix compilation warning 2014-09-10 11:08:00 +02:00
Olivier Goffart
71408bab60 I forgot to rename one of the while list to the blacklist 2014-09-10 11:01:38 +02:00
Jenkins for ownCloud
9e015eb654 [tx-robot] updated from transifex 2014-09-09 01:25:24 -04:00
Markus Goetz
4ce03e8b61 OS X: Fix Overlay icon retrieval
Re-retrieve all icons for a path in case we receive UPDATE_VIEW.
(But in contrast to previous code, don't delete the icons which then
would have caused screen flickering)
2014-09-07 11:38:23 +02:00
Jenkins for ownCloud
68b7f412b6 [tx-robot] updated from transifex 2014-09-07 01:25:23 -04:00
Jenkins for ownCloud
20011f3a84 [tx-robot] updated from transifex 2014-09-06 01:25:23 -04:00
Daniel Molkentin
2d020b5989 Merge pull request #2138 from owncloud/cleanup_shell_integration_nautilus
Cleanup and make python3 compatible shell integration nautilus
2014-09-05 15:48:16 +02:00
Markus Goetz
1909b465dc CSync: Show file size and inode during update traversal
With the previous code, we saw those values only when the file/dir was also in the local DB
2014-09-05 15:23:33 +02:00
Christian Kamm
88b7f2e0ee SyncJournal: Don't use C++11 features. 2014-09-05 12:48:45 +02:00
Jenkins for ownCloud
531d586460 [tx-robot] updated from transifex 2014-09-05 01:25:28 -04:00
Christian Kamm
2630a73a1c Propagator: Use csync to get the modification time.
See owncloud/core#9781
2014-09-04 14:16:23 +02:00
ckamm
4decd15ca9 Merge pull request #2161 from ckamm/stale-downloadinfo
Clean up stale journal entries and temporaries. #2057
2014-09-04 14:14:39 +02:00
ckamm
3a59dd24f3 Merge pull request #2162 from ckamm/error-missing-exclude
Don't do a broken sync when the system exclude file is missing
2014-09-04 14:14:07 +02:00
Christian Kamm
1cf1f6edcb Fix style issues. 2014-09-04 13:27:11 +02:00
Christian Kamm
5d36a27893 Clean up stale journal entries and temporaries. #2057
* Downloadinfo entries for files that no longer need to be downloaded
  are useless and can be removed. In particular, the temporary files
  holding partially retrieved files are now deleted when no longer
  necessary.
* The same is true for blacklist entries for paths that are no longer
  being discovered.
* Same for uploadinfos for files that no longer need to be uploaded.
2014-09-04 13:14:15 +02:00
Christian Kamm
da94533647 Folders: Signout should not switch folders to paused state. #2112
On signout, syncs that are running in folders are aborted. That used to
also switch the state of these folders to 'paused'. To fix that, aborts
that are caused by user actions no longer change the folder paused
state.

Aborts due to errors should still pause folders! Otherwise we'd try
resyncing them even though there was an error.
2014-09-04 11:21:28 +02:00
Jenkins for ownCloud
db08d5021e [tx-robot] updated from transifex 2014-09-04 01:25:25 -04:00
Markus Goetz
69066013c1 ownCloudTheme: Fix casing in appName()
Without this fix, the section in the config file uses the wrong name,
leading to re-configuration of the client needed.
2014-09-03 17:30:34 +02:00
Christian Kamm
aef569ee9d SyncEngine: Use exclude file fallback next to binary on linux.
This is mainly useful for developers where the system-wide exclude file
may not exist.
2014-09-03 14:53:01 +02:00
Christian Kamm
cf881aa6dc SyncEngine: Fix invalid slot name in sync error condition. 2014-09-03 14:52:55 +02:00
Christian Kamm
a48bf3142c SyncEngine: Abort sync with error if system exclude file is missing.
Syncing without the system exclude file would cause lots of trouble.
For instance we would try uploading the temporary files we store
partially completed downloads in.
2014-09-03 14:52:46 +02:00
Jenkins for ownCloud
33d9f4b882 [tx-robot] updated from transifex 2014-09-03 01:25:21 -04:00
Markus Goetz
49c40a4b11 OS X: Have the PKG installer also be signed 2014-09-02 17:57:22 +02:00
Markus Goetz
d1eff0ae24 OS X: Add sign_app.sh 2014-09-02 16:14:00 +02:00
Daniel Molkentin
c0131695c5 Return from Folder::slotPollTimerTimeout() if the account object is 0
Right now, we crash instead. This can happen if a folder is created
when an account object is not (anymore/yet) created.

Fixes #2142
2014-09-02 14:51:33 +02:00
Daniel Molkentin
fcbadda40f Make Settings Window close on Ctrl+W
Fixes #2141

(cherry picked from commit 2ab19b23d7)
2014-09-02 14:03:20 +02:00
Daniel Molkentin
2455faa6fe Account Migrator: Switch to string comparison for URLs.
QUrl does not normalize trailing slashes, so there is no benefit
of using QUrl here.

(cherry picked from commit d770f9cc1a)
2014-09-02 14:03:07 +02:00
Markus Goetz
7da8a5e374 OS X: Create tbz in create_mac_pkg.sh
Sparkle needs this
2014-09-02 12:15:11 +02:00
Jenkins for ownCloud
b3950165c4 [tx-robot] updated from transifex 2014-09-01 15:47:58 -04:00
Jenkins for ownCloud
b8ab859c59 [tx-robot] updated from transifex 2014-09-01 01:25:19 -04:00
Jenkins for ownCloud
99a3cb0eab [tx-robot] updated from transifex 2014-08-31 13:00:41 -04:00
Markus Goetz
0be4b59cff Sparkle: Keep permissions from bundle 2014-08-31 18:57:39 +02:00
hefee
ddfc7c75df Fix minor Python styling issues
* Do not use sapces inside parenthesis
* make indend PEP8
* empty lines should not contain whitespaces
2014-08-31 00:35:56 +02:00
David Prévot
7618f29657 Fix minor Python syntax errors
The installation fails because of these:

	TabError: inconsistent use of tabs and spaces in indentation
	SyntaxError: Missing parentheses in call to 'print'
2014-08-31 00:28:25 +02:00
Olivier Goffart
291231c561 Merge missing commits from 1.6.2-themefix into 1.7
Conflicts:
	VERSION.cmake
2014-08-30 17:57:58 +02:00
hefee
68792ee9db Fixing spellingerror
GNU Public License -> GNU General Public License
2014-08-30 02:18:55 +02:00
Klaas Freitag
7ce2a93c63 Merge remote-tracking branch 'origin/reuse_oc_config' into 1.7
Conflicts:
	src/CMakeLists.txt
	src/mirall/folderman.cpp
	src/mirall/folderman.h
	src/mirall/owncloudtheme.h
2014-08-29 20:23:07 +02:00
Klaas Freitag
4d33773cef Nautilus Overlays: Rename icons according to branding.
Added a script that renames the icons and patches the python file for
nautilus.
2014-08-29 20:02:52 +02:00
Olivier Goffart
5d19426930 Propagator: When the server don't support ranges, reset the counter so the progress is not messed up
Issue #2081
2014-08-29 19:33:20 +02:00
Olivier Goffart
1b51a10b19 Socket API: be consistant in the VERSION command and add the VERSION at the beginning 2014-08-29 17:28:36 +02:00
Olivier Goffart
aab870af32 desktop file: add a Comment
Fixes #2130
2014-08-29 17:14:40 +02:00
Markus Goetz
7c70ada423 Exclude List: Gnucash temp files
Fixes #2045
2014-08-29 16:45:08 +02:00
Markus Goetz
12e2bac16b Propagator: Also parse OC-ETag header
Client side part of https://github.com/owncloud/core/issues/9005
2014-08-29 16:30:58 +02:00
Olivier Goffart
34a27c748a Progress: in case of resuming chunks, advance directly at startup by the amount of chunk already done
Fixes #2103
2014-08-29 16:06:56 +02:00
Olivier Goffart
a73fbccf8c t4.pl: add a test to test that ignored file are not deleted 2014-08-28 19:33:52 +02:00
Klaas Freitag
7f1d707d23 ownCloud Theme: Do not have the oCSetupTop custom media, see #1445 2014-08-28 18:10:53 +02:00
Klaas Freitag
f1fb36bcb8 Tests: Get rid of the Carp package that ogoffart does not have.
Recommendation: Use a decent distribution! But anyway....
2014-08-28 18:10:53 +02:00
Daniel Molkentin
25c274a0bd X11: Bring Settings window to front when launched 2014-08-28 17:25:00 +02:00
Olivier Goffart
d4bbd28757 csync: remove ignored_cleanup: it's not used anymore 2014-08-28 17:16:51 +02:00
Olivier Goffart
98b7248df0 reconcile/update: don't remove directory that contains ignored files 2014-08-28 17:16:17 +02:00
Olivier Goffart
0fb0f2c204 Selective sync: start a sync when the selective sync settings changes 2014-08-28 16:27:46 +02:00
Olivier Goffart
79d13d9242 Selective sync: deselecting a folder removes it from the local file system 2014-08-28 15:53:49 +02:00
Markus Goetz
b6f42a91f4 OS X: Fix Finder bundle NVTY->OWNC 2014-08-28 15:45:07 +02:00
Daniel Molkentin
cc5f5cf3a6 Set the minimum supported OS X version to 10.7
We dropped 10.6 support quite a while ago.
This should avoid bug reports from 10.6 users.

Fixes #2122
2014-08-28 14:50:00 +02:00
Olivier Goffart
79f00c2a2a Wizard: adjust alignements 2014-08-28 13:32:14 +02:00
Olivier Goffart
e5068e7543 Selective sync: if one click twice on the button in the wizard, it should keep the blacklist 2014-08-28 12:25:44 +02:00
Olivier Goffart
858218ac34 Wizard: new layout 2014-08-28 12:18:19 +02:00
Markus Goetz
d69049ce10 OS X: Fix Finder plugin 2014-08-28 10:21:56 +02:00
Daniel Molkentin
59a9cc7c12 OS X build: use correct macro for version number 2014-08-28 00:08:24 +02:00
Markus Goetz
2f34b046d0 Overlay Icons: Improve OS X version, improve general feedback
Now the update phase of the syncing algorithm pushes stuff the notification socket too.
2014-08-27 19:15:43 +02:00
Olivier Goffart
a73316306d Selective sync: new design in the wizard 2014-08-27 19:03:11 +02:00
Olivier Goffart
928652e4cf Selective sync: rename the button 'choose what to sync' 2014-08-27 17:31:57 +02:00
Olivier Goffart
7950b49cb1 Selective sync dialog: fix fetching sub directory when the folder is not the root folder 2014-08-27 17:19:36 +02:00
Markus Goetz
f8b1b243c1 OS X: Fix installer target name if we have a build number 2014-08-27 14:44:21 +02:00
Klaas Freitag
cc6aa66ab0 JournalDB: Do prepare the queries even if the db update failed.
Also, add more logging in case SQL errors happen while db structure
update.
2014-08-27 14:01:33 +02:00
Olivier Goffart
ea381392a7 SocketAPI: fix the BROADCAST message 2014-08-27 13:55:06 +02:00
Olivier Goffart
bb7f63dcfd AccountSettings: be less verbose in the status string 2014-08-27 13:51:14 +02:00
Olivier Goffart
253d65727b Socket api: Add a VERSION command 2014-08-27 13:51:14 +02:00
Markus Goetz
61138b58bf OS X: Quote the installer filename
Viel hilft viel
2014-08-27 12:49:22 +02:00
Markus Goetz
5490063b7e OS X: Fix installer creation
The script should know independently of the machine
2014-08-27 12:02:57 +02:00
Klaas Freitag
d2e1489fe7 Propagator: Set the chunk size to 20MB as requested by Matt. 2014-08-27 10:35:58 +02:00
Klaas Freitag
eb898646bc Create Mac Pack: Copy the creator script to the build directory. 2014-08-26 18:13:43 +02:00
Markus Goetz
79b547b83b Icon Overlay OS X: Complain if icon couldnt be loaded 2014-08-26 17:21:15 +02:00
Olivier Goffart
2356601bb3 folder: Make sure not to pol the server if the account is disconnected
Fixes #2108
2014-08-26 16:23:19 +02:00
Olivier Goffart
9b88c7d3c1 SSLButton: fix memleak 2014-08-26 15:59:19 +02:00
Olivier Goffart
302499b483 uploading: make sure to cast to uint64 to avoid integer overflow 2014-08-26 15:58:55 +02:00
Jenkins for ownCloud
03dc27a327 [tx-robot] updated from transifex 2014-08-26 01:25:22 -04:00
Jenkins for ownCloud
9291ace558 [tx-robot] updated from transifex 2014-08-25 01:25:17 -04:00
Jenkins for ownCloud
15c11ea172 [tx-robot] updated from transifex 2014-08-24 02:06:11 -04:00
Jenkins for ownCloud
cd6950d984 [tx-robot] updated from transifex 2014-08-24 01:25:18 -04:00
Jenkins for ownCloud
de96350bee [tx-robot] updated from transifex 2014-08-23 01:25:22 -04:00
Jenkins for ownCloud
a9f1e165b5 [tx-robot] updated from transifex 2014-08-22 01:25:19 -04:00
Daniel Molkentin
c60b433c42 create shellext path 2014-08-21 20:33:25 +02:00
Daniel Molkentin
933c7e36d1 NSIS: fix target path for shell extension 2014-08-21 17:33:22 +02:00
Klaas Freitag
6025b3a91b Bump version to beta1 2014-08-21 14:33:03 +02:00
Klaas Freitag
c473428be6 Merge pull request #2084 from owncloud/contextless_exclude
Contextless exclude, @ogoffart reviewed, I'll merge.
2014-08-21 13:15:18 +02:00
Klaas Freitag
e06e5fe55f Excludes: Fix unit tests for the new exclude load interface.
Also removed some commented lines.
2014-08-21 13:12:05 +02:00
Klaas Freitag
dc8f437b31 Excludes: Add an context free implementation of exclude file loading.
So that we are more thread safe.
2014-08-21 12:43:04 +02:00
Daniel Molkentin
2219d409a4 Update binary submodule 2014-08-21 11:48:59 +02:00
Olivier Goffart
aabcf80774 Sync engine: Take also in account the fact that the instruction can be IGNORE on both tree 2014-08-21 11:33:38 +02:00
Olivier Goffart
1cf956ec21 Discovery phase: clear the callbacks after use 2014-08-21 11:27:25 +02:00
Daniel Molkentin
315c2eb4ca Windows Shell Integration: Ensure precedence 2014-08-21 11:06:10 +02:00
Klaas Freitag
54e2b9345b GUI: on Mac do not call slotUpdateAccountIcon 2014-08-21 11:00:57 +02:00
Jenkins for ownCloud
9743fee8f9 [tx-robot] updated from transifex 2014-08-21 02:06:14 -04:00
Jenkins for ownCloud
696f801df0 [tx-robot] updated from transifex 2014-08-21 01:25:23 -04:00
Klaas Freitag
fef0d0b31c Overlays Nautilus: Handle UNREGISTER_PATH and do proper reconnect.
This is needed to fix #2073
2014-08-20 17:33:48 +02:00
Klaas Freitag
75101a0319 Application: Unload all folders when shutting down.
That sends a proper UNREGISTER message via socket API.
2014-08-20 17:33:48 +02:00
Klaas Freitag
d1a660ce20 SocketAPI: Add parameter to enable wait for the socket write.
This is needed to wait until the UNREGISTER message is sent to the
shell code when mirall shuts down.
2014-08-20 17:33:48 +02:00
Klaas Freitag
4356005c5a FolderMan: Do not remove the folder icon too early from the map.
Otherwise, method unloadFolder can not do important frees.

This is one part of the fix for #2073 because now the socketapi will
send the UNREGISTER_PATH message over the socket.
2014-08-20 17:33:48 +02:00
Daniel Molkentin
86a00eee3f Merge pull request #2079 from owncloud/nsis_use_installlib
Use InstallLib to install the overlay icons
2014-08-20 17:19:40 +02:00
Daniel Molkentin
ccf532672b Use InstallLib to install the overlay icons
This allows for a cleaner expirience
2014-08-20 16:07:22 +02:00
Daniel Molkentin
6b52e9db34 Fix crash in accountsettings 2014-08-20 16:07:06 +02:00
Daniel Molkentin
8fdee79505 Fix crash in accountsettings 2014-08-20 16:06:38 +02:00
Markus Goetz
d9de6e68ad OS X: Optimize Finder icon drawing code
Don't have an intermeditate TIFF.
2014-08-20 14:02:58 +02:00
Klaas Freitag
988fe70771 Merge pull request #2075 from owncloud/use_folder_paused
Rework of the status icons in FolderMan and Folder objects.
2014-08-20 10:50:28 +02:00
Jenkins for ownCloud
132fac86d7 [tx-robot] updated from transifex 2014-08-20 01:25:19 -04:00
Klaas Freitag
d02175210b Status Icon: Set a proper icon if no sync is configured.
This fixes bug #1956
2014-08-19 17:47:28 +02:00
Daniel Molkentin
1dd3d080b8 Update binary submodule 2014-08-19 17:25:59 +02:00
Daniel Molkentin
d171431ac7 Windows Shell Integration: Add version information 2014-08-19 15:52:58 +02:00
Daniel Molkentin
76e0d61b19 Windows Shell Integration: Register icons with well known name 2014-08-19 15:52:47 +02:00
Daniel Molkentin
cc6d83a953 Windows Shell Integration: Adjust port 2014-08-19 15:51:40 +02:00
Klaas Freitag
617887a0c6 Propagator: If the sync was interrupted by pausing, do not show error.
Handle problems which happen because of pausing the sync as soft errors
rather than normal errors which are blacklisted and displayed in the
gui.

This fixes bug #1959
2014-08-19 14:21:59 +02:00
Klaas Freitag
e4fe4cb4d3 Status icons: Display the correct icons after startup connect. 2014-08-19 14:21:59 +02:00
Klaas Freitag
dc0a054d94 Status icons: Set the offline icon at the very beginning.
Otherwise, if the account is signed out and opens the credential popup,
there is a wrong icon displayed. If the account is coming from keychain
this icon is quickly overwritten.
2014-08-19 14:21:51 +02:00
Klaas Freitag
924d9b985f Some minor cleanups. 2014-08-19 14:21:51 +02:00
Klaas Freitag
bb3bd6930a StatusModel: Have another property accountConnected.
With that , make the status model aware of the account connection state.
With that, we can grey out the correct state icon if the account is not
connected and display the normal icon if the account is connected.
2014-08-19 14:21:51 +02:00
Klaas Freitag
1245ed6f06 Status Icons: Let FolderMan only write the folder config files.
Remove the setSyncEnabled() call to individual folders which mistakenly
set the folders to pause. Let the folders keep their pause state on their
own.

If FolderMan is set to be enabled emit a general refresh signal rather
than one for each folder.
2014-08-19 14:21:51 +02:00
Klaas Freitag
01b0ee49de Status Icons: Rename the syncEnable method to isPaused.
Previously, in folder and folderman there have been the syncEnabled
properties, but they confused the semantics: While in FolderMan the
syncEnabled flag represents the network connection and stuff, in
Folder it represented if the user paused or resumed the folder.

This resulted in mixed use of both, which lead to wrong icon states.
This patch renames the folder methods and properties to isPaused to
make more clear about what it is.
2014-08-19 14:21:42 +02:00
Jenkins for ownCloud
2436ef9574 [tx-robot] updated from transifex 2014-08-19 02:06:17 -04:00
Jenkins for ownCloud
94f3a1ab1f [tx-robot] updated from transifex 2014-08-19 01:25:24 -04:00
Olivier Goffart
9c98883bea propagator mkcol: If the server replies with a file-id in the header, use it
Newer server will have a file id directly in the file header.
https://github.com/owncloud/core/issues/9000
2014-08-18 20:42:43 +02:00
Olivier Goffart
2fb19e25b5 Fix clang 3.0 compilation 2014-08-18 19:44:18 +02:00
Daniel Molkentin
6fbbe2d0e4 Create ShellIconOverlayIdentifiers key
It may not exist. Registration fails in that case.
2014-08-18 17:06:26 +02:00
Olivier Goffart
c291eb3db4 Fix compilation error 2014-08-18 15:45:58 +02:00
Olivier Goffart
7f38ce8908 Selective sync: the button should only be enabled while connected 2014-08-18 15:45:38 +02:00
Olivier Goffart
1781400340 fix compilation 2014-08-18 15:28:24 +02:00
Olivier Goffart
3760f14da8 Restore the log window 2014-08-18 15:16:33 +02:00
Olivier Goffart
dc18366111 DiscoveryPhase: put in namespace Mirall 2014-08-18 14:45:48 +02:00
Olivier Goffart
936252765a Merge branch 'master' into selective_sync
Conflicts:
	src/mirall/syncengine.cpp
	src/mirall/syncengine.h
2014-08-18 14:44:43 +02:00
Markus Goetz
b62b87eed3 OS X: Rename LiferayNativity code for shell icons 2014-08-18 12:57:29 +02:00
Klaas Freitag
4b716f3ea6 About page: Fix the translation of developer names. 2014-08-18 12:17:13 +02:00
Klaas Freitag
ddbe181e48 Update phase progress: Check if callback is defined. 2014-08-18 11:51:45 +02:00
Klaas Freitag
27f9d4523b Settings: Display the commit SHA both in branded and unbranded.
Also, do not put the developer names into the translation string.
2014-08-18 11:27:56 +02:00
Jenkins for ownCloud
8a7cfbd8de [tx-robot] updated from transifex 2014-08-18 01:25:25 -04:00
Volkan Gezer
463a9a5485 space 2014-08-17 17:38:33 +02:00
Jenkins for ownCloud
ee7fe4a38a [tx-robot] updated from transifex 2014-08-17 01:25:21 -04:00
Klaas Freitag
dccb9def3a Merge pull request #2067 from owncloud/grammar
subject verb agreement - very good, thanks.
2014-08-16 12:13:01 +02:00
Jenkins for ownCloud
5c5d57a996 [tx-robot] updated from transifex 2014-08-16 02:06:14 -04:00
Jenkins for ownCloud
de2ce5a0a2 [tx-robot] updated from transifex 2014-08-16 01:25:23 -04:00
Sandro Knauß
7b114e2cae Use QStandardPaths for linux if building with qt>=5 2014-08-16 03:12:20 +02:00
Volkan Gezer
25d519fed3 subject verb agreement 2014-08-15 20:49:47 +02:00
Klaas Freitag
8d819956d3 Tests: Fixed the CSync statedb test defined in the mirall module. 2014-08-15 18:33:04 +02:00
Klaas Freitag
4aec783362 Nautilus Overlays: Fix: do not change an dictionary which is iterated.
Also, item.invalidate_extension_info() is sufficient, no need to call
update_file_info afterwards.
2014-08-15 17:16:47 +02:00
Klaas Freitag
b494181764 Nautilus Overlays: Use port 34001 by default. 2014-08-15 17:16:47 +02:00
Olivier Goffart
9575271fcd Selective sync: hide the header 2014-08-15 16:49:22 +02:00
Olivier Goffart
b6eda9076e Selective sync: add a page in the folder wizard 2014-08-15 16:40:11 +02:00
Markus Goetz
88072a985a SyncEngine & UI: Move QElapsedTimer to object
Using a function static is too dangerous when multiple threads are involved.
2014-08-15 16:20:43 +02:00
Markus Goetz
c27f151451 SyncEngine & UI: Make the function part of UpdateJob
That way we can easily emit UploadJob's signals
2014-08-15 16:11:51 +02:00
Markus Goetz
64a7025522 CSync: Add a 30 second connect (not read) timeout 2014-08-15 15:54:13 +02:00
Markus Goetz
ce2741cebc SyncEngine & UI: Progress notifications for update phase
For each directory (local and remote, we have UI update throtting code)
a signal is emitted.
It is used by the settings dialog and the tray menu.
2014-08-15 15:28:35 +02:00
Daniel Molkentin
b40b670639 Remove owncloud_logo_blue.png from mirall.qrc resource
It not used in mirall itself.
2014-08-15 15:12:42 +02:00
Daniel Molkentin
3d6b622879 Merge pull request #2064 from owncloud/fix-1959
Show folder icon a offline when account is offline
2014-08-15 15:11:06 +02:00
Daniel Molkentin
4c67a8812a Show folder icon a offline when account is offline
Fixes #1959
2014-08-15 15:01:01 +02:00
Olivier Goffart
4c4d02c0d0 Selective Sync: refactor the widget in its own class 2014-08-15 14:58:16 +02:00
Olivier Goffart
c1831f4946 Selective sync: use a black list instead of a white list 2014-08-15 12:29:10 +02:00
Olivier Goffart
4b2c1bacd1 Merge remote-tracking branch 'origin/master' into selective_sync 2014-08-15 10:28:50 +02:00
Jenkins for ownCloud
3909102436 [tx-robot] updated from transifex 2014-08-15 01:25:29 -04:00
Klaas Freitag
78e50747e4 Updated the about text for the generic ownCloud Theme. 2014-08-14 17:12:23 +02:00
Klaas Freitag
b09498d852 csync journal: Improve get_below_path query.
Add another index on the pathlen column. Use that column to deselect
all rows that are shorter than the path to search files below. That
shrinks the amount of rows to examine using LIKE tremendously by
a cheaply to query for criteria.
2014-08-14 13:52:44 +02:00
Klaas Freitag
7fcf723039 SyncJournal: Add an index on inode to the journal database. 2014-08-14 13:22:43 +02:00
Klaas Freitag
d27ab8c6ca Revert "FolderMan: Proper singleton implementation."
This reverts commit 0350508b65.
2014-08-14 12:46:01 +02:00
Klaas Freitag
0350508b65 FolderMan: Proper singleton implementation.
The connect in SocketAPI had to be moved because it also uses
FolderMan::instance(). And since SocketAPI is instanciated in
FolderMans constructor, this was a deadlock.

Now the connect is tried on every new socket connection in SocketAPI
but I assume that multiple attempts to connect are not an issue.
2014-08-14 11:32:03 +02:00
Klaas Freitag
32739cc305 SyncEngine: End the journal transaction after update. 2014-08-14 11:32:02 +02:00
Klaas Freitag
f515fe77c4 SyncJournal: Fix logging text. 2014-08-14 11:32:02 +02:00
Klaas Freitag
f6d20cbe55 nautilus overlay: Fix reconnect, create a new socket everytime. 2014-08-14 11:07:31 +02:00
Klaas Freitag
8bc0d9acd3 Updater: Added a bit of useful logging. 2014-08-14 11:07:31 +02:00
Klaas Freitag
73325bcd41 csync statedb: Fixed handling of sqlite reply value. 2014-08-14 11:07:31 +02:00
Klaas Freitag
1b5bbfdad3 csync statedb: Set sqlite3_busy_timeout to 5 seconds. 2014-08-14 11:07:31 +02:00
Klaas Freitag
fcd211b190 overlayNautilus: Better reconnect behaviour if mirall was not running. 2014-08-14 11:07:31 +02:00
Jenkins for ownCloud
55b3eb467f [tx-robot] updated from transifex 2014-08-14 01:25:22 -04:00
Jenkins for ownCloud
192c23bfce [tx-robot] updated from transifex 2014-08-13 02:06:14 -04:00
Jenkins for ownCloud
72e0418e4c [tx-robot] updated from transifex 2014-08-13 01:25:32 -04:00
Daniel Molkentin
1544606bf0 Always handle 401 requests, except for network jobs
It is not enough to only implement it for the QNAM returned
by the ShibbolethCredentials, because we sometimes need it
when we have no valid credentials set (and are using dummy
credentials in the course).  The main use case is the
Webview opened by Shibboleth for FBA.

But as a side-effect, we can use it to handle auth requests
from the updater and other places.
2014-08-12 19:25:59 +02:00
Olivier Goffart
255330d342 Add a "Skip Folder Configuration" button in the wizard
This allow to start owncloud the first time but not automatically sync
everything, but let the user configure sub folders instead
2014-08-12 17:34:54 +02:00
Olivier Goffart
ad139e19ab Fix error reported by address sanitizer
Qt allow to call deleteLater on a null object, but it is an undefined behaviour
2014-08-12 17:34:54 +02:00
Markus Goetz
4c0891a22e Tests: Give a more random name to test directories
Conflicts:
	csync/tests/ownCloud/ownCloud/Test.pm
2014-08-12 16:27:03 +02:00
Markus Goetz
8e6e51f9a6 OS X: Move include to MAC define 2014-08-12 14:58:34 +02:00
Markus Goetz
faa502163e OS X: Finally(?) fix stay-on-top behaviour of settings dialog
Fixes #1795
2014-08-12 14:48:42 +02:00
Olivier Goffart
4ff0e7e0a2 Silent some warnings 2014-08-12 14:03:04 +02:00
Olivier Goffart
12459bf07e selective sync: fix whitelist matching 2014-08-12 11:43:42 +02:00
Olivier Goffart
b25ef28e82 Selective sync: remember the old list when accepting the dialog even if the tree was not expanded 2014-08-12 11:12:58 +02:00
Jenkins for ownCloud
ef6c82ba00 [tx-robot] updated from transifex 2014-08-12 01:25:26 -04:00
Olivier Goffart
7e009667a2 Selective sync: ignore the files that are not in the selective sync white list 2014-08-11 18:42:24 +02:00
Olivier Goffart
1f1eb933d1 Move the update job in a new file named discoveryphase
"Discovery" is a better name than "update"
2014-08-11 18:42:24 +02:00
Olivier Goffart
aa85e875bd Selective sync: Add UI to select paths 2014-08-11 18:42:24 +02:00
Daniel Molkentin
1b4c613fa6 ProtocolWidget: Disable copy button if widget is empty. 2014-08-11 16:38:51 +02:00
Daniel Molkentin
57ef515def Use std=c++0x instead of c++11
Required for compat with Ubuntu 12.04, and possibly RHEL.
2014-08-11 15:46:45 +02:00
Daniel Molkentin
59643177af Updated binary dir 2014-08-11 15:39:47 +02:00
Jenkins for ownCloud
e2d5ae1035 [tx-robot] updated from transifex 2014-08-11 02:06:11 -04:00
Jenkins for ownCloud
cd9f2e5ea5 [tx-robot] updated from transifex 2014-08-09 01:25:23 -04:00
Klaas Freitag
600a6d9346 Bumped version to alpha1 2014-08-08 10:57:09 +02:00
Jenkins for ownCloud
0e22864426 [tx-robot] updated from transifex 2014-08-08 01:25:28 -04:00
Daniel Molkentin
5306cdc7a1 Shell Integration: Fix Integration bug when explorer starts before OCC
Also slightly improves performance
2014-08-08 02:40:46 +02:00
Daniel Molkentin
344b98bf13 Shell Integration / MSVC: Fix target platform 2014-08-08 02:40:46 +02:00
Daniel Molkentin
261d7ee688 Ignore binary dir for git exports 2014-08-07 16:50:50 +02:00
Daniel Molkentin
633267c457 Update binary dir 2014-08-07 16:46:57 +02:00
Daniel Molkentin
80f9ed70d3 NSIS: Script to download the VS runtimes 2014-08-07 16:24:09 +02:00
Daniel Molkentin
fa8f6f91c4 NSIS: Add a packaging routine for the overlay icons 2014-08-07 15:54:39 +02:00
Klaas Freitag
c3f8e099f4 tests: Never stumble over an already existing test share dir. 2014-08-07 15:45:17 +02:00
Klaas Freitag
6cb8134690 SocketAPI: Use Win32 function SHChangeNotify to notify Explorer. 2014-08-07 14:59:06 +02:00
Olivier Goffart
95a77e5ccc Merge branch 'il' 2014-08-07 14:29:27 +02:00
Olivier Goffart
21783ecef7 SyncEngine: fix permission detection of moves
Two problems:
- "M" was used instead of "V"
- The extraction of the parent folder of the destination was wrong
2014-08-07 14:27:27 +02:00
Klaas Freitag
d8a8b53fc9 SocketAPI: Also update view when paused. 2014-08-07 14:07:08 +02:00
Klaas Freitag
e71ce01f90 tests: Some more tests with local files and shares. 2014-08-07 12:48:14 +02:00
Olivier Goffart
6827f9977c Merge branch 'il'
Conflicts:
	doc/ocdoc
2014-08-07 12:15:50 +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
Jenkins for ownCloud
bd9d5432f5 [tx-robot] updated from transifex 2014-08-07 02:06:14 -04:00
Jenkins for ownCloud
370ee5c6f6 [tx-robot] updated from transifex 2014-08-07 01:25:25 -04:00
Klaas Freitag
fe2e4d87c5 tests: Fix t5: work with ownCloud 7 sharing. 2014-08-06 17:19:02 +02:00
Klaas Freitag
e9c4635f6b tests: Add another two seconds break, hope to make it work in virt. env.
Tests fail randomly on the CI computer which is virtualized. Maybe this
fix helps.
2014-08-06 11:34:35 +02:00
Jenkins for ownCloud
7337010fd8 [tx-robot] updated from transifex 2014-08-06 05:10:32 -04:00
Daniel Molkentin
f06019ab81 NSIS: First steps at installing the shell extension 2014-08-06 10:44:17 +02:00
Olivier Goffart
55567f8dd2 remove unused variable 2014-08-06 10:20:58 +02:00
Klaas Freitag
2ccfdcb084 NautilusOverlays: return False if sock connection breaks 2014-08-06 09:52:52 +02:00
Daniel Molkentin
084d9de4c9 Add binary submodule 2014-08-06 09:28:18 +02:00
Jenkins for ownCloud
41875c2ddb [tx-robot] updated from transifex 2014-08-06 01:25:31 -04:00
Daniel Molkentin
4ad9ff4301 Merge remote-tracking branch 'origin/win_overlay_icons'
Conflicts:
	.gitignore
2014-08-05 19:27:51 +02:00
Daniel Molkentin
c7ff1e9b3f Windows Shell extension: Add watched directories 2014-08-05 19:23:40 +02:00
Markus Goetz
fe3f751a8a OS X: Slightly improve pkgproj
It is still too much bound to Klaas' machine.
2014-08-05 17:16:17 +02:00
Daniel Molkentin
996b7166d2 Merge pull request #2027 from owncloud/l10n-fix
Use am. eng. since brit. eng. is handled on transifex
2014-08-05 14:11:20 +02:00
Daniel Molkentin
839b2fa8fd SocketAPI: Convert to unix path before comparing with black list 2014-08-05 13:11:52 +02:00
Daniel Molkentin
8b1aebcdba No need to ship the Qt4-based qtkeychain DLL 2014-08-05 13:11:15 +02:00
Klaas Freitag
f4e2041b0b CMake: Fix installation of the icons, path corrected. 2014-08-05 11:46:21 +02:00
Jenkins for ownCloud
24df6f838d [tx-robot] updated from transifex 2014-08-05 01:25:26 -04:00
Markus Goetz
c313cc02f2 Config: Fix loading of configuration
There is a strange bug with Qt, we need to always set the application name, then
we can generate the proper config path.
2014-08-05 00:41:43 +02:00
Klaas Freitag
4e13c882f8 CMake: Install the nautilus plugin. 2014-08-04 18:58:35 +02:00
Klaas Freitag
0fe51d826f Overlays: renamed icons to sensible names. Also removed .DS_Store 2014-08-04 17:22:34 +02:00
Klaas Freitag
b2976baf9b NautilusOverlays: Use the correct icon names, removed unused function. 2014-08-04 17:21:49 +02:00
Klaas Freitag
a0a5a49d7b CMake: Install icons under linux. 2014-08-04 17:20:57 +02:00
Daniel Molkentin
9a1781f613 Support for multiple icons 2014-08-04 15:40:08 +02:00
Klaas Freitag
f983264b5d SocketAPI: Do not allow a trailing slash for directories.
The entries in our sync journal have no trailing slashes for directories.
2014-08-04 12:47:22 +02:00
Klaas Freitag
40cebeedfc SocketAPI: Call csync_exclude with the relative path.
This avoids messing with the windows pathes and csync_exclude is
designed that way.
2014-08-04 12:47:22 +02:00
Klaas Freitag
1f9280c68e GUI: Remove useless comment. 2014-08-04 12:47:22 +02:00
Klaas Freitag
14ed261606 MacOverlays: Rather use FileManager API to check if is directory. 2014-08-04 12:03:01 +02:00
Klaas Freitag
4fb671e7f4 SocketAPI: Send Broadcasts only for Linux, not used on Mac and Win. 2014-08-04 11:09:17 +02:00
Klaas Freitag
aad5c96759 Mac Overlays: No crash on context menu actions.
Disable overlay menus for now.
2014-08-04 11:09:16 +02:00
Jenkins for ownCloud
72b8da317f [tx-robot] updated from transifex 2014-08-04 01:25:28 -04:00
Jenkins for ownCloud
7f9033f1f1 [tx-robot] updated from transifex 2014-08-02 01:25:24 -04:00
Volkan Gezer
a42e384935 Use am. eng. since brit. eng. is handled on transifex
See https://github.com/owncloud/core/pull/10025#issuecomment-50855986 for info.
2014-08-02 04:05:10 +02:00
Klaas Freitag
9b37357513 cmake: Add the icons path to cmake, install the Mac icons properly. 2014-08-01 15:30:13 +02:00
Klaas Freitag
23269c9a08 Mac Overlays: load icons from the proper place in the system. 2014-08-01 15:26:18 +02:00
Klaas Freitag
327f70240c GUI: Load the finder overlay icon script on MacOSX. 2014-08-01 14:28:34 +02:00
Klaas Freitag
0a7642dbe0 Mac Package: New shellscript and packages steering file. 2014-08-01 12:19:08 +02:00
Klaas Freitag
742b036a07 CMake: Follow policy for 2.8.0 (avoid cmake warnings) 2014-08-01 12:18:52 +02:00
Klaas Freitag
6e00989a9e Add directory MacOSX to cmake processing. 2014-08-01 12:18:52 +02:00
Klaas Freitag
68f0227ca1 OverlaysMac: Make use of REGISTER_PATH to learn the synced dirs. 2014-08-01 12:18:52 +02:00
Klaas Freitag
fe9a2e7ba4 SocketAPI: Normalize file names when read from the filesystem.
Otherwise there will be bad encoded file names because of a Qt
upstream error that skips the normalization.
2014-08-01 12:18:52 +02:00
Klaas Freitag
a248fc36fe Remove user XCode file. 2014-08-01 12:18:52 +02:00
Klaas Freitag
e28a7a7ae3 MacOverlays: Start a 5 seconds timer to try connect if unconn.
If mirall is not here, a timer is started to try again later.
2014-08-01 12:18:52 +02:00
Klaas Freitag
b92789825d MacOverlays: Redraw window if registered pathes are empty.
That is the condition after a reconnect to the mirall server.
2014-08-01 12:18:52 +02:00
Klaas Freitag
c3b6aecb79 MacOverlay: Some logging cleanings. 2014-08-01 12:18:52 +02:00
Klaas Freitag
4688126f84 MacOverlays: Export the redraw method of content man. 2014-08-01 12:18:52 +02:00
Klaas Freitag
5a5c03a826 MacOverlays: Registered pathes support.
Remember the pathes that come with the first UPDATE_VIEW msg. That
reduces the number of socket communications.
2014-08-01 12:18:52 +02:00
Klaas Freitag
f3477877d0 Added XCode file. 2014-08-01 12:18:52 +02:00
Klaas Freitag
7bef588851 SocketAPI: Try reconnect if socket was not connected. 2014-08-01 10:59:50 +02:00
Klaas Freitag
72a25cf6ee MacOverlays: Minor cleanups. 2014-08-01 10:59:50 +02:00
Klaas Freitag
74e13f4c70 Use better variable naming. 2014-08-01 10:59:50 +02:00
Klaas Freitag
3c09ef6cbf SocketAPI: rename slot to send UPDATE_VIEW. 2014-08-01 10:59:49 +02:00
Klaas Freitag
68bfcf5d24 SocketAPI: Create the socket API instance in folderman. 2014-08-01 10:59:49 +02:00
Klaas Freitag
b2a10de71a Copyright plus minor beautification. 2014-08-01 10:59:49 +02:00
Klaas Freitag
267b9e5c2f FinderOverlays: Display the error if socket can not connect. 2014-08-01 10:59:49 +02:00
Klaas Freitag
55d94bf15a Overlays: Handle Sharing state and display the correct icons. 2014-08-01 10:59:49 +02:00
Klaas Freitag
629e2a9e1c Overlays: Add the missing icon containers for MacOSX. 2014-08-01 10:59:49 +02:00
Klaas Freitag
86acdf69d9 MocOverlays: Handle the UPDATE_VIEW socket notification correctly.
With UPDATE_VIEW the plugin gets notified to update the overlays.
It invalidates the entries in the file icon cache for the path
that comes with the UPDATE_VIEW and than refreshes the view.
2014-08-01 10:59:49 +02:00
Klaas Freitag
a6987ad703 Mac overlays: Fix allocations, use icns, correct query type. 2014-08-01 10:59:49 +02:00
Klaas Freitag
5642e40bc8 Mac Overlays: Add icon containers 1.st part 2014-08-01 10:59:48 +02:00
Mackie Messer
50d178feaa MacOSX shell integration code plus icons. 2014-08-01 10:59:48 +02:00
Daniel Molkentin
8d71328192 Windows Overlay Icons 2014-07-30 17:20:55 +02:00
Jenkins for ownCloud
17b320f7dc [tx-robot] updated from transifex 2014-07-30 01:25:24 -04:00
Olivier Goffart
f1ad82d0ba t2.pl Fix the test testing that moving a file that was just added do not create duplicate 2014-07-29 13:58:21 +02:00
Jenkins for ownCloud
2fb283749c [tx-robot] updated from transifex 2014-07-29 01:25:24 -04:00
Jenkins for ownCloud
5a4c023fc9 [tx-robot] updated from transifex 2014-07-28 02:06:11 -04:00
Jenkins for ownCloud
e8afac3a01 [tx-robot] updated from transifex 2014-07-28 01:25:19 -04:00
Jenkins for ownCloud
6284517dc9 [tx-robot] updated from transifex 2014-07-27 01:25:21 -04:00
Jenkins for ownCloud
80c096b6f1 [tx-robot] updated from transifex 2014-07-26 01:25:23 -04:00
Markus Goetz
f004d5085d Merge remote-tracking branch 'origin/1.6' into il
Conflicts:
	VERSION.cmake
2014-07-25 12:37:27 +02:00
Klaas Freitag
98e21ae0ad SocketAPI: Connect REGISTER_FOLDER to Foldermans events. 2014-07-25 12:20:38 +02:00
Klaas Freitag
00274722ce nautilus plugin: Adopted to latest socket api changes. 2014-07-25 12:11:21 +02:00
Klaas Freitag
8b93678e3d SocketAPI: Added REGISTER_PATH and UNREGISTER_PATH
to inform the plugins about the top sync directories.

Also cleaned the code a bit.
2014-07-25 12:11:21 +02:00
dark-eye
1b3ec955b1 Merge pull request #2000 from dark-eye/fix_folder_status_ui_ignore_new_line_inoverall_text
Fix folder status ui ignore new line inoverall text
2014-07-24 12:52:15 +03:00
Jenkins for ownCloud
5356898efc [tx-robot] updated from transifex 2014-07-24 01:25:23 -04:00
Eran
2ca8805cda Removed uneed code 2014-07-23 15:09:28 +03:00
Eran
8e5c41e6f3 Merge https://github.com/owncloud/mirall into fix_folder_status_ui_ignore_new_line_inoverall_text 2014-07-23 13:53:05 +03:00
Eran
0f7efbc22e fixed bug where the overall text caused in the folder view the to defrom 2014-07-23 13:52:02 +03:00
Jenkins for ownCloud
6b7bd07c97 [tx-robot] updated from transifex 2014-07-23 01:25:21 -04:00
Klaas Freitag
8d85516e72 tx.pl: Add a chunking update test, test for precondition failed. 2014-07-22 18:07:34 +02:00
Klaas Freitag
0f4cf74ae0 SyncEngine: allow to do a post upgrade script in debug mode. 2014-07-22 18:07:02 +02:00
Klaas Freitag
4dfe0fad7d tests: Big file chunking, change an existing big file to trigger update
This failed on oC7
2014-07-22 10:45:03 +02:00
Jenkins for ownCloud
2e91ea8093 [tx-robot] updated from transifex 2014-07-22 01:25:22 -04:00
Klaas Freitag
77e3480b2f 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-07-21 13:19:36 +02:00
Jenkins for ownCloud
bca1ef42fc [tx-robot] updated from transifex 2014-07-21 01:25:21 -04:00
Jenkins for ownCloud
010ab7119e [tx-robot] updated from transifex 2014-07-20 01:25:22 -04:00
Jenkins for ownCloud
3cb93510ac [tx-robot] updated from transifex 2014-07-19 01:25:30 -04:00
Olivier Goffart
8a88ca6f34 Merge branch 'il'
Conflicts:
	src/mirall/propagator_legacy.h
2014-07-18 17:00:38 +02:00
Olivier Goffart
81d786733d Merge remote-tracking branch 'origin/1.6' into il
Conflicts:
	VERSION.cmake
	src/mirall/propagator_qnam.cpp
	src/mirall/propagator_qnam.h
2014-07-18 16:59:29 +02:00
Olivier Goffart
336e74b992 csync_owncloud: fix the name of the permissions property 2014-07-18 16:52:04 +02:00
Klaas Freitag
74b3e2ce3f tests: Another try to get around the jenkins test problem. 2014-07-18 12:20:14 +02:00
Jenkins for ownCloud
ed6e3e4ee2 [tx-robot] updated from transifex 2014-07-18 01:25:23 -04:00
Klaas Freitag
f8bea55b10 SocketAPI: Handle top sync folder correctly. 2014-07-17 19:34:50 +02:00
Daniel Molkentin
72cd84e878 SocketAPI: Exclude drive part from path blacklist check
Otherwise, it always matches the ':' part
2014-07-17 19:26:58 +02:00
Daniel Molkentin
35b6d09615 SocketAPI: Fix separators on Windows 2014-07-17 17:41:20 +02:00
Daniel Molkentin
1ae727e70f SocketAPI: Emit error of binding the server fails 2014-07-17 15:01:01 +02:00
Daniel Molkentin
0e5d0c1170 SocketAPI: Some cleaning up 2014-07-17 15:00:21 +02:00
Daniel Molkentin
7ff62bc577 NSIS: ICU rebumped to 5.3 as per build service change 2014-07-17 14:57:04 +02:00
Klaas Freitag
743c1c2eda SocketAPI: Send an UPDATE_VIEW to the shell plugin on connect.
For each configured sync folder send an UPDATE_VIEW directly after
the socket connect to make the shell integration updating the view.
2014-07-17 11:26:03 +02:00
Klaas Freitag
0e9a08cbbf SocketAPI: rename slot to send UPDATE_VIEW. 2014-07-17 11:25:08 +02:00
Klaas Freitag
d2445ec72d PropagatorQNAM: Never send if-match header for new files. 2014-07-17 11:23:11 +02:00
Klaas Freitag
fef713aaed SocketAPI: Create the socket API instance in folderman. 2014-07-17 11:22:18 +02:00
Klaas Freitag
c4d73688a6 Folderman: Fix path detection in folderForPath(). 2014-07-17 11:21:02 +02:00
Daniel Molkentin
56b721b2eb propagator_qnam: fix warning 2014-07-17 11:05:16 +02:00
Klaas Freitag
2981b37219 Use file size of factor of four because of the createLocalFile algorithm 2014-07-17 10:29:13 +02:00
Jenkins for ownCloud
cfc2f84d3e [tx-robot] updated from transifex 2014-07-17 01:25:28 -04:00
Klaas Freitag
2a5691e575 tests: Fix assertion. 2014-07-16 17:26:06 +02:00
Klaas Freitag
774432066e tests: Reverted previous change, do not append in createLocalFile() 2014-07-16 17:25:18 +02:00
Klaas Freitag
e6c501de8e FolderMan: More useful logging. 2014-07-16 16:59:20 +02:00
Klaas Freitag
d5a8661480 tests: do not use system any more to modify files, rather perl native. 2014-07-16 14:06:57 +02:00
Olivier Goffart
2fdb3cfdfb Merge branch 'il'
Conflicts:
	src/mirall/folder.cpp
	src/mirall/propagator_qnam.cpp
2014-07-16 10:49:16 +02:00
Olivier Goffart
8961e61f60 Merge branch '1.6' into il
Conflicts:
	VERSION.cmake
	src/mirall/syncengine.cpp
	src/mirall/syncengine.h
2014-07-16 09:57:40 +02:00
Jenkins for ownCloud
e5191acd73 [tx-robot] updated from transifex 2014-07-16 01:25:23 -04:00
Klaas Freitag
997504c03c FolderMan: Unload folder method added.
unloadFolder now correctly removes a folder from all maps and signal
mappers.
2014-07-15 16:07:23 +02:00
Jenkins for ownCloud
dde06dfaba [tx-robot] updated from transifex 2014-07-14 01:25:21 -04:00
Jenkins for ownCloud
eb0f074097 [tx-robot] updated from transifex 2014-07-13 02:06:11 -04:00
Jenkins for ownCloud
b6c9b5645c [tx-robot] updated from transifex 2014-07-13 01:25:20 -04:00
Klaas Freitag
a281b36d6f SocketAPI: send the path with UPDATE_VIEW 2014-07-11 12:34:04 +02:00
Klaas Freitag
7772501cdf Remove unused socketPath variable. 2014-07-11 12:33:43 +02:00
Daniel Molkentin
d1b991e198 Fix windows compilation 2014-07-10 22:58:58 +02:00
Klaas Freitag
00f793a841 CMake: Remove accidentially added typo to fix build. 2014-07-10 17:20:40 +02:00
Klaas Freitag
bdb9598227 SocketAPI: Use QTcpSocket all over, rather than QLocalSocket. 2014-07-10 16:35:18 +02:00
Klaas Freitag
c6deb392fd SocketAPI: Enhance SyncFileStatus to have share information.
Added a new class SyncFileStatus to reflect that properly.
2014-07-10 16:28:40 +02:00
Olivier Goffart
3477ea0eeb Fix build with TOKEN_ONLY_AUTH
It was broken by commit 6ff38d8005
2014-07-10 15:26:55 +02:00
Klaas Freitag
9dacad99fa t1.pl: Change the corruption creation command. 2014-07-10 12:07:28 +02:00
Olivier Goffart
73e35c66af owncloudcmd: fix the --trust option
We can't call csync_set_userdata in owncloudcmd because it is
going to be overwritten later in the SyncEngine.
So we had an object of type SyncEngine* that we cast to CmdOptions*
and the trust flag was in the padding, so was some random data.

Therefore we must use global variables in that case in order to
know if we should ignore the certificate.
2014-07-10 11:19:23 +02:00
Olivier Goffart
d3b599b727 Fix build of the test on Qt5 2014-07-10 10:42:02 +02:00
Jenkins for ownCloud
4369151cd8 [tx-robot] updated from transifex 2014-07-10 03:57:24 -04:00
Olivier Goffart
846773efd3 Define Q_DECL_OVERRIDE for Qt4
That macro is new in Qt5, define it as well when compiling with Qt4
so we can use it in mirall

Note: QNetworkCookieJar::deleteCookie was not existing in Qt4.
2014-07-09 23:31:56 +02:00
Olivier Goffart
bcfa34357b Add Q_DECL_OVERRIDE for all function that are overriding something
This was made automatically with
clang-modernize -override-macros -add-override
2014-07-09 23:31:56 +02:00
Olivier Goffart
e0c2e8ed86 folder: remove TOKEN_AUTH_ONLY
Folder is no longer in the libowncloudsync
2014-07-09 22:44:08 +02:00
Olivier Goffart
b80a3876ab cleanup the CMakeLists.txt
Headers need not to be added if they are not going to be installed
The list was incomplete anyway, and most of the _HEADERS variables
were even not used
2014-07-09 22:44:08 +02:00
Olivier Goffart
26e17f58ef Engine: Do not reset the csync log callback in the engine
It is already set in Folder and we don't want to use the Logger
in command line clients
2014-07-09 22:44:08 +02:00
Olivier Goffart
45d1567057 Move Folder, FolderMan, and FolderWatcher outside of owncloudsync
Those class are maintaining the folder for the mirall configuration
They are not usefull in command line clients

Also the FolderWatcher is only used by the folder and not used by the
command line clients
2014-07-09 22:44:08 +02:00
Olivier Goffart
8aacb3f7ec Remove undeeded include 2014-07-09 22:44:08 +02:00
Olivier Goffart
99ee81a489 Utility: Move showInFileManager in its own file
And get rid of GUI in the Utility namespace
2014-07-09 22:44:08 +02:00
Olivier Goffart
517ffbd783 Utility: remove Utility::dataLocation
It is used only from one location, so put the code there
2014-07-09 22:44:08 +02:00
Olivier Goffart
7dd926d4f1 Utility: move raiseDisalog to owncloudGui
Reduce the GUI dependency in the Utility namespace used by libowncloudsync
2014-07-09 22:44:08 +02:00
Olivier Goffart
cbc7942a00 Added t8.pl that test case sensitivity issues
Made some change in the .cpp code in order to be able to test
the code when the file system is case sensitive
2014-07-09 22:44:08 +02:00
Jenkins for ownCloud
3806905f5b [tx-robot] updated from transifex 2014-07-09 01:25:24 -04:00
Jenkins for ownCloud
2496f23e45 [tx-robot] updated from transifex 2014-07-08 01:25:22 -04:00
Jenkins for ownCloud
4bb1172c84 [tx-robot] updated from transifex 2014-07-05 01:25:23 -04:00
Jenkins for ownCloud
367ff79ef1 [tx-robot] updated from transifex 2014-07-04 01:25:25 -04:00
Daniel Molkentin
2961c44bbe NSIS: look for socketapiclient in the right place 2014-07-03 09:35:45 +02:00
Daniel Molkentin
997559dc6d NSIS: fix typo 2014-07-03 09:17:08 +02:00
Jenkins for ownCloud
79d28bbc35 [tx-robot] updated from transifex 2014-07-03 01:25:24 -04:00
Daniel Molkentin
6bc425f981 NSIS: Add socketapiclient 2014-07-02 12:05:23 +02:00
Daniel Molkentin
2cdfc16829 SocketAPI: rename test client binary to socketapiclient 2014-07-02 12:03:52 +02:00
Daniel Molkentin
e63d45cca9 SocketAPI: put binary into bin/ dir 2014-07-02 11:15:39 +02:00
Daniel Molkentin
553f186b7c SocketAPI: Build test client with Qt5 2014-07-02 11:11:11 +02:00
Daniel Molkentin
623dfc0286 Socket API: Add test client 2014-07-02 10:10:32 +02:00
Jenkins for ownCloud
ffa7f35a87 [tx-robot] updated from transifex 2014-07-02 01:25:30 -04:00
Olivier Goffart
081b7d4aa9 Merge pull request #1913 from owncloud/typo-fix
Typo fix
2014-07-01 20:39:30 +02:00
Olivier Goffart
9c3c4bac66 Merge remote-tracking branch 'origin/il' 2014-07-01 20:37:42 +02:00
Daniel Molkentin
6ec218ef11 FF docs submodules 2014-07-01 16:24:34 +02:00
Daniel Molkentin
ad2eabeb3b SocketAPI: Try to make the folder selection work on windows 2014-07-01 16:24:14 +02:00
Daniel Molkentin
26c377d05b Utility: export new functions 2014-06-30 14:13:45 +02:00
Jenkins for ownCloud
caa75d98be [tx-robot] updated from transifex 2014-06-30 01:25:23 -04:00
Volkan Gezer
3ad9356ca4 Typo fix 2014-06-29 14:14:44 +02:00
Volkan Gezer
dd5296f03c Typo fix
Suggested by [mnestis](https://www.transifex.com/accounts/profile/mnestis/)
2014-06-29 14:06:45 +02:00
Volkan Gezer
e673d76f22 Typo fix
Suggested by [mnestis](https://www.transifex.com/accounts/profile/mnestis/)
2014-06-29 14:04:30 +02:00
Volkan Gezer
393eb7bb4d Typo fix
Suggested by [mnestis](https://www.transifex.com/accounts/profile/mnestis/)
2014-06-29 14:02:50 +02:00
Jenkins for ownCloud
2fa5a5b8c3 [tx-robot] updated from transifex 2014-06-29 01:25:23 -04:00
Jenkins for ownCloud
ca63b79ed8 [tx-robot] updated from transifex 2014-06-28 01:25:25 -04:00
Daniel Molkentin
f8b097669a Merge remote-tracking branch 'origin/1.6'
Conflicts:
	VERSION.cmake
	doc/building.rst
2014-06-27 15:34:20 +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
09881040a3 Permissions: fix restoring subdirectories
The sync item vector must be sorted before we call checkForPermission
2014-06-27 13:34:15 +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
Jenkins for ownCloud
e7d597045b [tx-robot] updated from transifex 2014-06-27 02:06:13 -04:00
Jenkins for ownCloud
eaa3a2eae2 [tx-robot] updated from transifex 2014-06-27 01:25:23 -04:00
Olivier Goffart
21d7d8988a t1.pl: add a sleep to make sure the mtime of the files are different
It could be that the files are changed in the same second if the previous
sync was fast, and therefore the changes not detected.
2014-06-26 13:11:47 +02:00
Klaas Freitag
e76386be4f Revert "ownCloudcmd: Use Account object and ConnectionValidator."
We decided that owncloudcmd should not share the config with mirall.
This reverts commit 5f96de32bb.
2014-06-26 10:16:56 +02:00
Jenkins for ownCloud
b3b3ca0e16 [tx-robot] updated from transifex 2014-06-26 02:06:14 -04:00
Jenkins for ownCloud
730e86c4cd [tx-robot] updated from transifex 2014-06-26 01:25:24 -04:00
Jenkins for ownCloud
a92f1cb055 [tx-robot] updated from transifex 2014-06-25 06:34:41 -04:00
Jenkins for ownCloud
a54162e009 [tx-robot] updated from transifex 2014-06-25 06:31:32 -04:00
Olivier Goffart
48864a6921 httpcredentials: Remove useless mutex
The mutex is not shared with any thread, so it is totaly useless.

Yes: there are possible races here. (with the account, but also with the
user and password)
2014-06-25 12:15:30 +02:00
Olivier Goffart
92f07cb60f Enable C++11
In order to avoid the warning
 warning: anonymous variadic macros were introduced in C99
Due to the use of variadic macro in the qDebug macro in Qt 5.3

C++11 requires a space between string literal and macro to avoid the
ambiguity with user defined litteral
2014-06-25 12:01:27 +02:00
Klaas Freitag
5f96de32bb ownCloudcmd: Use Account object and ConnectionValidator.
That reads the credentials from the mirall config file if it was not
defined on the command line. Moreover, the connection is validated
before, which sets up the credentials properly.
2014-06-24 15:33:42 +02:00
Klaas Freitag
d2436ce23d Networkjobs: Check if reply body is empty before parsing.
This avoids a false warning that the result is not valid JSON.
2014-06-24 15:17:33 +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
3c4f410a4e cmake compilation flags: don't define -Wdeclaration-after-statement
We are in 2014, let me use C99 already.
2014-06-24 11:02:58 +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
94ddf7e5d8 Merge remote-tracking branch 'origin/il' 2014-06-24 08:40:27 +02:00
Jenkins for ownCloud
f45dd8e94f [tx-robot] updated from transifex 2014-06-24 01:25:30 -04:00
Olivier Goffart
b735dc07d6 Permissions: Consider and empty remotePerms from csync as NULL
Since remotePerm from csync is never NULL (as it is a buffer),
we consider that if it is empty, there was no permission set
(and therefore everything is allowed)

csync will put a space in the permission if any permission was set
2014-06-23 15:05:48 +02:00
Olivier Goffart
68c902e60b propagator: Fix restoring directory
If the result of a restored directory is SoftError, this prevent
to sync the rest of the directory

Therefore, we introduced a new status Restored,  which means that
the job was a success, but is a restoration and therefore should be
seen as a warning
2014-06-23 13:56:17 +02:00
Olivier Goffart
e19214c3c4 permissions: record them even if the instruction is NONE
when the instruction is NONE, we may return from this function
before having registered the permission in the SyncEngine::_remotePerms
hash.
Move the code a bit up.
2014-06-23 13:35:34 +02:00
Olivier Goffart
4759429702 Fix compilation after merge
Some initializer were added in 1.6 for variable that are gone in master
2014-06-23 12:53:51 +02:00
Olivier Goffart
b626589c07 Merge branch 'il'
Conflicts:
	src/mirall/folderstatusmodel.h
2014-06-23 12:52:03 +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
Jenkins for ownCloud
4555d4bcbe [tx-robot] updated from transifex 2014-06-23 01:25:24 -04:00
Jenkins for ownCloud
184e58f5e5 [tx-robot] updated from transifex 2014-06-22 01:25:22 -04:00
Jenkins for ownCloud
5c7f3c1642 [tx-robot] updated from transifex 2014-06-21 01:25:26 -04:00
Klaas Freitag
36331512bc doc: Updated package list for win32 build. 2014-06-20 14:41:36 +02:00
Olivier Goffart
3e916cfbb9 remove unused member
CID 12915
CID 12926
2014-06-20 12:08:58 +02:00
Olivier Goffart
4a9ad14e11 Folder: remove unused variable
CID 12914
2014-06-20 12:01:20 +02:00
Olivier Goffart
f80816d88f SyncEngine: silence coverity issue 12885
It was complaining that we use the context later in the function
but the csync context should never be null anyway
2014-06-20 11:53:22 +02:00
Jenkins for ownCloud
817f89d586 [tx-robot] updated from transifex 2014-06-20 01:25:21 -04:00
Olivier Goffart
458645101b SocketApi: query the database for the Shared flag 2014-06-19 15:37:29 +02:00
Olivier Goffart
1e306012ec SocketApi: Fix recursiveFolderStatus
If only one file is EVAL or NEW, this mean the folder need to be sync
2014-06-19 15:25:30 +02:00
Olivier Goffart
db2c198feb SocketAPI: Merge command_RETRIEVE_FOLDER_STATUS and command_RETRIEVE_FILE_STATUS
They do the same thing because fileStatus calls recursiveFolderStatus
for directories anyway
2014-06-19 15:02:27 +02:00
Markus Goetz
71a901a24e TokenCredentials: Fix cookie behaviour
parseCookies did not work as expected. Now we just hard-set the
token credentials into the Cookie header for QNAM jobs.
This is the same behaviour as for neon jobs.

(cherry picked from commit 855a8c0a335f76b82b8e647a8c5a4ae692065d3b)
2014-06-19 14:41:47 +02:00
Olivier Goffart
f4ea34e63b SyncJournalDb: use QByteArray for etag and fileid 2014-06-19 14:27:04 +02:00
Olivier Goffart
0d54b88ab2 Socket API: Make it work with Qt5's QUrl
QUrl default constructor has a different behaviour in Qt5
One must not forget to call QUrl::fromLocalFile in Qt5
2014-06-19 14:22:03 +02:00
Olivier Goffart
da0bd14bf3 Socket API: move the code that gets the status out of the folder
Move the code in socketapi.cpp where it belongs
2014-06-19 14:08:30 +02:00
Jenkins for ownCloud
6ce746b9ea [tx-robot] updated from transifex 2014-06-19 01:25:20 -04:00
Olivier Goffart
02355696ff engine: When restoring the file, use the mtime and fileid from the server
Important to switch the things around as we are going to write them in the DB
2014-06-18 16:15:14 +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
Jenkins for ownCloud
6c3eb06b65 [tx-robot] updated from transifex 2014-06-18 01:25:22 -04:00
Olivier Goffart
c759e8bb8f permission: read them from the tree 2014-06-17 14:50:24 +02:00
Olivier Goffart
b83f6c0b3a sync engine: try to respect permission
This is still Work in progress
2014-06-17 14:44:58 +02:00
Olivier Goffart
ade92d8ac1 csync test: fix warning 2014-06-17 14:16:42 +02:00
Jenkins for ownCloud
08398784e4 [tx-robot] updated from transifex 2014-06-17 01:25:29 -04:00
dark-eye
afea881d90 Merge pull request #1717 from dark-eye/master
Issue-142 : added time estimation and bandwidth indicator to the systray
2014-06-17 08:16:52 +03:00
Olivier Goffart
194bba2118 Merge remote-tracking branch 'origin/il' into tmp_master 2014-06-16 16:58:57 +02:00
Markus Goetz
a5967e4ecd CSync: Fix win32 compile 2014-06-16 16:53:10 +02:00
Olivier Goffart
21e22a50c5 Merge remote-tracking branch 'origin/il' into master 2014-06-16 16:43:48 +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
Jenkins for ownCloud
22c01748ce [tx-robot] updated from transifex 2014-06-16 02:06:11 -04:00
Jenkins for ownCloud
02809d5016 [tx-robot] updated from transifex 2014-06-16 01:25:22 -04:00
Jenkins for ownCloud
d21f312936 [tx-robot] updated from transifex 2014-06-14 01:25:22 -04:00
Markus Goetz
357b041bb4 CSync: Give ctx to proxy callback
This fixes a crash.
2014-06-13 16:46:51 +02:00
Markus Goetz
61999a67cd CSync: Give ctx to proxy callback
This fixes a crash.
2014-06-13 15:36:00 +02:00
Daniel Molkentin
8da97a7c6f Merge remote-tracking branch 'origin/1.6' 2014-06-13 13:31:50 +02:00
Olivier Goffart
2caa69e0cb blacklist: use the _ERROR instruction instead of _IGNORE
When something is in the blacklist, still use the _ERROR instruction
that way the applications can still report errors for blacklisted
items
2014-06-13 11:19:31 +02:00
Jenkins for ownCloud
c5932569f8 [tx-robot] updated from transifex 2014-06-13 01:25:21 -04:00
Eran
1921d1a5be Merge branch 'dark-eye-master' 2014-06-12 12:51:56 +03:00
Jenkins for ownCloud
8745a684ae [tx-robot] updated from transifex 2014-06-12 02:06:12 -04:00
Jenkins for ownCloud
892cd962f8 [tx-robot] updated from transifex 2014-06-12 01:25:22 -04:00
Jenkins for ownCloud
3f543b881d [tx-robot] updated from transifex 2014-06-11 02:06:11 -04:00
Jenkins for ownCloud
4a1d0eb80e [tx-robot] updated from transifex 2014-06-11 01:25:22 -04:00
Klaas Freitag
760ecd71fc Theme: Show the stringified app version rather than the major version.
This was a regression, we changed that by accident in 1.6.0.
2014-06-10 13:48:27 +02:00
Jenkins for ownCloud
04f1026cd8 [tx-robot] updated from transifex 2014-06-10 01:25:24 -04:00
Jenkins for ownCloud
b03c4cc62e [tx-robot] updated from transifex 2014-06-08 01:25:21 -04:00
Olivier Goffart
18e9357aaf network limits: Fix warning
About the order of initialization
2014-06-07 12:20:54 +02:00
Olivier Goffart
46b8260693 network limits: Do not read them from the config file in the engine
Do that from the folder, because the engine can be used in app where
the MirallConfigFile is not accessible
2014-06-07 12:09:22 +02:00
Olivier Goffart
d5bd3190d4 csync unit tests: fix cimpilation 2014-06-07 12:08:58 +02:00
Jenkins for ownCloud
e497b6d458 [tx-robot] updated from transifex 2014-06-07 02:06:12 -04:00
Jenkins for ownCloud
2e4320ee05 [tx-robot] updated from transifex 2014-06-07 01:25:22 -04:00
Eran
3406fcdce4 Merge branch 'master' of https://github.com/owncloud/mirall into dark-eye-master
Conflicts:
	src/mirall/progressdispatcher.h
2014-06-06 18:56:58 +03:00
Klaas Freitag
14a5ff6747 overlayIcons: First version of the nautilus overlay python module 2014-06-06 17:49:19 +02:00
Markus Goetz
8dbfcd782b CSync: Fetch permissions from server for whole tree on server update 2014-06-06 17:10:07 +02:00
Olivier Goffart
abf0f90a13 SocketAPI: broadcast change when an item is done 2014-06-06 15:52:55 +02:00
Klaas Freitag
4d5c74c019 SocketAPI: Add another API call for stat of file and folder separately. 2014-06-06 15:38:20 +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
Jenkins for ownCloud
ef3b4956ad [tx-robot] updated from transifex 2014-06-06 01:25:21 -04:00
Markus Goetz
fd4642d827 Folder: Don't add ignored files on startup
Before each sync is enough.
(We could do it at startup only, but so far it is good to have
it at each sync so we can easier see stuff in the log)
2014-06-05 17:50:18 +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
Markus Goetz
34b31c0146 CSync: Fix test compile
The previously applied pull request apparantly broke the compile
because it re-ordered entries in the CMakeLists
2014-06-05 14:22:10 +02:00
Daniel Molkentin
3934fa019e SocketAPI: proper name for pipe on windows 2014-06-05 12:02:57 +02:00
Daniel Molkentin
dc53e96f92 [Janitor] Bump version on master to 1.7.0prealpha 2014-06-05 12:02:00 +02:00
Daniel Molkentin
7fcf6f9f79 Merge branch '1.6' 2014-06-05 12:01:50 +02:00
Olivier Goffart
bd48ab23c3 Merge pull request #1835 from zizzfizzix/cmake_fixes
A little CMake cleanup
2014-06-05 11:48:40 +02:00
Markus Goetz
4e28ba73bb Windows: Fix build harder. 2014-06-05 10:13:20 +02:00
Jenkins for ownCloud
16cb37ecd0 [tx-robot] updated from transifex 2014-06-05 01:25:23 -04:00
Markus Goetz
d4d630b2e9 Windows: Fix build 2014-06-04 12:47:17 +02:00
Markus Goetz
2ff27cdd63 Merge pull request #1844 from owncloud/csyncStdlibReduction
Csync reduction

Reviewed offline by @dragotin
2014-06-04 11:28:35 +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
Jenkins for ownCloud
df12a58e3d [tx-robot] updated from transifex 2014-06-04 01:25:24 -04:00
Kuba Serafinowski
4b3d124b5a put man docs in the correct /man1 directory
man doesn't work here when the docs are in a /man directory
2014-06-04 00:10:18 +03:00
Kuba Serafinowski
51e941e7b5 look for Sparkle only on OS X 2014-06-04 00:10:17 +03:00
Kuba Serafinowski
62ea6f316f don't look for CMocka if we're not building unit tests 2014-06-04 00:10:16 +03:00
Olivier Goffart
4cb9b3a85b Test: fix compilation 2014-06-03 17:54:43 +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
Olivier Goffart
08ca8b54b1 test fles with '%' and '#' 2014-06-03 17:27:06 +02:00
Olivier Goffart
abafbef985 Optimize move
Do not send the mtime for each file without a directory, because the server now keeps it
2014-06-03 17:27:06 +02:00
Markus Goetz
06863ca9c6 Merge pull request #1839 from owncloud/directDownload
Direct download URL support + global variable refactoring

Reviewed offline by @dragotin
2014-06-03 16:44:05 +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
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
1af3d3f18b More descriptive error message when querying the database without hit. 2014-06-03 09:50:09 +02:00
Klaas Freitag
f54248c0a7 Minor cleanups and changes 2014-06-03 09:50:09 +02:00
Klaas Freitag
2911c0e1c4 Add a recursiveFolderStatus method 2014-06-03 09:50:09 +02:00
Klaas Freitag
16d35c1489 Avoid crash on csync_ctx is NULL. 2014-06-03 09:50:09 +02:00
Eran
cd82a8585a change the text to be a little more descriptive and use shorthand in the context menu 2014-05-29 00:09:02 +03:00
Eran
6927fc80c3 change the mapping to use short hand and also made the mapping logic a little losser 2014-05-28 13:09:30 +03:00
Eran
89a95d6445 fixed comment spelling 2014-05-28 08:28:03 +03:00
Eran
f9192e27fa added "/s" to the bandwidth 2014-05-26 16:25:33 +03:00
Eran
ba5e955ccb chaned the design a little 2014-05-25 22:43:41 +03:00
Eran
fae3e46a59 made the code a little cleaner 2014-05-20 16:56:39 +03:00
Eran
3777074e84 Remove extra space between the parenthesis when displaying estimation in the system tray 2014-05-15 17:46:25 +03:00
Eran
5310a3cc1d better time prediction 2014-05-14 16:57:14 +03:00
Eran
1509c4ffba made the time description more malleable ,added support for none size update estimation (ie.. deletion), made the estimation more responsive at start and less jittery after some time 2014-05-14 10:55:04 +03:00
Eran
71ea2b582c changed the systray to display total size and estimated time when the syncronization actually has size changed the descriptive time logic to be more generic 2014-05-12 17:36:27 +03:00
Eran
219098c182 Changed the time estimate string to be more textual, also added lower limit to the estimate to prevents starting estimation jittering 2014-05-12 00:26:17 +03:00
Eran
35b3ddd61f Made the estimated time only appear in the systray when the sync has actual size. 2014-04-29 02:43:35 +03:00
Eran
a892b79dba Seperated the systray estimation text to a seperate action, fixed an integer rounding bug 2014-04-29 02:31:27 +03:00
Eran
cd22a1846f Fixed Indentation and multiple concurrent files syncing case ...
..Also increased the height of folder progress bar alittle in order to accommodate the added estimation data
2014-04-28 18:49:27 +03:00
Eran
eadcdab8e7 Issue-#142 : Added support for current file completion estimation.
Changed the account settings estimation to display both current file and overwhole estimation.
Decresed the progress font size to fit the added information
2014-04-27 00:48:12 +03:00
Eran
46ffd1c29a Issue-142 : added time estimation and bandwidth indicator to the systry and active download 2014-04-25 01:08:25 +03:00
573 changed files with 235487 additions and 17690 deletions

1
.gitattributes vendored
View File

@@ -2,3 +2,4 @@
.gitignore export-ignore
.gitattributes export-ignore
.commit-template export-ignore
binary/ export-ignore

150
.gitignore vendored
View File

@@ -16,3 +16,153 @@ build*
cscope.*
tags
t1.cfg
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Mac OS X specific
shell_integration/MacOSX/*.xcworkspace/xcuserdata/
**/.DS_Store
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
*.pubxml
# NuGet Packages
packages/*
*.nupkg
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
# This line needs to be after the ignore of the build folder
# (and the packages folder if the line above has been uncommented)
!packages/build/
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Microsoft Fakes
FakesAssemblies/

5
.gitmodules vendored
View File

@@ -3,4 +3,7 @@
url = https://github.com/owncloud/documentation
[submodule "src/3rdparty/qtmacgoodies"]
path = src/3rdparty/qtmacgoodies
url = git://github.com/guruz/qtmacgoodies.git
url = git://github.com/shadone/qtmacgoodies.git
[submodule "binary"]
path = binary
url = git://github.com/owncloud/owncloud-client-binary.git

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.8.0)
project(mirall)
set(PACKAGE "mirall")
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
@@ -50,6 +52,7 @@ if (${GIT_SHA1} STREQUAL "GITDIR-NOTFOUND")
set (GIT_SHA1 "${sha1_candidate}")
endif()
endif()
message(STATUS "GIT_SHA1 ${GIT_SHA1}")
endif()
set(SYSCONFDIR ${SYSCONF_INSTALL_DIR})
@@ -108,7 +111,10 @@ if(NOT TOKEN_AUTH_ONLY)
endif()
endif()
Find_package(Sparkle)
if(APPLE)
find_package(Sparkle)
endif(APPLE)
if(UNIX)
find_package(INotify REQUIRED)
else()
@@ -118,11 +124,22 @@ find_package(Sphinx)
find_package(PdfLatex)
find_package(SQLite3 3.8.0 REQUIRED)
# On some OS, we want to use our own, not the system sqlite
if (USE_OUR_OWN_SQLITE3)
include_directories(BEFORE ${SQLITE3_INCLUDE_DIR})
endif()
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(test/test_journal.db "${CMAKE_BINARY_DIR}/test/test_journal.db" COPYONLY)
# Copy that logo, the installer uses it later
if(BUILD_OWNCLOUD_OSX_BUNDLE)
install(FILES resources/owncloud_logo_blue.png DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/)
endif()
include(OwnCloudCPack.cmake)
add_definitions(-DUNICODE)
@@ -137,7 +154,9 @@ set(TRANSLATIONS ${TRANS_FILES})
add_subdirectory(csync)
add_subdirectory(src)
add_subdirectory(shell_integration)
add_subdirectory(doc)
add_subdirectory(admin)
if(UNIT_TESTING)
include(CTest)
@@ -149,4 +168,5 @@ if(BUILD_OWNCLOUD_OSX_BUNDLE)
configure_file(sync-exclude.lst ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/sync-exclude.lst COPYONLY)
else()
install( FILES sync-exclude.lst DESTINATION ${SYSCONFDIR}/${APPLICATION_SHORTNAME} )
configure_file(sync-exclude.lst bin/sync-exclude.lst COPYONLY)
endif()

View File

@@ -1,12 +1,58 @@
ChangeLog
=========
version 1.6.3 (release 2014-09-03)
version 1.7.0 (release 2014-10-xx)
* oC7 Sharing: Handle new sharing options of ownCloud 7 correctly.
* Added Selective sync: Ability to unselect server folders which are
excluded from syncing, plus GUI and setup GUI
* Added overlay icons for Windows Explorer, Mac OS Finder and GNOME Nautilus.
Information is provided by the client via a local socket / named pipe API
which provides information about the sync status of files.
* Improved local change detection: consider file size, detect files
with ongoing changes and do not upload immediately
* Improved HTTP request timeout handler: all successful requests reset
the timeout counter
* Improvements for syncing command line tool: netrc support, improved
SSL support, non interactive mode
* Permission system: ownCloud 7 delivers file and folder permissions,
added ability to deal with it for shared folders and more.
* Ignore handling: Do not recurse into ignored or excluded directories
* Major sync journal database improvements for more stability and performance
* New library interface to sqlite3
* Improve "resync handling" if errors occur
* Blacklist improvements
* Improved logging: more useful meta info, removed noise
* Updated to latest Qt5 versions on Windows and OS X
* Fixed data loss when renaming a download temporary fails and there was
a conflict at the same time.
* Fixed missing warnings about reusing a sync folder when the back button
was used in the advanced folder setup wizard.
* The 'Retry Sync' button now also restarts all downloads.
* Clean up temporary downloads and some extra database files when wiping a
folder.
* OS X: Sparkle update to provide pkg format properly
* OS X: Change distribution format from dmg to pkg with new installer.
* Windows: Fix handling of filenames with trailing dot or space
* Windows: Don't use the wrong way to get file mtimes in the legacy propagator.
version 1.6.4 (release 2014-10-22)
* Fix startup logic, fixes bug #1989
* Fix raise dialog on X11
* Win32: fix overflow when computing the size of file > 4GiB
* Use a fixed function to get files modification time, the
original one was broken for certain timezone issues, see
core bug #9781 for details
* Added some missing copyright headers
* Avoid data corruption due to wrong error handling, bug #2280
* Do improved request timeout handling to reduce the number of
timed out jobs, bug #2155
version 1.6.3 (release 2014-09-03)
* Fixed updater on OS X
* Fixed memory leak in SSL button that could lead to quick memory draining
* Fixed upload problem with files >4 GB
* MacOSX, Linux: Bring Settings window to front properly
* Branded clients: If no configuration is detected, try to import the data
from a previously configured community edition.
from a previously configured community edition.
version 1.6.2 (release 2014-07-28 )
* Limit the HTTP buffer size when downloading to limit memory consumption.

View File

@@ -1,10 +1,10 @@
set( MIRALL_VERSION_MAJOR 1 )
set( MIRALL_VERSION_MINOR 6 )
set( MIRALL_VERSION_PATCH 3 )
set( MIRALL_VERSION_MINOR 7 )
set( MIRALL_VERSION_PATCH 0 )
set( MIRALL_SOVERSION 0 )
if ( NOT DEFINED MIRALL_VERSION_SUFFIX )
set( MIRALL_VERSION_SUFFIX "") #e.g. beta1, beta2, rc1
set( MIRALL_VERSION_SUFFIX "") #e.g. beta1, beta2, rc1
endif( NOT DEFINED MIRALL_VERSION_SUFFIX )
if( NOT DEFINED MIRALL_VERSION_BUILD )

2
admin/CMakeLists.txt Normal file
View File

@@ -0,0 +1,2 @@
# traverse into osx subdirectory to install and patch the create-pack script
add_subdirectory(osx)

3
admin/osx/CMakeLists.txt Normal file
View File

@@ -0,0 +1,3 @@
configure_file(create_mac_pkg.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh)
configure_file(macosx.pkgproj ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj)

View File

@@ -0,0 +1,74 @@
#!/bin/bash
# Script to create the Mac installer using the packages tool from
# http://s.sudre.free.fr/Software/Packages/about.html
#
[ "$#" -lt 2 ] && echo "Usage: create_mac_pkg.sh <CMAKE_INSTALL_DIR> <build dir> <installer sign identity>" && exit
# the path of installation must be given as parameter
if [ -z "$1" ]; then
echo "ERROR: Provide the path to CMAKE_INSTALL_DIR to this script as first parameter."
exit 1
fi
if [ -z "$2" ]; then
echo "ERROR: Provide the path to build directory as second parameter."
exit 1
fi
install_path="$1"
build_path="$2"
identity="$3"
prjfile=$build_path/admin/osx/macosx.pkgproj
# The name of the installer package
installer="@APPLICATION_NAME@-@MIRALL_VERSION_FULL@@MIRALL_VERSION_SUFFIX@"
installer_file="$installer.pkg"
installer_file_tar="$installer.pkg.tar"
installer_file_tar_bz2="$installer.pkg.tar.bz2"
installer_file_tbz="$installer.pkg.tbz"
# set the installer name to the copied prj config file
/usr/local/bin/packagesutil --file $prjfile set project name "$installer"
# The command line tool of the "Packages" tool, see link above.
pkgbuild=/usr/local/bin/packagesbuild
$pkgbuild -F $install_path $prjfile
rc=$?
if [ $rc == 0 ]; then
echo "Successfully created $installer_file"
else
echo "Failed to create $installer_file"
exit 3
fi
# Sign the finished package if desired.
if [ ! -z "$identity" ]; then
echo "Will try to sign the installer"
pushd $install_path
productsign --sign "$identity" "$installer_file" "$installer_file.new"
mv "$installer_file".new $installer_file
popd
else
echo "No certificate given, will not sign the pkg"
fi
# FIXME: OEMs?
# they will need to do their own signing..
# Sparkle wants a tbz, it cannot install raw pkg
cd $install_path
tar cf "$installer_file_tar" "$installer_file"
bzip2 -9 "$installer_file_tar"
mv "$installer_file_tar_bz2" "$installer_file_tbz"
rc=$?
if [ $rc == 0 ]; then
echo "Successfully created $installer_file"
else
echo "Failed to create $installer_file"
exit 3
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
enable-background="new 0 0 595.275 311.111"
xml:space="preserve"
height="200"
width="320"
version="1.1"
y="0px"
x="0px"
viewBox="0 0 35 0"
id="svg2"
inkscape:version="0.48.4 r9939"
sodipodi:docname="installer-background.svg"><metadata
id="metadata12"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs10" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1002"
id="namedview8"
showgrid="false"
inkscape:zoom="0.734375"
inkscape:cx="-49.141255"
inkscape:cy="236.17459"
inkscape:window-x="0"
inkscape:window-y="34"
inkscape:window-maximized="1"
inkscape:current-layer="svg2"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" /><path
style="text-indent:0;text-transform:none;block-progression:tb;color:#000000;fill:#ffffff;fill-opacity:1;enable-background:accumulate"
d="m 75.63384,28.421489 c -29.36582,0 -53.09172,23.724901 -53.09172,53.091701 0,12.1047 4.03087,23.2455 10.82647,32.1667 14.74225,-17.0631 36.50138,-27.8988 60.79508,-27.8988 11.88546,0 23.15644,2.6467 33.31219,7.2871 0.82221,-3.7185 1.24924,-7.5856 1.24924,-11.555 0,-29.3658 -23.72491,-53.091701 -53.09172,-53.091701 z M 6.30358,52.98809 c -15.29297,0 -27.58645,12.3977 -27.58645,27.6906 0,4.9515 1.27738,9.6301 3.53933,13.6373 9.22826,-5.206 19.89756,-8.2239 31.23002,-8.2239 1.09366,0 2.14708,0.039 3.22713,0.1052 -0.12231,-1.5502 -0.20806,-3.103 -0.20806,-4.6844 0,-8.5178 1.85002,-16.6223 5.10106,-23.9429 -4.37708,-2.9351 -9.62115,-4.5803 -15.30284,-4.5803 z m 130.95716,19.0502 c -1.12983,0 -2.21885,0.1381 -3.33122,0.2078 0.48121,3.0338 0.83274,6.097 0.83274,9.2651 0,4.9298 -0.62692,9.6869 -1.7697,14.2616 13.39754,7.4144 24.52385,18.5084 31.8547,31.9586 7.60342,-3.9586 16.08566,-6.4754 25.08804,-7.0787 -2.32015,-27.2093 -24.86184,-48.6137 -52.67416,-48.6137 z m -43.09675,19.7789 c -41.09117,0 -74.32775,33.2333 -74.32775,74.3278 0,41.0911 33.23329,74.3277 74.32775,74.3277 41.09447,0 74.32775,-33.2366 74.32775,-74.3277 0,-41.0945 -33.23657,-74.3278 -74.32775,-74.3278 z m -80.67652,0.3117 c -31.87937,0 -57.67166,25.792 -57.67166,57.6717 0,18.7668 8.94156,35.3802 22.79774,45.9078 5.84147,-11.2667 17.57406,-18.9461 31.1258,-18.9461 1.63789,0 3.21,0.1986 4.78871,0.4169 -0.49554,-3.6054 -0.72871,-7.2937 -0.72871,-11.0346 0,-17.8847 5.82174,-34.4234 15.71907,-47.7819 -5.92466,-7.4133 -10.1643,-16.321 -11.97162,-26.025 -1.33935,-0.092 -2.69673,-0.2078 -4.05979,-0.2078 z m 180.71831,34.3544 c -9.68,0 -18.74781,2.4714 -26.75364,6.6625 4.54607,10.0696 7.07867,21.2422 7.07867,32.9998 0,22.0146 -8.85114,42.0052 -23.21431,56.5275 10.5516,11.7145 25.861,19.0503 42.88961,19.0503 31.87937,0 57.67165,-25.7916 57.67165,-57.6717 0,-31.8793 -25.79195,-57.5664 -57.67165,-57.5664 z m -244.00885,7.5998 c -29.3701,0 -53.19693,23.6164 -53.19693,52.9832 0,29.3669 23.82815,53.1937 53.19364,53.1937 11.17727,0 21.53161,-3.4825 30.08487,-9.369 -3.5344,-5.492 -5.62151,-12.0581 -5.62151,-19.0503 0,-3.6291 0.53552,-7.1158 1.56148,-10.4099 -16.01267,-11.5721 -26.44131,-30.4034 -26.44131,-51.6319 0,-5.394 0.71083,-10.6098 1.97792,-15.6152 -0.52591,-0.013 -1.03171,-0.1052 -1.56152,-0.1052 z m 312.19495,45.5955 c -1.56661,0 -3.08252,0.1789 -4.58026,0.4169 0.0829,1.3242 0.1039,2.6108 0.1039,3.9559 0,16.9326 -6.68118,32.3015 -17.4889,43.7214 5.31706,6.1831 13.12695,10.0976 21.96526,10.0976 16.09849,0 29.14785,-12.9451 29.14785,-29.0439 0,-16.0985 -13.04936,-29.1479 -29.14785,-29.1479 z m -252.64924,3.1229 c -16.09783,0 -29.04395,12.9461 -29.04395,29.044 0,16.0978 12.94612,29.1478 29.04395,29.1478 12.33919,0 22.81287,-7.6994 27.06599,-18.5298 -10.378,-10.57 -17.83675,-24.0544 -21.13213,-39.0363 -1.92854,-0.3985 -3.88588,-0.6247 -5.93386,-0.6247 z"
id="path6"
inkscape:connector-curvature="0" /></svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

337
admin/osx/macdeployqt.py Executable file
View File

@@ -0,0 +1,337 @@
#!/usr/bin/python
# This file is part of ownCloud.
# It was inspired in large part by the macdeploy script in Clementine
# and Tomahawk
#
# ownCloud is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# ownCLoud is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ownCloud. If not, see <http://www.gnu.org/licenses/>.
import os
import re
import subprocess
import commands
import sys
from glob import glob
def QueryQMake(attrib):
return subprocess.check_output([qmake_path, '-query', attrib]).rstrip('\n')
FRAMEWORK_SEARCH_PATH=[
'/Library/Frameworks',
os.path.join(os.environ['HOME'], 'Library/Frameworks')
]
LIBRARY_SEARCH_PATH=['/usr/local/lib', '.']
QT_PLUGINS = [
'accessible/libqtaccessiblewidgets.dylib',
'sqldrivers/libqsqlite.dylib',
'platforms/libqcocoa.dylib',
'imageformats/libqgif.dylib',
'imageformats/libqico.dylib',
'imageformats/libqjpeg.dylib',
'imageformats/libqsvg.dylib',
'imageformats/libqmng.dylib',
]
QT_PLUGINS_SEARCH_PATH=[
# os.path.join(os.environ['QTDIR'], 'plugins'),
'/usr/local/Cellar/qt/5.2.1/plugins',
]
class Error(Exception):
pass
class CouldNotFindQtPluginErrorFindFrameworkError(Error):
pass
class InstallNameToolError(Error):
pass
class CouldNotFindQtPluginError(Error):
pass
class CouldNotFindScriptPluginError(Error):
pass
class CouldNotFindFrameworkError(Error):
pass
if len(sys.argv) < 3:
print 'Usage: %s <bundle.app> <path-to-qmake>' % sys.argv[0]
exit()
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
bundle_dir = sys.argv[1]
qmake_path = sys.argv[2]
bundle_name = os.path.basename(bundle_dir).split('.')[0]
commands = []
binary_dir = os.path.join(bundle_dir, 'Contents', 'MacOS')
frameworks_dir = os.path.join(bundle_dir, 'Contents', 'Frameworks')
commands.append(['mkdir', '-p', frameworks_dir])
resources_dir = os.path.join(bundle_dir, 'Contents', 'Resources')
commands.append(['mkdir', '-p', resources_dir])
plugins_dir = os.path.join(bundle_dir, 'Contents', 'PlugIns')
binaries = [i for i in glob(os.path.join(bundle_dir, 'Contents', 'MacOS', "*")) if is_exe(i)];
fixed_libraries = []
fixed_frameworks = []
def WriteQtConf():
print "Writing qt.conf..."
with open(os.path.join(resources_dir, 'qt.conf'), 'w') as f:
f.write("[Paths]\nPlugins = PlugIns\n");
f.close()
def GetBrokenLibraries(binary):
#print "Checking libs for binary: %s" % binary
output = subprocess.Popen(['otool', '-L', binary], stdout=subprocess.PIPE).communicate()[0]
broken_libs = {
'frameworks': [],
'libs': []}
for line in [x.split(' ')[0].lstrip() for x in output.split('\n')[1:]]:
#print "Checking line: %s" % line
if not line: # skip empty lines
continue
if os.path.basename(binary) == os.path.basename(line):
#print "mnope %s-%s" % (os.path.basename(binary), os.path.basename(line))
continue
if re.match(r'^\s*/System/', line):
continue # System framework
elif re.match(r'^\s*/usr/lib/', line):
#print "unix style system lib"
continue # unix style system library
elif re.match(r'Breakpad', line):
continue # Manually added by cmake.
elif re.match(r'^\s*@executable_path', line) or re.match(r'^\s*@loader_path', line):
# Potentially already fixed library
if '.framework' in line:
relative_path = os.path.join(*line.split('/')[3:])
if not os.path.exists(os.path.join(frameworks_dir, relative_path)):
broken_libs['frameworks'].append(relative_path)
else:
relative_path = os.path.join(*line.split('/')[1:])
#print "RELPATH %s %s" % (relative_path, os.path.join(binary_dir, relative_path))
if not os.path.exists(os.path.join(binary_dir, relative_path)):
broken_libs['libs'].append(relative_path)
elif re.search(r'\w+\.framework', line):
broken_libs['frameworks'].append(line)
else:
broken_libs['libs'].append(line)
return broken_libs
def FindFramework(path):
search_pathes = FRAMEWORK_SEARCH_PATH
search_pathes.insert(0, QueryQMake('QT_INSTALL_LIBS'))
for search_path in search_pathes:
abs_path = os.path.join(search_path, path)
if os.path.exists(abs_path):
return abs_path
raise CouldNotFindFrameworkError(path)
def FindLibrary(path):
if os.path.exists(path):
return path
search_pathes = LIBRARY_SEARCH_PATH
search_pathes.insert(0, QueryQMake('QT_INSTALL_LIBS'))
for search_path in search_pathes:
abs_path = os.path.join(search_path, path)
if os.path.exists(abs_path):
return abs_path
else: # try harder---look for lib name in library folders
newpath = os.path.join(search_path,os.path.basename(path))
if os.path.exists(newpath):
return newpath
return ""
#raise CouldNotFindFrameworkError(path)
def FixAllLibraries(broken_libs):
for framework in broken_libs['frameworks']:
FixFramework(framework)
for lib in broken_libs['libs']:
FixLibrary(lib)
def FixFramework(path):
if path in fixed_libraries:
return
else:
fixed_libraries.append(path)
abs_path = FindFramework(path)
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
new_path = CopyFramework(abs_path)
id = os.sep.join(new_path.split(os.sep)[3:])
FixFrameworkId(new_path, id)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, new_path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, new_path)
def FixLibrary(path):
if path in fixed_libraries or FindSystemLibrary(os.path.basename(path)) is not None:
return
else:
fixed_libraries.append(path)
abs_path = FindLibrary(path)
if abs_path == "":
print "Could not resolve %s, not fixing!" % path
return
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
new_path = CopyLibrary(abs_path)
FixLibraryId(new_path)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, new_path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, new_path)
def FixPlugin(abs_path, subdir):
broken_libs = GetBrokenLibraries(abs_path)
FixAllLibraries(broken_libs)
new_path = CopyPlugin(abs_path, subdir)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, new_path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, new_path)
def FixBinary(path):
broken_libs = GetBrokenLibraries(path)
FixAllLibraries(broken_libs)
for framework in broken_libs['frameworks']:
FixFrameworkInstallPath(framework, path)
for library in broken_libs['libs']:
FixLibraryInstallPath(library, path)
def CopyLibrary(path):
new_path = os.path.join(binary_dir, os.path.basename(path))
args = ['ditto', '--arch=x86_64', path, new_path]
commands.append(args)
args = ['chmod', 'u+w', new_path]
commands.append(args)
return new_path
def CopyPlugin(path, subdir):
new_path = os.path.join(plugins_dir, subdir, os.path.basename(path))
args = ['mkdir', '-p', os.path.dirname(new_path)]
commands.append(args)
args = ['ditto', '--arch=x86_64', path, new_path]
commands.append(args)
args = ['chmod', 'u+w', new_path]
commands.append(args)
return new_path
def CopyFramework(path):
parts = path.split(os.sep)
print "CopyFramework:", path
for i, part in enumerate(parts):
matchObj = re.match(r'(\w+\.framework)', part)
if matchObj:
full_path = os.path.join(frameworks_dir, *parts[i:-1])
framework = matchObj.group(1)
break
args = ['mkdir', '-p', full_path]
commands.append(args)
args = ['ditto', '--arch=x86_64', path, full_path]
commands.append(args)
args = ['chmod', 'u+w', os.path.join(full_path, parts[-1])]
commands.append(args)
args = ['chmod', 'u+w', os.path.join(frameworks_dir, framework, "Resources")]
commands.append(args)
info_plist = os.path.join(os.path.split(path)[0], '..', '..', 'Contents', 'Info.plist')
if os.path.exists(info_plist):
args = ['cp', '-r', info_plist, os.path.join(frameworks_dir, framework, "Resources")]
commands.append(args)
return os.path.join(full_path, parts[-1])
def FixId(path, library_name):
id = '@executable_path/../Frameworks/%s' % library_name
args = ['install_name_tool', '-id', id, path]
commands.append(args)
def FixLibraryId(path):
library_name = os.path.basename(path)
FixId(path, library_name)
def FixFrameworkId(path, id):
FixId(path, id)
def FixInstallPath(library_path, library, new_path):
args = ['install_name_tool', '-change', library_path, new_path, library]
commands.append(args)
def FindSystemLibrary(library_name):
for path in ['/lib', '/usr/lib']:
full_path = os.path.join(path, library_name)
if os.path.exists(full_path):
return full_path
return None
def FixLibraryInstallPath(library_path, library):
system_library = FindSystemLibrary(os.path.basename(library_path))
if system_library is None:
new_path = '@executable_path/../MacOS/%s' % os.path.basename(library_path)
FixInstallPath(library_path, library, new_path)
else:
FixInstallPath(library_path, library, system_library)
def FixFrameworkInstallPath(library_path, library):
parts = library_path.split(os.sep)
for i, part in enumerate(parts):
if re.match(r'\w+\.framework', part):
full_path = os.path.join(*parts[i:])
break
new_path = '@executable_path/../Frameworks/%s' % full_path
FixInstallPath(library_path, library, new_path)
def FindQtPlugin(name):
search_path = QT_PLUGINS_SEARCH_PATH
search_path.insert(0, QueryQMake('QT_INSTALL_PLUGINS'))
for path in search_path:
if os.path.exists(path):
if os.path.exists(os.path.join(path, name)):
return os.path.join(path, name)
raise CouldNotFindQtPluginError(name)
for binary in binaries:
FixBinary(binary)
for plugin in QT_PLUGINS:
FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin))
if len(sys.argv) <= 2:
print 'Will run %d commands:' % len(commands)
for command in commands:
print ' '.join(command)
for command in commands:
p = subprocess.Popen(command)
os.waitpid(p.pid, 0)
WriteQtConf()

1426
admin/osx/macosx.pkgproj Normal file

File diff suppressed because it is too large Load Diff

32
admin/osx/sign_app.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/sh -x
[ "$#" -lt 2 ] && echo "Usage: sign_app.sh <app> <identity>" && exit
src_app="$1"
identity="$2"
QT_FMWK_VERSION="5"
fix_frameworks() {
TMP_APP=$1
QT_FMWK_PATH=$2
QT_FMWKS=$3/Qt*.framework
echo "Patching Qt frameworks..."
for FMWK in $QT_FMWKS; do
FMWK_NAME=`basename -s .framework $FMWK`
FMWK=`basename $FMWK`
FMWK_PATH="${TMP_APP}/Contents/Frameworks/${FMWK}"
mkdir -p "${FMWK_PATH}/Versions/${QT_FMWK_VERSION}/Resources/"
cp -avf "${QT_FMWK_PATH}/${FMWK}/Contents/Info.plist" "${FMWK_PATH}/Versions/${QT_FMWK_VERSION}/Resources"
(cd "${FMWK_PATH}" && ln -sf "Versions/${QT_FMWK_VERSION}/Resources" "Resources")
perl -pi -e "s/${FMWK_NAME}_debug/${FMWK_NAME}/" "${FMWK_PATH}/Resources/Info.plist"
done
}
fix_frameworks "$src_app" `qmake -query QT_INSTALL_LIBS` "$src_app"/Contents/Frameworks
codesign -s "$identity" --force --verbose=4 --deep "$src_app"
# Just for our debug purposes:
spctl -a -t exec -vv $src_app
codesign -dv $src_app

19
admin/win/download_runtimes.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh -x
#VS2013
base_url=http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3
tmp_path=/tmp/.vcredist
mkdir -p $tmp_path
copy_cached_file() {
file=$1
if [ ! -e $tmp_path/$file ]; then
wget -O $tmp_path/$file $base_url/$file
fi
cp -a $tmp_path/$file $PWD
}
copy_cached_file "vcredist_x64.exe"
copy_cached_file "vcredist_x86.exe"

View File

@@ -1,12 +1,15 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Erakutsi bertsio-berritze oharrak"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "kill prozesua ez da aurkitu!"
StrCpy $PageReinstall_NEW_Field_2 "Desinstalatu instalatu baino lehen"
StrCpy $PageReinstall_NEW_Field_3 "Ez desinstalatu"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Dagoeneko Instalatuta"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Hautatu nola nahi duzun ${APPLICATION_NAME} instalatzea."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} dagoeneko instalatuta dago.\nHautatu zer operazio egin nahi duzu eta klikatu Hurrengoa jarraitzeko."
StrCpy $PageReinstall_SAME_Field_2 "Gehitu/Berrinstalatu osagaiak"
StrCpy $PageReinstall_SAME_Field_3 "Desinstalatu ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalatu ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Hautatu zer mantenu aukera egin nahi duzun."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Hasierako Menuko Lasterbidea"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Hasierako Menuan ${APPLICATION_NAME}rako Abiarazle bizkorra sortzen."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Mahaigaineko Lasterbidea"
@@ -29,14 +32,13 @@ StrCpy $INIT_INSTALLER_RUNNING "Instalatzailea dagoeneko martxan da."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Desinstalatzaile honek administratzaile baimenak behar ditu, saiatu berriro"
StrCpy $INIT_UNINSTALLER_RUNNING "Desinstalatzailea dagoeneko martxan da."
StrCpy $SectionGroup_Shortcuts "Lasterbideak"
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Show release notes"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"

View File

@@ -1,44 +1,46 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Mostrar les notes de versió"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "S'ha trobat el(s) procés ${APPLICATION_EXECUTABLE} que s'ha d'aturar.$\nVoleu que l'instal·lador l'aturi?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "S'estan matant els processos ${APPLICATION_EXECUTABLE}."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Procés per matar no trobat!"
StrCpy $PageReinstall_NEW_Field_1 "Una versió anterior de ${APPLICATION_NAME} està instal·lada en el vostre sistema. Es recomana desinstal·lar la versió actual abans d'instal·lar. Seleccioneu l'operació que desitjeu realitzar i feu clic a Següent per continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstal·lar abans d'instal·lar"
StrCpy $PageReinstall_NEW_Field_3 "No instal·lar"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Ja instal·lat"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Trieu la manera com voleu instal·lar ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "Una versió més recent de ${APPLICATION_NAME} ja està instal.lada!! No es recomana instal.lar una versió més antiga. Si realment voleu instal.lar una versió més antiga, és millor primer desinstal.lar la versió actual. Seleccioni l'operació que desitjeu realitzar i feu clic a Següent per a continuar."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} ja està instal.lat.↩\nSeleccioneu l'operació que desitjeu realitzar i feu clic a Següent per continuar."
StrCpy $PageReinstall_SAME_Field_2 "Afegir/Reinstal.lar components"
StrCpy $PageReinstall_SAME_Field_3 "Desinstal.lar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstal.lar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Escolliu l'opció de manteniment per executar-ho."
StrCpy $SEC_APPLICATION_DETAILS "Instal·lant ${APPLICATION_NAME} essencial."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Accés directe del programa al menú d'inici"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Afegint la drecera per ${APPLICATION_NAME} al menú d'inici."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Drecera a l'escriptori"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creant les dreceres a l'escriptori"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Drecera d'inici ràpid"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creant la drecera per l'inici ràpid"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essencial."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "Drecera ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Drecera a l'escrptori per ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Drecera d'inici ràpid per ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Esborra la carpeta de dades de ${APPLICATION_NAME} del vostre equip."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Voleu esborrar la carpeta de dades de ${APPLICATION_NAME}?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Deixeu-ho sense marcar per mantenir la carpeta de dades per un ús posterior o marqueu-ho per esborrar la carpeta de dades."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Sí, esborra la carpeta de dades."
StrCpy $UNINSTALLER_FILE_Detail "Escrivint el desinstal·lador"
StrCpy $UNINSTALLER_REGISTRY_Detail "Escrivint les claus del registre de l'instal·lador"
StrCpy $UNINSTALLER_FINISHED_Detail "Acabat"
StrCpy $UNINSTALL_MESSAGEBOX "No sembla que ${APPLICATION_NAME} estigui instal·lat en la carpeta '$INSTDIR'.$\n$\nContinuo igualment (no recomanat)?"
StrCpy $UNINSTALL_ABORT "La desinstal·lació s'ha cancel·lat."
StrCpy $INIT_NO_QUICK_LAUNCH "Drecera d'inici ràpid (N/A)"
StrCpy $INIT_NO_DESKTOP "Drecera de l'escrpitori (sobreescriu l'existent)"
StrCpy $UAC_ERROR_ELEVATE "No es pot elevar, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Aquest instal·lador requereix accés d'administrador, intenteu-ho de nou"
StrCpy $INIT_INSTALLER_RUNNING "L'instal·lador ja s'està executant."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Aquest desinstal·lador requereix accés d'administrador, intenteu-ho de nou."
StrCpy $INIT_UNINSTALLER_RUNNING "El desinstal·lador ja s'està executant."
StrCpy $SectionGroup_Shortcuts "Dreceres"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $PageReinstall_SAME_Field_3 "Uninstall ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Uninstall ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop Shortcut"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Creating Desktop Shortcuts"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Yes, delete this data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $INIT_NO_DESKTOP "Desktop Shortcut (overwrites existing)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odinstalovat ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinstalovat ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Vyberte možnost údržby k provedení."
StrCpy $SEC_APPLICATION_DETAILS "Instalují se náležitosti ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Stavová ikona pro Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Instaluji stavovou ikonu pro Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Zástupce v Nabídce Start"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Přidávám zástupce pro ${APPLICATION_NAME} do Nabídky Start."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Zástupce na ploše"

View File

@@ -6,7 +6,7 @@ StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Het te stoppen proces is niet gev
StrCpy $PageReinstall_NEW_Field_1 "Er is een oudere versie van ${APPLICATION_NAME} geïnstalleerd op uw systeem. geadviseerd wordt om de huidige versie te de-installeren voordat de nieuwe versie wordt geïnstalleerd. Selecteer de uit te voeren actie en klik op Verder om door te gaan."
StrCpy $PageReinstall_NEW_Field_2 "De-installeren voor installeren"
StrCpy $PageReinstall_NEW_Field_3 "Niet de-installeren"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Reeds geinstalleerd"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Al geïnstalleerd"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Kies hoe u ${APPLICATION_NAME} wilt installeren."
StrCpy $PageReinstall_OLD_Field_1 "Er is al een recentere versie van ${APPLICATION_NAME} geïnstalleerd! Installeren van een oudere versie wordt niet aangeraden. Als u echt de oudere versie wilt installeren, adviseren we de huidige versie eerst te verwijderen. Kies de actie die u wilt uitvoeren en druk op Verder om door te gaan."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is al geïnstalleerd.\nKies de actie die u wilt uitvoeren en druk op Verder om door te gaan."
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "De-installeer ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "De-installeer ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Kies de uit te voeren onderhoudsoptie."
StrCpy $SEC_APPLICATION_DETAILS "Installeren ${APPLICATION_NAME} basis."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Statuspictogrammen voor Windows Verkenner"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installeren statuspictogrammen voor Windows Verkenner"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Startmenu snelkoppeling"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Toevoegen snelkoppeling voor ${APPLICATION_NAME} aan het Startmenu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Werkblad snelkoppeling"
@@ -27,7 +29,7 @@ StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Werkblad snelkoppeling voor ${APPLICATIO
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Snelstart snelkoppeling voor ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Verwijder ${APPLICATION_NAME}'s data map van uw computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Wilt u de ${APPLICATION_NAME}'s data map verwijderen?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Niet aankruisen om de datamap te bewaren of aankruisen om de datamap te verwijderen."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Niet aankruisen om de datamap te bewaren, wel aankruisen om de datamap te verwijderen."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Ja, verwijder deze data map."
StrCpy $UNINSTALLER_FILE_Detail "Wegschrijven Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Wegschrijven installer Registersleutels"
@@ -35,10 +37,10 @@ StrCpy $UNINSTALLER_FINISHED_Detail "Klaar"
StrCpy $UNINSTALL_MESSAGEBOX "Het lijkt er niet op dat ${APPLICATION_NAME} is geïnstalleerd in de map '$INSTDIR'.$\n$\nToch doorgaan (niet aangeraden)?"
StrCpy $UNINSTALL_ABORT "De-installatie afgebroken door de gebruiker"
StrCpy $INIT_NO_QUICK_LAUNCH "Snelstart snelkoppeling (N/A)"
StrCpy $INIT_NO_DESKTOP "Desktop snelkoppeleng (overschrijft huidige)"
StrCpy $INIT_NO_DESKTOP "Bureaublad snelkoppeling (overschrijft huidige)"
StrCpy $UAC_ERROR_ELEVATE "Kan niet verhogen, fout:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Dit installatieprogramma vereist administrator rechten. Probeer het opnieuw"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Dit installatieprogramma vereist beheerdersrechten. Probeer het opnieuw"
StrCpy $INIT_INSTALLER_RUNNING "De Installer is al gestart."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Deze uninstaller vereist administrator toegang, probeer opnieuw"
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Deze uninstaller vereist Beheerderstoegang, probeer opnieuw"
StrCpy $INIT_UNINSTALLER_RUNNING "De uninstaller is al gestart."
StrCpy $SectionGroup_Shortcuts "Snelkoppelingen"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Uninstall ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Uninstall ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop Shortcut"

View File

@@ -42,3 +42,5 @@ StrCpy $INIT_INSTALLER_RUNNING "Paigaldaja on juba k
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "See desinstallija vajab admini ligipääsu, proovi uuesti"
StrCpy $INIT_UNINSTALLER_RUNNING "See desinstallija on juba käimas"
StrCpy $SectionGroup_Shortcuts "Viidad"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"

View File

@@ -0,0 +1,46 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "نمایش پادداشت های انتشار نسخه"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "پردازش برای از بین بردن یافت نشد!"
StrCpy $PageReinstall_NEW_Field_3 "حذف نکن"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "از قبل نصب شده است"
StrCpy $PageReinstall_SAME_Field_2 "افزودن/نصب مجدد اجزا"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "میانبر دسکتاپ"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "ایجاد میانبر دسکتاپ"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "میانبر بازکردن سریع"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "بله، این پوشه داده را حذف کن."
StrCpy $UNINSTALLER_FILE_Detail "نوشتن حذف کننده"
StrCpy $UNINSTALLER_FINISHED_Detail "اتمام"
StrCpy $INIT_INSTALLER_RUNNING "نصاب از قبل در حال اجراست."
StrCpy $INIT_UNINSTALLER_RUNNING "حذف کننده از قبل در حال اجراست."
StrCpy $SectionGroup_Shortcuts "میانبرها"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_NEW_Field_2 "Uninstall before installing"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Choose how you want to install ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_3 "Uninstall ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Uninstall ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME} shortcut."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Desktop shortcut for ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Quick Launch shortcut for ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $INIT_NO_DESKTOP "Desktop Shortcut (overwrites existing)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"

View File

@@ -1,28 +1,39 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Näytä julkaisutiedot"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Havaittiin sovelluksen ${APPLICATION_EXECUTABLE} prosessi (tai prosesseja) jotka pitäisi pysäyttää.\nHaluatko että asennusohjelma pysäyttää nämä puolestasi?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Pysäytetään sovelluksen ${APPLICATION_EXECUTABLE} prosessit."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Tapettavaa prosessia ei löytynyt!"
StrCpy $PageReinstall_NEW_Field_1 "Vanhempi versio sovelluksesta ${APPLICATION_NAME} on jo asennettu. On suositeltavaa että poistat vanhan asennuksen ensin. Valitse mikä toiminto suoritetaan ja napsauta Seuraava jatkaaksesi."
StrCpy $PageReinstall_NEW_Field_2 "Poista ennen asentamista"
StrCpy $PageReinstall_NEW_Field_3 "Älä poista"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Asennettu jo"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Valitse miten ${APPLICATION_NAME} asennetaan."
StrCpy $PageReinstall_OLD_Field_1 "Uudempi versio sovelluksesta ${APPLICATION_NAME} on jo asennettu! Vanhan version asennus ei ole suositeltavaa. Jos todella haluat asentaa vanhemman version, kannattaa poistaa nykyisen version asennus ensin. Valitse minkä toimenpiteen haluat suorittaa ja paina Seuraava jatkaaksesi."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} on jo asennettu.\nValitse suoritettava toimenpide ja napsauta Seuraava jatkaaksesi."
StrCpy $PageReinstall_SAME_Field_2 "Lisää/uudelleenasenna komponentteja"
StrCpy $PageReinstall_SAME_Field_3 "Poista ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Poista ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Valitse suoritettava huoltotoimenpide."
StrCpy $SEC_APPLICATION_DETAILS "Asennetaan sovelluksen ${APPLICATION_NAME} välttämättömyyksiä."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Tilakuvakkeet Windows Explorerille"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Asennetaan tilakuvakkeet Windows Explorerille"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Käynnistä-valikon pikakuvake"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Lisätään ${APPLICATION_NAME}-pikakuvake Käynnistä-valikkoon."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Työpöydän pikakuvake"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Luodaan työpöydän pikakuvakkeet"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Pikakäynnistyksen pikakuvake"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Luodaan pikakuvaketta pikakäynnistykseen"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} välttämättömyydet."
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME}-pikakuvake."
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "Sovelluksen ${APPLICATION_NAME} työpyötäpikakuvake."
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "Pikakäynnistyksen pikakuvake sovellukselle ${APPLICATION_NAME}."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Poista ${APPLICATION_NAME}-datakansio tietokoneelta."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Haluatko varmasti poistaa ${APPLICATION_NAME}-datakansion?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Jätä valinta ruksimatta säilyttääksesti datakansion myöhempää käyttöä varten tai täytä ruksi jos haluat poistaa datakansion ja siinä olevat tiedostot."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Kyllä, poista tämä datakansio."
StrCpy $UNINSTALLER_REGISTRY_Detail "Kirjoitetaan asennusohjelman rekisteriavaimia"
StrCpy $UNINSTALLER_FINISHED_Detail "Valmis"
StrCpy $UNINSTALL_MESSAGEBOX "Vaikuttaa siltä että sovellus ${APPLICATION_NAME} on asennettu kansioon '$INSTDIR'.\n\nHaluatko jatkaa tästä huolimatta (ei suositeltavaa)?"
StrCpy $UNINSTALL_ABORT "Poistaminen keskeytettiin käyttäjän toimesta"
StrCpy $INIT_NO_DESKTOP "Työpöydän pikakuvake (korvaa nykyinen)"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Tämä asennusohjelma vaatii ylläpitäjän oikeudet, yritä uudelleen."
@@ -30,15 +41,6 @@ StrCpy $INIT_INSTALLER_RUNNING "Asennusohjelma on jo k
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Tämä poisto-ohjelma vaatii ylläpitäjän oikeudet, yritä uudelleen."
StrCpy $INIT_UNINSTALLER_RUNNING "Poisto-ohjelma on jo käynnissä."
StrCpy $SectionGroup_Shortcuts "Pikakuvakkeet"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $PageReinstall_NEW_Field_1 "An older version of ${APPLICATION_NAME} is installed on your system. It is recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_2 "Add/Reinstall components"
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"

View File

@@ -42,3 +42,5 @@ StrCpy $INIT_INSTALLER_RUNNING "Une installation est déjà en cours."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Ce désinstallateur requiert les droits administrateur, essayez à nouveau"
StrCpy $INIT_UNINSTALLER_RUNNING "Une désinstallation est déjà en cours."
StrCpy $SectionGroup_Shortcuts "Raccourcis"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Escolla a opción de mantemento a realizar."
StrCpy $SEC_APPLICATION_DETAILS "Instalando ${APPLICATION_NAME} esenciais."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Iconas de estado para Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Instalando as iconas de estado para Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Acceso directo ao programa no menú de inicio"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Engadindo o acceso directo ao ${APPLICATION_NAME} no menú de inicio"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Acceso directo no escritorio"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} entfernen"
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} entfernen"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Wählen Sie zur Ausführung die Wartungsoption."
StrCpy $SEC_APPLICATION_DETAILS "Installiere ${APPLICATION_NAME} Basis."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status-Icons für den Windows-Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installiere Status-Icons für den Windows-Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Installiere Verknüpfung im Programmmenü"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Füge Verknüpfung für ${APPLICATION_NAME} dem Startmenü hinzu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop-Verknüpfung"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "
StrCpy $UNINSTALLER_APPDATA_TITLE "Απεγκατάσταση ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Επιλέξτε την επιλογή συντήρησης που θα πραγματοποιηθεί."
StrCpy $SEC_APPLICATION_DETAILS "Εγκατάσταση βάσης ${APPLICATION_NAME} σε εξέλιξη."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Εικονίδια κατάστασης για την Εξερεύνηση των Windows"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Εγκατάσταση εικονιδίων κατάστασης στην Εξερεύνηση των Windows"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Συντόμευση στο Αρχικό Μενού"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Προσθήκη συντόμευσης για την ${APPLICATION_NAME} στο Αρχικό Μενού."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Συντόμευση επιφάνειας εργασίας"

View File

@@ -9,6 +9,13 @@ StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} eltávolítása"
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} eltávolítása"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Igen, törölje ezt az adatkönyvtárat."
StrCpy $UNINSTALLER_FINISHED_Detail "Befejezve"
StrCpy $UNINSTALL_ABORT "Az eltávolítást egy felhasználó megszakította"
StrCpy $INIT_NO_QUICK_LAUNCH "Gyorsindító Hivatkozás (N/A)"
StrCpy $INIT_NO_DESKTOP "Asztali Hivatkozás (felülírja a meglévőt)"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "A telepítő futtatásához adminisztrátori hozzáférés szükséges, próbáld újra."
StrCpy $INIT_INSTALLER_RUNNING "A telepítő már fut."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "Az eltávolító futtatásához adminisztrátori hozzáférés szükséges, próbáld újra."
StrCpy $INIT_UNINSTALLER_RUNNING "Az eltávolító már fut."
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Killing ${APPLICATION_EXECUTABLE} processes."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Process to kill not found!"
@@ -17,6 +24,8 @@ StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is alr
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $SEC_APPLICATION_DETAILS "Installing ${APPLICATION_NAME} essentials."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start Menu Program Shortcut"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Desktop Shortcut"
@@ -33,12 +42,5 @@ StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for
StrCpy $UNINSTALLER_FILE_Detail "Writing Uninstaller"
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $INIT_NO_QUICK_LAUNCH "Quick Launch Shortcut (N/A)"
StrCpy $INIT_NO_DESKTOP "Desktop Shortcut (overwrites existing)"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $SectionGroup_Shortcuts "Shortcuts"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Disinstalla ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Disinstalla ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Scegli l'opzione di manutenzione da eseguire."
StrCpy $SEC_APPLICATION_DETAILS "Installazione degli elementi fondamentali di ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Icone di stato per Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installazione delle icone di stato per Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Scorciatoia di programma menu Start"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Aggiunta della scorciatoia per ${APPLICATION_NAME} al menu Start."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Scorciatoia del desktop"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME}
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} をアンインストール"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "実行するには、メンテナンスオプションを選択してください。"
StrCpy $SEC_APPLICATION_DETAILS "${APPLICATION_NAME} の重要なパッケージをインストール中"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Windowsエクスプローラの状態アイコン"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Windowsエクスプローラの状態アイコンをインストール中"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "スタートメニューショートカット"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "スタートメニューに${APPLICATION_NAME} のショートカットの追加"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "デスクトップショートカット"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odinstaluj ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinstaluj ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Wybierz sposób utrzymywania."
StrCpy $SEC_APPLICATION_DETAILS "Instaluje niezbędne pliki ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Ikona statusu dla Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Instaluj ikonę statusu dla Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Skrót w Menu Start"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Dodaję skrót ${APPLICATION_NAME} w Menu Start."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Skrót na Pulpicie"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Escolha a opção de manutenção a fazer."
StrCpy $SEC_APPLICATION_DETAILS "A instalar o essencial de ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Icons de estado para Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "A instalar icons de estado para Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Atalho do progama no Menu Inicial"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "A adicionar o atalho de ${APPLICATION_NAME} ao Menu Inicial."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Atalho da área de trabalho"

View File

@@ -6,7 +6,7 @@ StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Processo para eliminar n
StrCpy $PageReinstall_NEW_Field_1 "Uma versão mais antiga de ${APPLICATION_NAME} está instalado em seu sistema. É recomendado que você desinstale a versão atual antes de instalar. Selecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_NEW_Field_2 "Desinstalar antes de instalar"
StrCpy $PageReinstall_NEW_Field_3 "Não desinstale"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "instalado"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Instalado"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "Escolha como você deseja instalar ${APPLICATION_NAME}."
StrCpy $PageReinstall_OLD_Field_1 "A versão mais recente do ${APPLICATION_NAME} já está instalado! Não é recomendado que você instale uma versão mais antiga. Se você realmente deseja instalar esta versão mais antiga, é melhor desinstalar a versão atual primeiro. Selecione a operação que deseja executar e clique em Avançar para continuar."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${version} já está instalado. \nSelecione a operação que deseja executar e clique em Avançar para continuar."
@@ -15,8 +15,10 @@ StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Escolha a opção de realizar manutenção."
StrCpy $SEC_APPLICATION_DETAILS "Instalando ${APPLICATION_NAME} fundamentos."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Ícones de status para Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Instalando os ícones de status para o Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Menu Iniciar Programa Atalho"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adicionando atalho para ${APPLICATION_NAME} para o Menu Iniciar."
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adicionando atalho para ${APPLICATION_NAME} ao Menu Iniciar."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Atalho Desktop"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "Criando Atalhos de Desktop"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Atalho Rápido"
@@ -29,13 +31,13 @@ StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remover ${APPLICATION_NAME} pasta de dado
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Você quer apagar ${APPLICATION_NAME} 's pasta de dados?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Deixe desmarcada para manter a pasta de dados para uso posterior ou cheque para excluir a pasta de dados."
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "Sim, excluir essa pasta de dados."
StrCpy $UNINSTALLER_FILE_Detail "Escrevendo Desinstalador"
StrCpy $UNINSTALLER_REGISTRY_Detail "Escrevendo Chaves de Registro do Inslalador"
StrCpy $UNINSTALLER_FILE_Detail "Gravando Desinstalador"
StrCpy $UNINSTALLER_REGISTRY_Detail "Gravando Chaves de Registro do Inslalador"
StrCpy $UNINSTALLER_FINISHED_Detail "Finalizado"
StrCpy $UNINSTALL_MESSAGEBOX "Não parece que ${APPLICATION_NAME} está instalado no diretório '$INSTDIR'.$\n$\nContinuar assim mesmo (não recomendado)?"
StrCpy $UNINSTALL_ABORT "Desinstalação abortada pelo usuário"
StrCpy $INIT_NO_QUICK_LAUNCH "Atalho de Inicialização Rápida (N/A)"
StrCpy $INIT_NO_DESKTOP "Atalho Desktop (substituições existente)"
StrCpy $INIT_NO_DESKTOP "Atalho Desktop (substitui os existente)"
StrCpy $UAC_ERROR_ELEVATE "Incapaz de elevar, erro:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "Este programa de instalação requer acesso de administrador, tente novamente"
StrCpy $INIT_INSTALLER_RUNNING "O instalador já está em execução."

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Удалить ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Удалить ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Выберите опцию обслуживания для исполнения."
StrCpy $SEC_APPLICATION_DETAILS "Установка зависимостей приложения ${APPLICATION_NAME}"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Значки статуса для проводника Windows"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Установка значков статуса для проводника Windows"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Ярлык в меню Пуск"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Добавление ярлыка ${APPLICATION_NAME} в меню Пуск"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Ярлык на рабочем столе"

View File

@@ -1,5 +1,6 @@
# Auto-generated - do not modify
StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "查看版本日志"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "有 ${APPLICATION_EXECUTABLE} 项进程需要关闭。$\n您想让安装程序关闭这些进程吗"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "杀死${APPLICATION_EXECUTABLE}进程。"
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "未找到要杀死的进程!"
StrCpy $PageReinstall_NEW_Field_1 "您的系统已经安装${APPLICATION_NAME}较老版本。建议安装前卸载当前版本。选择将要执行的操作,点击下一步继续。"
@@ -7,11 +8,15 @@ StrCpy $PageReinstall_NEW_Field_2 "在安装前先卸载"
StrCpy $PageReinstall_NEW_Field_3 "不要卸载"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "已经安装"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_SUBTITLE "选择如何安装${APPLICATION_NAME}。"
StrCpy $PageReinstall_SAME_Field_2 "添加/重装组件"
StrCpy $PageReinstall_OLD_Field_1 "较新版本的 ${APPLICATION_NAME} 已经安装!安装较旧版本的程序是不推荐的。如果您希望继续安装较旧版本,建议先卸载较新版本。选择您想要执行的操作并点击下一步以继续。"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} 已经安装。\n请选择想要执行的操作并点击下一步。"
StrCpy $PageReinstall_SAME_Field_2 "增加/重装组件"
StrCpy $PageReinstall_SAME_Field_3 "卸载${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "卸载${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "选择需要执行的维护选项。"
StrCpy $SEC_APPLICATION_DETAILS "安装${APPLICATION_NAME}基本组件。"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "开始菜单程序快捷方式"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "添加 ${APPLICATION_NAME} 快捷方式到开始菜单。"
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "桌面快捷方式"
StrCpy $OPTION_SECTION_SC_DESKTOP_DetailPrint "创建桌面快捷方式"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "快速启动栏快捷方式"
@@ -20,25 +25,22 @@ StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME}基本组件。"
StrCpy $OPTION_SECTION_SC_START_MENU_Desc "${APPLICATION_NAME}快捷方式。"
StrCpy $OPTION_SECTION_SC_DESKTOP_Desc "${APPLICATION_NAME}桌面快捷方式。"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_Desc "${APPLICATION_NAME}快速启动栏快捷方式。"
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "从电脑中移除 ${APPLICATION_NAME} 数据文件夹。"
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "移除 ${APPLICATION_NAME} 数据文件夹?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "选择以删除数据文件夹,不选择以保留数据文件夹内容供后续使用。"
StrCpy $UNINSTALLER_APPDATA_CHECKBOX "删除数据文件。"
StrCpy $UNINSTALLER_FILE_Detail "覆盖卸载器"
StrCpy $UNINSTALLER_REGISTRY_Detail "正在写入注册表"
StrCpy $UNINSTALLER_FINISHED_Detail "完成"
StrCpy $UNINSTALL_MESSAGEBOX "${APPLICATION_NAME} 可能并没有安装在 $INSTDIR。$\n$\n仍然继续吗(不推荐)"
StrCpy $UNINSTALL_ABORT "用户取消了卸载"
StrCpy $INIT_NO_QUICK_LAUNCH "快速启动栏快捷方式(N/A)"
StrCpy $INIT_NO_DESKTOP "桌面快捷方式(覆盖)"
StrCpy $UAC_ERROR_ELEVATE "无法获得权限,错误:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "安装程序需要管理员权限,请重试"
StrCpy $INIT_INSTALLER_RUNNING "安装程序已经运行。"
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "卸载程序需要管理员权限,请重试"
StrCpy $INIT_UNINSTALLER_RUNNING "卸载程序已经运行。"
StrCpy $SectionGroup_Shortcuts "快捷方式"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $PageReinstall_OLD_Field_1 "A newer version of ${APPLICATION_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it is better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Choose the maintenance option to perform."
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Adding shortcut for ${APPLICATION_NAME} to the Start Menu."
StrCpy $UNINSTALLER_APPDATA_SUBTITLE "Remove ${APPLICATION_NAME}'s data folder from your computer."
StrCpy $UNINSTALLER_APPDATA_LABEL_1 "Do you want to delete ${APPLICATION_NAME}'s data folder?"
StrCpy $UNINSTALLER_APPDATA_LABEL_2 "Leave unchecked to keep the data folder for later use or check to delete the data folder."
StrCpy $UNINSTALLER_REGISTRY_Detail "Writing Installer Registry Keys"
StrCpy $UNINSTALL_MESSAGEBOX "It does not appear that ${APPLICATION_NAME} is installed in the directory '$INSTDIR'.$\r$\nContinue anyway (not recommended)?"
StrCpy $UNINSTALL_ABORT "Uninstall aborted by user"
StrCpy $UAC_ERROR_ELEVATE "Unable to elevate, error:"
StrCpy $UAC_INSTALLER_REQUIRE_ADMIN "This installer requires admin access, try again"
StrCpy $INIT_INSTALLER_RUNNING "The installer is already running."
StrCpy $UAC_UNINSTALLER_REQUIRE_ADMIN "This uninstaller requires admin access, try again"
StrCpy $INIT_UNINSTALLER_RUNNING "The uninstaller is already running."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"

View File

@@ -3,7 +3,7 @@ StrCpy $MUI_FINISHPAGE_SHOWREADME_TEXT_STRING "Zobrazi
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Našli sa ${APPLICATION_EXECUTABLE} proces (y), ktoré je potrebné zastavi<76>.$\nChcete, aby ich inštalátor zastavil?"
StrCpy $ConfirmEndProcess_KILLING_PROCESSES_TEXT "Ukonèujem ${APPLICATION_EXECUTABLE} procesy."
StrCpy $ConfirmEndProcess_KILL_NOT_FOUND_TEXT "Proces ukonèenia nebol nájdený!"
StrCpy $PageReinstall_NEW_Field_1 "Staršia verzia ${APPLICATION_NAME} je nainštalovaná vo vašom systéme. Odporúèam vám odinštalova<76> aktuálnu verziu pred inštaláciou. Vyberte operáciu, ktorú chcete vykona<6E>, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_NEW_Field_1 "Staršia verzia ${APPLICATION_NAME} je nainštalovaná vo vašom poèítaèi. Odporúèam vám odinštalova<76> aktuálnu verziu pred inštaláciou. Vyberte operáciu, ktorú chcete vykona<6E>, a kliknite na tlaèidlo Ïalej pre pokraèovanie."
StrCpy $PageReinstall_NEW_Field_2 "Odinštalova<EFBFBD> pred inštaláciou"
StrCpy $PageReinstall_NEW_Field_3 "Neodinštalova<EFBFBD>"
StrCpy $PageReinstall_NEW_MUI_HEADER_TEXT_TITLE "Už je nainštalovaný"
@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odin
StrCpy $UNINSTALLER_APPDATA_TITLE "Odinštalova<EFBFBD> ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Vyberte možnos<6F> vykona<6E> údržbu."
StrCpy $SEC_APPLICATION_DETAILS "Inštalujú sa náležitosti ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Stavová ikona pre Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Inštalujem stavovú ikonu pre Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Zástupca programu v menu Štart"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Prida<EFBFBD> zástupcu pre ${APPLICATION_NAME} do menu Štart."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Zástupca na ploche"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Odstrani ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Odstrani ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Izberite možnost vzdrževanja za izvedbo."
StrCpy $SEC_APPLICATION_DETAILS "Poteka nameščanje ključnih paketov programa ${APPLICATION_NAME}."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Ikona stanja za program Raziskovalec"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Nameščanje ikone stanja za Raziskovalca"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Bližnjica programa v programskem meniju"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Poteka dodajanje bližnjice programa ${APPLICATION_NAME} v programski meni."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Bližnica namizja"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Desinstalar ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Desinstalar ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Elija la opcion de mantenimiento a realizar."
StrCpy $SEC_APPLICATION_DETAILS "Instalando ${APPLICATION_NAME} esenciales."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Íconos de estado para el Explorador de Windows"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Instalando íconos de estado para el Explorador de Windows"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Acceso Directo al Programa Menú de Inicio"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Añadiendo accesos directos para ${APPLICATION_NAME} en el Menú de Inicio."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Acceso directo de Escritorio"

View File

@@ -35,6 +35,8 @@ StrCpy $INIT_UNINSTALLER_RUNNING "El des-instalador ya esta corriendo"
StrCpy $SectionGroup_Shortcuts "Accesos Directos"
StrCpy $ConfirmEndProcess_MESSAGEBOX_TEXT "Found ${APPLICATION_EXECUTABLE} process(s) which need to be stopped.$\nDo you want the installer to stop these for you?"
StrCpy $PageReinstall_SAME_Field_1 "${APPLICATION_NAME} ${VERSION} is already installed.\r\nSelect the operation you want to perform and click Next to continue."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installing status icons for Windows Explorer"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_SECTION "Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_QUICK_LAUNCH_DetailPrint "Creating Quick Launch Shortcut"
StrCpy $OPTION_SECTION_SC_APPLICATION_Desc "${APPLICATION_NAME} essentials."

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "Avinstallera ${APPLICATION_NAME}"
StrCpy $UNINSTALLER_APPDATA_TITLE "Avinstallera ${APPLICATION_NAME}"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Välj underhålls alternativ att utföra."
StrCpy $SEC_APPLICATION_DETAILS "Installerar ${APPLICATION_NAME} väsentligheter."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Statusikoner för Windows Explorer"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Installerar statusikoner för Windows Explorer"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Start-meny program genväg"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "Lägger till genväg för ${APPLICATION_NAME} till Start-menyn."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Skrivbordsgenväg"

View File

@@ -15,6 +15,8 @@ StrCpy $PageReinstall_SAME_Field_3 "${APPLICATION_NAME} uygulamas
StrCpy $UNINSTALLER_APPDATA_TITLE "${APPLICATION_NAME} uygulamasını kaldır"
StrCpy $PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE "Yapmak istediğiniz bakım işlemini seçin."
StrCpy $SEC_APPLICATION_DETAILS "${APPLICATION_NAME} gereklilikleri yükleniyor."
StrCpy $OPTION_SECTION_SC_SHELL_EXT_SECTION "Windows Gezgini için durum simgeleri"
StrCpy $OPTION_SECTION_SC_SHELL_EXT_DetailPrint "Windows Gezgini için durum simgeleri yükleniyor"
StrCpy $OPTION_SECTION_SC_START_MENU_SECTION "Başlat Menüsü Program Kısayolu"
StrCpy $OPTION_SECTION_SC_START_MENU_DetailPrint "${APPLICATION_NAME} için Başlat Menüsü'ne kısayol ekleniyor."
StrCpy $OPTION_SECTION_SC_DESKTOP_SECTION "Masaüstü Kısayolu"

View File

@@ -15,6 +15,8 @@ Var PageReinstall_SAME_Field_3
Var UNINSTALLER_APPDATA_TITLE
Var PageReinstall_SAME_MUI_HEADER_TEXT_SUBTITLE
Var SEC_APPLICATION_DETAILS
Var OPTION_SECTION_SC_SHELL_EXT_SECTION
Var OPTION_SECTION_SC_SHELL_EXT_DetailPrint
Var OPTION_SECTION_SC_START_MENU_SECTION
Var OPTION_SECTION_SC_START_MENU_DetailPrint
Var OPTION_SECTION_SC_DESKTOP_SECTION

View File

@@ -23,3 +23,4 @@
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Farsi"

View File

@@ -85,6 +85,14 @@ msgstr "Choose the maintenance option to perform."
msgid "Installing ${APPLICATION_NAME} essentials."
msgstr "Installing ${APPLICATION_NAME} essentials."
#. OPTION_SECTION_SC_SHELL_EXT_SECTION
msgid "Status icons for Windows Explorer"
msgstr "Status icons for Windows Explorer"
#. OPTION_SECTION_SC_SHELL_EXT_DetailPrint
msgid "Installing status icons for Windows Explorer"
msgstr "Installing status icons for Windows Explorer"
#. OPTION_SECTION_SC_START_MENU_SECTION
msgid "Start Menu Program Shortcut"
msgstr "Start Menu Program Shortcut"

1
binary Submodule

Submodule binary added at 151fc83a05

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# Always include srcdir and builddir in include path
# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
# about every subdir

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# define system dependent compiler flags
include(CheckCCompilerFlag)
@@ -10,10 +14,11 @@ if (${CMAKE_C_COMPILER_ID} MATCHES "(GNU|Clang)")
# add -Wconversion ?
# cannot be pedantic with sqlite3 directly linked
if (NOT CSYNC_STATIC_COMPILE_DIR)
# FIXME Can we somehow not use those flags for sqlite3.* but use them for the rest of csync?
if (NOT USE_OUR_OWN_SQLITE3)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -pedantic-errors")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -D_GNU_SOURCE")

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
if (UNIX)
# Suffix for Linux
SET(LIB_SUFFIX

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# Set system vars
if (CMAKE_SYSTEM_NAME MATCHES "Linux")

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# This module defines
# INOTIFY_INCLUDE_DIR, where to find inotify.h, etc.
# INOTIFY_FOUND, If false, do not try to use inotify.

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# FIND_PACKAGE_VERSION_CHECK(NAME (DEFAULT_MSG|"Custom failure message"))
# This function is intended to be used in FindXXX.cmake modules files.
# It handles NAME_FIND_VERSION and NAME_VERSION variables in a Module.

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex
HINTS
$ENV{PDFLATEX_DIR}

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# - Try to find QtKeychain
# Once done this will define
# QTKEYCHAIN_FOUND - System has QtKeychain

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# - Try to find QtKeychain
# Once done this will define
# QTKEYCHAIN_FOUND - System has QtKeychain

View File

@@ -50,8 +50,18 @@ if (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
set(SQLite3_VERSION _SQLITE3_VERSION)
endif (SQLite3_FIND_VERSION AND _SQLITE3_VERSION)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS)
if (APPLE OR WIN32)
set(USE_OUR_OWN_SQLITE3 TRUE)
set(SQLITE3_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/3rdparty/sqlite3)
set(SQLITE3_LIBRARIES "")
set(SQLITE3_SOURCE ${SQLITE3_INCLUDE_DIR}/sqlite3.c)
MESSAGE(STATUS "Using own sqlite3 from " ${SQLITE3_INCLUDE_DIR})
else()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS)
endif()
# show the SQLITE3_INCLUDE_DIRS and SQLITE3_LIBRARIES variables only in the advanced view
mark_as_advanced(SQLITE3_INCLUDE_DIRS SQLITE3_LIBRARIES)

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
find_program(SPHINX_EXECUTABLE NAMES sphinx-build
HINTS
$ENV{SPHINX_DIR}

View File

@@ -30,6 +30,8 @@
<string>(C) 2014 @APPLICATION_VENDOR@</string>
<key>SUShowReleaseNotes</key>
<false/>
<key>LSMinimumBundleVersion</key>
<string>10.7.0</string>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
</dict>

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# - macro_copy_file(_src _dst)
# Copies a file to ${_dst} only if ${_src} is different (newer) than ${_dst}
#

View File

@@ -16,6 +16,7 @@
!define OPTION_LICENSE_AGREEMENT
!endif
!define OPTION_UAC_PLUGIN_ENHANCED
!define OPTION_SECTION_SC_SHELL_EXT
!define OPTION_SECTION_SC_START_MENU
!define OPTION_SECTION_SC_DESKTOP
!define OPTION_SECTION_SC_QUICK_LAUNCH
@@ -94,6 +95,8 @@ ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
!include WordFunc.nsh ;Used by VersionCompare macro function.
!include FileFunc.nsh ;Used to read out parameters
!include UAC.nsh ;Used by the UAC elevation to install as user or admin.
!include Library.nsh ;Used by the COM registration for shell extensions
!include x64.nsh ;Used to determine the right arch for the shell extensions
;-----------------------------------------------------------------------------
; Memento selections stored in registry.
@@ -279,6 +282,16 @@ Function EnsureOwncloudShutdown
!insertmacro CheckAndConfirmEndProcess "${APPLICATION_EXECUTABLE}"
FunctionEnd
Function InstallRedistributables
${If} ${RunningX64}
ExecWait '"$OUTDIR\vcredist_x64.exe" /install /quiet'
${Else}
ExecWait '"$OUTDIR\vcredist_x86.exe" /install /quiet'
${EndIf}
Delete "$OUTDIR\vcredist_x86.exe"
Delete "$OUTDIR\vcredist_x64.exe"
FunctionEnd
##############################################################################
# #
# RE-INSTALLER FUNCTIONS #
@@ -370,14 +383,15 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
;Main executable & csync
File "${BUILD_PATH}\bin\${APPLICATION_EXECUTABLE}"
File "${BUILD_PATH}\bin\${APPLICATION_CMD_EXECUTABLE}"
File "${BUILD_PATH}\bin\socketapiclient.exe"
File "${BUILD_PATH}\src\lib${APPLICATION_SHORTNAME}sync.dll"
File "${BUILD_PATH}\csync\src\libocsync.dll"
File "${BUILD_PATH}\src\mirall_*.qm"
; Make sure only to copy qt, not qt_help, etc
File "${MING_SHARE}\qt5\translations\qt_??.qm"
File "${MING_SHARE}\qt5\translations\qt_??_??.qm"
File "${MING_SHARE}\qt5\translations\qtbase_*.qm"
File "${MING_SHARE}\qt5\translations\qtkeychain_*.qm"
SetOutPath "$INSTDIR\platforms"
@@ -422,7 +436,6 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${MING_BIN}\libjpeg-8.dll"
File "${MING_BIN}\libpcre16-0.dll"
File "${MING_BIN}\libproxy.dll"
File "${MING_BIN}\libqt5keychain.dll"
File "${MING_BIN}\libsqlite3-0.dll"
File "${MING_BIN}\libcrypto-10.dll"
File "${MING_BIN}\libssl-10.dll"
@@ -435,9 +448,9 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${MING_BIN}\libsqlite3-0.dll"
;QtKeyChain stuff
File "${MING_BIN}\libqtkeychain.dll"
File "${MING_BIN}\libqt5keychain.dll"
; ownCloud plugin
;ownCloud plugin
File "${MING_BIN}\libintl-8.dll"
File "${MING_BIN}\libneon-27.dll"
File "${MING_BIN}\libproxy.dll"
@@ -449,11 +462,32 @@ Section "${APPLICATION_NAME}" SEC_APPLICATION
File "${MING_BIN}\libstdc++-6.dll"
File "${MING_BIN}\libwinpthread-1.dll"
; CSync configs
;CSync configs
File "${SOURCE_PATH}/sync-exclude.lst"
SectionEnd
!ifdef OPTION_SECTION_SC_SHELL_EXT
${MementoSection} $OPTION_SECTION_SC_SHELL_EXT_SECTION SEC_SHELL_EXT
SectionIn 1 2
SetDetailsPrint textonly
DetailPrint $OPTION_SECTION_SC_SHELL_EXT_DetailPrint
File "${BUILD_PATH}\vcredist_x86.exe"
File "${BUILD_PATH}\vcredist_x64.exe"
Call InstallRedistributables
CreateDirectory "$INSTDIR\shellext"
${If} ${RunningX64}
!define LIBRARY_X64
!insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCUtil_x64.dll" "$INSTDIR\shellext\OCUtil_x64.dll" "$INSTDIR\shellext"
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\x64\OCOverlays_x64.dll" "$INSTDIR\shellext\OCOverlays_x64.dll" "$INSTDIR\shellext"
!undef LIBRARY_X64
${Else}
!insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCUtil_x86.dll" "$INSTDIR\shellext\OCUtil_x86.dll" "$INSTDIR\shellext"
!insertmacro InstallLib REGDLL NOTSHARED REBOOT_PROTECTED "${SOURCE_PATH}\binary\shell_integration\windows\Release\Win32\OCOverlays_x86.dll" "$INSTDIR\shellext\OCOverlays_x86.dll" "$INSTDIR\shellext"
${Endif}
${MementoSectionEnd}
!endif
SectionGroup $SectionGroup_Shortcuts
!ifdef OPTION_SECTION_SC_START_MENU
@@ -601,6 +635,21 @@ Section Uninstall
DeleteRegKey HKCR "${APPLICATION_NAME}"
;Shell extension
!ifdef OPTION_SECTION_SC_SHELL_EXT
!define LIBRARY_COM
!define LIBRARY_SHELL_EXTENSION
${If} ${HasSection} SEC_SHELL_EXT
!define LIBRARY_X64
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCUtil_x64.dll"
!insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCOverlays_x64.dll"
!undef LIBRARY_X64
${Else}
!insertmacro UnInstallLib DLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCUtil_x86.dll"
!insertmacro UnInstallLib REGDLL NOTSHARED REBOOT_PROTECTED "$INSTDIR/shellext/OCOverlays_x86.dll"
${EndIf}
!endif
;Start menu shortcut
!ifdef OPTION_SECTION_SC_START_MENU
SetShellVarContext all

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
include (MacroOptionalFindPackage)
include (MacroLogFeature)
@@ -19,10 +23,11 @@ if( Qt5Core_FOUND )
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5Widgets REQUIRED)
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif(APPLE)
endif()
if(APPLE)
find_package(Qt5MacExtras REQUIRED)
endif(APPLE)
else( Qt5Core_FOUND )
if(WIN32 OR APPLE)
message(FATAL_ERROR "Qt 5 not found, but application depends on Qt5 on Windows and Mac OS X")
@@ -147,6 +152,19 @@ if(NOT Qt5Core_FOUND)
include( ${QT_USE_FILE} )
endmacro()
if (CMAKE_COMPILER_IS_GNUCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
add_definitions("-DQ_DECL_OVERRIDE=override")
else()
add_definitions("-DQ_DECL_OVERRIDE=")
endif()
else() #clang or others
add_definitions("-DQ_DECL_OVERRIDE=override")
endif()
endif()
if( Qt5Core_DIR )

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
# -helper macro to add a "doc" target with CMake build system.
# and configure doxy.config.in to doxy.config
#

View File

@@ -1,3 +1,7 @@
# (c) 2014 Copyright ownCloud, Inc.
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING* file.
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
@@ -6,9 +10,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER MATCHES "clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif(CMAKE_CXX_COMPILER MATCHES "clang")
# TODO: handle msvc compilers warnings?

View File

@@ -27,10 +27,6 @@ include(MacroCopyFile)
if (NOT WIN32)
find_package(Iconv)
endif (NOT WIN32)
find_package(CMocka)
if (CMOCKA_FOUND AND UNIT_TESTING)
include(AddCMockaTest)
endif (CMOCKA_FOUND AND UNIT_TESTING)
include(ConfigureChecks.cmake)
@@ -47,9 +43,13 @@ endif (MEM_NULL_TESTS)
add_subdirectory(src)
if (CMOCKA_FOUND AND UNIT_TESTING)
add_subdirectory(tests)
endif (CMOCKA_FOUND AND UNIT_TESTING)
if (UNIT_TESTING)
find_package(CMocka)
if (CMOCKA_FOUND)
include(AddCMockaTest)
add_subdirectory(tests)
endif (CMOCKA_FOUND)
endif (UNIT_TESTING)
configure_file(config_csync.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_csync.h)
configure_file(config_test.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_test.h)

View File

@@ -4,13 +4,6 @@ add_subdirectory(std)
add_subdirectory(httpbf)
# Statically include sqlite
if (CSYNC_STATIC_COMPILE_DIR)
set(SQLITE3_INCLUDE_DIRS "")
set(SQLITE3_LIBRARIES "")
include_directories(${CSYNC_STATIC_COMPILE_DIR})
else (CSYNC_STATIC_COMPILE_DIR)
find_package(SQLite3 3.3.9 REQUIRED)
endif()
set(CSYNC_PUBLIC_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}
@@ -86,8 +79,8 @@ set(csync_HDRS
)
# Statically include sqlite
if (CSYNC_STATIC_COMPILE_DIR)
list(APPEND csync_SRCS ${CSYNC_STATIC_COMPILE_DIR}/dictionary.c ${CSYNC_STATIC_COMPILE_DIR}/sqlite3.c)
if (USE_OUR_OWN_SQLITE3)
list(APPEND csync_SRCS ${SQLITE3_SOURCE})
endif()
include_directories(
@@ -96,10 +89,10 @@ include_directories(
)
add_library(${CSYNC_LIBRARY} SHARED ${csync_SRCS})
add_library(${CSYNC_LIBRARY}_static STATIC ${csync_SRCS})
#add_library(${CSYNC_LIBRARY}_static STATIC ${csync_SRCS})
target_link_libraries(${CSYNC_LIBRARY} ${CSYNC_LINK_LIBRARIES})
target_link_libraries(${CSYNC_LIBRARY}_static ${CSYNC_LINK_LIBRARIES})
#target_link_libraries(${CSYNC_LIBRARY}_static ${CSYNC_LINK_LIBRARIES})
set_target_properties(
${CSYNC_LIBRARY}

View File

@@ -96,8 +96,6 @@ static int _data_cmp(const void *key, const void *data) {
int csync_create(CSYNC **csync, const char *local, const char *remote) {
CSYNC *ctx;
size_t len = 0;
char *home;
int rc;
ctx = c_malloc(sizeof(CSYNC));
if (ctx == NULL) {
@@ -129,31 +127,6 @@ int csync_create(CSYNC **csync, const char *local, const char *remote) {
}
ctx->status_code = CSYNC_STATUS_OK;
ctx->options.local_only_mode = false;
ctx->pwd.uid = getuid();
ctx->pwd.euid = geteuid();
home = csync_get_user_home_dir();
if (home == NULL) {
SAFE_FREE(ctx->local.uri);
SAFE_FREE(ctx->remote.uri);
SAFE_FREE(ctx);
errno = ENOMEM;
ctx->status_code = CSYNC_STATUS_MEMORY_ERROR;
return -1;
}
rc = asprintf(&ctx->options.config_dir, "%s/%s", home, CSYNC_CONF_DIR);
SAFE_FREE(home);
if (rc < 0) {
SAFE_FREE(ctx->local.uri);
SAFE_FREE(ctx->remote.uri);
SAFE_FREE(ctx);
errno = ENOMEM;
ctx->status_code = CSYNC_STATUS_MEMORY_ERROR;
return -1;
}
ctx->local.list = 0;
ctx->remote.list = 0;
@@ -167,7 +140,6 @@ int csync_create(CSYNC **csync, const char *local, const char *remote) {
int csync_init(CSYNC *ctx) {
int rc;
char *config = NULL;
if (ctx == NULL) {
errno = EBADF;
@@ -190,12 +162,8 @@ int csync_init(CSYNC *ctx) {
ctx->local.type = LOCAL_REPLICA;
if ( !ctx->options.local_only_mode) {
owncloud_init(csync_get_userdata(ctx));
ctx->remote.type = REMOTE_REPLICA;
} else {
ctx->remote.type = LOCAL_REPLICA;
}
owncloud_init(ctx);
ctx->remote.type = REMOTE_REPLICA;
if (c_rbtree_create(&ctx->local.tree, _key_cmp, _data_cmp) < 0) {
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
@@ -211,15 +179,12 @@ int csync_init(CSYNC *ctx) {
ctx->status = CSYNC_STATUS_INIT;
csync_set_module_property(ctx, "csync_context", ctx);
/* initialize random generator */
srand(time(NULL));
rc = 0;
out:
SAFE_FREE(config);
return rc;
}
@@ -234,7 +199,6 @@ int csync_update(CSYNC *ctx) {
ctx->status_code = CSYNC_STATUS_OK;
/* create/load statedb */
if (! csync_is_statedb_disabled(ctx)) {
rc = asprintf(&ctx->statedb.file, "%s/.csync_journal.db",
ctx->local.uri);
if (rc < 0) {
@@ -248,7 +212,6 @@ int csync_update(CSYNC *ctx) {
rc = -1;
return rc;
}
}
ctx->status_code = CSYNC_STATUS_OK;
@@ -265,9 +228,10 @@ int csync_update(CSYNC *ctx) {
rc = csync_ftw(ctx, ctx->local.uri, csync_walker, MAX_DEPTH);
if (rc < 0) {
if(ctx->status_code == CSYNC_STATUS_OK)
if(ctx->status_code == CSYNC_STATUS_OK) {
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
return -1;
}
goto out;
}
csync_gettime(&finish);
@@ -278,30 +242,33 @@ int csync_update(CSYNC *ctx) {
csync_memstat_check();
/* update detection for remote replica */
if( ! ctx->options.local_only_mode ) {
csync_gettime(&start);
ctx->current = REMOTE_REPLICA;
ctx->replica = ctx->remote.type;
csync_gettime(&start);
ctx->current = REMOTE_REPLICA;
ctx->replica = ctx->remote.type;
rc = csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH);
if (rc < 0) {
if(ctx->status_code == CSYNC_STATUS_OK)
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
return -1;
}
csync_gettime(&finish);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
"Update detection for remote replica took %.2f seconds "
"walking %zu files.",
c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
csync_memstat_check();
rc = csync_ftw(ctx, ctx->remote.uri, csync_walker, MAX_DEPTH);
if (rc < 0) {
if(ctx->status_code == CSYNC_STATUS_OK) {
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_UPDATE_ERROR);
}
goto out;
}
csync_gettime(&finish);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG,
"Update detection for remote replica took %.2f seconds "
"walking %zu files.",
c_secdiff(finish, start), c_rbtree_size(ctx->remote.tree));
csync_memstat_check();
ctx->status |= CSYNC_STATUS_UPDATE;
return 0;
rc = 0;
out:
csync_statedb_close(ctx);
return rc;
}
int csync_reconcile(CSYNC *ctx) {
@@ -317,6 +284,12 @@ int csync_reconcile(CSYNC *ctx) {
/* Reconciliation for local replica */
csync_gettime(&start);
if (csync_statedb_load(ctx, ctx->statedb.file, &ctx->statedb.db) < 0) {
ctx->status_code = CSYNC_STATUS_STATEDB_LOAD_ERROR;
rc = -1;
return rc;
}
ctx->current = LOCAL_REPLICA;
ctx->replica = ctx->local.type;
@@ -332,7 +305,7 @@ int csync_reconcile(CSYNC *ctx) {
if (!CSYNC_STATUS_IS_OK(ctx->status_code)) {
ctx->status_code = csync_errno_to_status( errno, CSYNC_STATUS_RECONCILE_ERROR );
}
return -1;
goto out;
}
/* Reconciliation for remote replica */
@@ -353,11 +326,15 @@ int csync_reconcile(CSYNC *ctx) {
if (!CSYNC_STATUS_IS_OK(ctx->status_code)) {
ctx->status_code = csync_errno_to_status(errno, CSYNC_STATUS_RECONCILE_ERROR );
}
return -1;
goto out;
}
ctx->status |= CSYNC_STATUS_RECONCILE;
rc = 0;
out:
csync_statedb_close(ctx);
return 0;
}
@@ -431,14 +408,15 @@ static int _csync_treewalk_visitor(void *obj, void *data) {
trav.path = cur->path;
trav.size = cur->size;
trav.modtime = cur->modtime;
trav.uid = cur->uid;
trav.gid = cur->gid;
trav.mode = cur->mode;
trav.type = cur->type;
trav.instruction = cur->instruction;
trav.rename_path = cur->destpath;
trav.etag = cur->etag;
trav.file_id = cur->file_id;
trav.remotePerm = cur->remotePerm;
trav.directDownloadUrl = cur->directDownloadUrl;
trav.directDownloadCookies = cur->directDownloadCookies;
trav.inode = cur->inode;
trav.error_status = cur->error_status;
@@ -461,7 +439,7 @@ static int _csync_treewalk_visitor(void *obj, void *data) {
rc = (*visitor)(&trav, twctx->userdata);
cur->instruction = trav.instruction;
if (trav.etag != cur->etag) {
if (trav.etag != cur->etag) { // FIXME It would be nice to have this documented
SAFE_FREE(cur->etag);
cur->etag = c_strdup(trav.etag);
}
@@ -560,8 +538,6 @@ static void _tree_destructor(void *data) {
* used by csync_commit and csync_destroy */
static void _csync_clean_ctx(CSYNC *ctx)
{
c_list_t * walk;
/* destroy the rbtrees */
if (c_rbtree_size(ctx->local.tree) > 0) {
c_rbtree_destroy(ctx->local.tree, _tree_destructor);
@@ -573,25 +549,14 @@ static void _csync_clean_ctx(CSYNC *ctx)
csync_rename_destroy(ctx);
for (walk = c_list_last(ctx->local.ignored_cleanup); walk != NULL; walk = c_list_prev(walk)) {
SAFE_FREE(walk->data);
}
for (walk = c_list_last(ctx->remote.ignored_cleanup); walk != NULL; walk = c_list_prev(walk)) {
SAFE_FREE(walk->data);
}
/* free memory */
c_rbtree_free(ctx->local.tree);
c_list_free(ctx->local.list);
c_list_free(ctx->local.ignored_cleanup);
c_rbtree_free(ctx->remote.tree);
c_list_free(ctx->remote.list);
c_list_free(ctx->remote.ignored_cleanup);
ctx->remote.list = 0;
ctx->local.list = 0;
ctx->remote.ignored_cleanup = 0;
ctx->local.ignored_cleanup = 0;
SAFE_FREE(ctx->statedb.file);
}
@@ -612,7 +577,7 @@ int csync_commit(CSYNC *ctx) {
}
ctx->statedb.db = NULL;
rc = csync_vio_commit(ctx);
rc = owncloud_commit(ctx);
if (rc < 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "commit failed: %s",
ctx->error_string ? ctx->error_string : "");
@@ -671,9 +636,10 @@ int csync_destroy(CSYNC *ctx) {
SAFE_FREE(ctx->local.uri);
SAFE_FREE(ctx->remote.uri);
SAFE_FREE(ctx->options.config_dir);
SAFE_FREE(ctx->error_string);
owncloud_destroy(ctx);
#ifdef WITH_ICONV
c_close_iconv();
#endif
@@ -697,7 +663,7 @@ int csync_add_exclude_list(CSYNC *ctx, const char *path) {
return -1;
}
return csync_exclude_load(ctx, path);
return csync_exclude_load(path, &ctx->excludes);
}
void csync_clear_exclude_list(CSYNC *ctx)
@@ -705,70 +671,6 @@ void csync_clear_exclude_list(CSYNC *ctx)
csync_exclude_clear(ctx);
}
const char *csync_get_config_dir(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
}
return ctx->options.config_dir;
}
int csync_set_config_dir(CSYNC *ctx, const char *path) {
if (ctx == NULL || path == NULL) {
return -1;
}
SAFE_FREE(ctx->options.config_dir);
ctx->options.config_dir = c_strdup(path);
if (ctx->options.config_dir == NULL) {
ctx->status_code = CSYNC_STATUS_MEMORY_ERROR;
return -1;
}
return 0;
}
int csync_enable_statedb(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
ctx->status_code = CSYNC_STATUS_OK;
if (ctx->status & CSYNC_STATUS_INIT) {
fprintf(stderr, "This function must be called before initialization.");
ctx->status_code = CSYNC_STATUS_CSYNC_STATUS_ERROR;
return -1;
}
ctx->statedb.disabled = 0;
return 0;
}
int csync_disable_statedb(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
ctx->status_code = CSYNC_STATUS_OK;
if (ctx->status & CSYNC_STATUS_INIT) {
fprintf(stderr, "This function must be called before initialization.");
ctx->status_code = CSYNC_STATUS_CSYNC_STATUS_ERROR;
return -1;
}
ctx->statedb.disabled = 1;
return 0;
}
int csync_is_statedb_disabled(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
return ctx->statedb.disabled;
}
int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb) {
if (ctx == NULL || cb == NULL) {
return -1;
@@ -784,15 +686,6 @@ int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb) {
return 0;
}
const char *csync_get_statedb_file(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
}
ctx->status_code = CSYNC_STATUS_OK;
return c_strdup(ctx->statedb.file);
}
void *csync_get_userdata(CSYNC *ctx) {
if (ctx == NULL) {
return NULL;
@@ -836,33 +729,6 @@ CSYNC_STATUS csync_get_status(CSYNC *ctx) {
return ctx->status_code;
}
int csync_set_local_only(CSYNC *ctx, bool local_only) {
if (ctx == NULL) {
return -1;
}
ctx->status_code = CSYNC_STATUS_OK;
if (ctx->status & CSYNC_STATUS_INIT) {
fprintf(stderr, "csync_set_local_only: This function must be called before initialization.");
ctx->status_code = CSYNC_STATUS_CSYNC_STATUS_ERROR;
return -1;
}
ctx->options.local_only_mode=local_only;
return 0;
}
bool csync_get_local_only(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
ctx->status_code = CSYNC_STATUS_OK;
return ctx->options.local_only_mode;
}
const char *csync_get_status_string(CSYNC *ctx)
{
return csync_vio_get_status_string(ctx);
@@ -907,6 +773,8 @@ int csync_abort_requested(CSYNC *ctx)
void csync_file_stat_free(csync_file_stat_t *st)
{
if (st) {
SAFE_FREE(st->directDownloadUrl);
SAFE_FREE(st->directDownloadCookies);
SAFE_FREE(st->etag);
SAFE_FREE(st->destpath);
SAFE_FREE(st);
@@ -915,7 +783,7 @@ void csync_file_stat_free(csync_file_stat_t *st)
int csync_set_module_property(CSYNC* ctx, const char* key, void* value)
{
return csync_vio_set_property(ctx, key, value);
return owncloud_set_property(ctx, key, value);
}

View File

@@ -44,13 +44,6 @@
extern "C" {
#endif
/*
* csync file declarations
*/
#define CSYNC_CONF_DIR ".ocsync"
#define CSYNC_CONF_FILE "ocsync.conf"
#define CSYNC_EXCLUDE_FILE "ocsync_exclude.conf"
/**
* Instruction enum. In the file traversal structure, it describes
* the csync state of a file.
@@ -59,7 +52,7 @@ enum csync_status_codes_e {
CSYNC_STATUS_OK = 0,
CSYNC_STATUS_ERROR = 1024, /* don't use this code,
just use in csync_status_ok */
*/
CSYNC_STATUS_UNSUCCESSFUL,
CSYNC_STATUS_NO_LOCK, /* OBSOLETE does not happen anymore */
CSYNC_STATUS_STATEDB_LOAD_ERROR,
@@ -101,6 +94,7 @@ enum csync_status_codes_e {
CSYNC_STATUS_ABORTED,
/* Codes for file individual status: */
CSYNC_STATUS_INDIVIDUAL_IS_SYMLINK,
CSYNC_STATUS_INDIVIDUAL_IS_HARDLINK,
CSYNC_STATUS_INDIVIDUAL_IGNORE_LIST,
CSYNC_STATUS_INDIVIDUAL_IS_INVALID_CHARS,
CYSNC_STATUS_FILE_LOCKED_OR_OPEN
@@ -141,23 +135,6 @@ enum csync_ftw_type_e {
CSYNC_FTW_TYPE_SKIP
};
enum csync_notify_type_e {
CSYNC_NOTIFY_INVALID,
CSYNC_NOTIFY_START_SYNC_SEQUENCE,
CSYNC_NOTIFY_START_DOWNLOAD,
CSYNC_NOTIFY_START_UPLOAD,
CSYNC_NOTIFY_PROGRESS,
CSYNC_NOTIFY_FINISHED_DOWNLOAD,
CSYNC_NOTIFY_FINISHED_UPLOAD,
CSYNC_NOTIFY_FINISHED_SYNC_SEQUENCE,
CSYNC_NOTIFY_START_DELETE,
CSYNC_NOTIFY_END_DELETE,
CSYNC_NOTIFY_ERROR,
CSYNC_NOTIFY_START_LOCAL_UPDATE,
CSYNC_NOTIFY_FINISHED_LOCAL_UPDATE,
CSYNC_NOTIFY_START_REMOTE_UPDATE,
CSYNC_NOTIFY_FINISHED_REMOTE_UPDATE
};
/**
* CSync File Traversal structure.
@@ -172,13 +149,6 @@ struct csync_tree_walk_file_s {
int64_t size;
int64_t inode;
time_t modtime;
#ifdef _WIN32
uint32_t uid;
uint32_t gid;
#else
uid_t uid;
gid_t gid;
#endif
mode_t mode;
enum csync_ftw_type_e type;
enum csync_instructions_e instruction;
@@ -189,6 +159,9 @@ struct csync_tree_walk_file_s {
const char *rename_path;
const char *etag;
const char *file_id;
const char *remotePerm;
char *directDownloadUrl;
char *directDownloadCookies;
struct {
int64_t size;
time_t modtime;
@@ -214,14 +187,9 @@ typedef void (*csync_log_callback) (int verbosity,
const char *buffer,
void *userdata);
/**
* @brief Check internal csync status.
*
* @param csync The context to check.
*
* @return true if status is error free, false for error states.
*/
bool csync_status_ok(CSYNC *ctx);
typedef void (*csync_update_callback) (bool local,
const char *dirUrl,
void *userdata);
/**
* @brief Allocate a csync context.
@@ -333,62 +301,6 @@ int csync_add_exclude_list(CSYNC *ctx, const char *path);
*/
void csync_clear_exclude_list(CSYNC *ctx);
/**
* @brief Get the config directory.
*
* @param ctx The csync context.
*
* @return The path of the config directory or NULL on error.
*/
const char *csync_get_config_dir(CSYNC *ctx);
/**
* @brief Change the config directory.
*
* @param ctx The csync context.
*
* @param path The path to the new config directory.
*
* @return 0 on success, less than 0 if an error occured.
*/
int csync_set_config_dir(CSYNC *ctx, const char *path);
/**
* @brief Remove the complete config directory.
*
* @param ctx The csync context.
*
* @return 0 on success, less than 0 if an error occured.
*/
int csync_remove_config_dir(CSYNC *ctx);
/**
* @brief Enable the usage of the statedb. It is enabled by default.
*
* @param ctx The csync context.
*
* @return 0 on success, less than 0 if an error occured.
*/
int csync_enable_statedb(CSYNC *ctx);
/**
* @brief Disable the usage of the statedb. It is enabled by default.
*
* @param ctx The csync context.
*
* @return 0 on success, less than 0 if an error occured.
*/
int csync_disable_statedb(CSYNC *ctx);
/**
* @brief Check if the statedb usage is enabled.
*
* @param ctx The csync context.
*
* @return 1 if it is enabled, 0 if it is disabled.
*/
int csync_is_statedb_disabled(CSYNC *ctx);
/**
* @brief Get the userdata saved in the context.
*
@@ -481,31 +393,6 @@ void *csync_get_log_userdata(void);
*/
int csync_set_log_userdata(void *data);
/**
* @brief Get the path of the statedb file used.
*
* @param ctx The csync context.
*
* @return The path to the statedb file, NULL if an error occured.
*/
const char *csync_get_statedb_file(CSYNC *ctx);
/**
* @brief Flag to tell csync that only a local run is intended. Call before csync_init
*
* @param local_only Bool flag to indicate local only mode.
*
* @return 0 on success, less than 0 if an error occured.
*/
int csync_set_local_only( CSYNC *ctx, bool local_only );
/**
* @brief Retrieve the flag to tell csync that only a local run is intended.
*
* @return 1: stay local only, 0: local and remote mode
*/
bool csync_get_local_only( CSYNC *ctx );
/* Used for special modes or debugging */
CSYNC_STATUS csync_get_status(CSYNC *ctx);

View File

@@ -20,12 +20,18 @@
#include "config_csync.h"
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "c_lib.h"
#include "c_private.h"
#include "csync_private.h"
#include "csync_exclude.h"
@@ -34,28 +40,31 @@
#define CSYNC_LOG_CATEGORY_NAME "csync.exclude"
#include "csync_log.h"
static int _csync_exclude_add(CSYNC *ctx, const char *string) {
#ifndef NDEBUG
static
#endif
int _csync_exclude_add(c_strlist_t **inList, const char *string) {
c_strlist_t *list;
if (ctx->excludes == NULL) {
ctx->excludes = c_strlist_new(32);
if (ctx->excludes == NULL) {
if (*inList == NULL) {
*inList = c_strlist_new(32);
if (*inList == NULL) {
return -1;
}
}
if (ctx->excludes->count == ctx->excludes->size) {
list = c_strlist_expand(ctx->excludes, 2 * ctx->excludes->size);
if ((*inList)->count == (*inList)->size) {
list = c_strlist_expand(*inList, 2 * (*inList)->size);
if (list == NULL) {
return -1;
}
ctx->excludes = list;
*inList = list;
}
return c_strlist_add(ctx->excludes, string);
return c_strlist_add(*inList, string);
}
int csync_exclude_load(CSYNC *ctx, const char *fname) {
int csync_exclude_load(const char *fname, c_strlist_t **list) {
int fd = -1;
int i = 0;
int rc = -1;
@@ -64,7 +73,7 @@ int csync_exclude_load(CSYNC *ctx, const char *fname) {
char *entry = NULL;
mbchar_t *w_fname;
if (ctx == NULL || fname == NULL) {
if (fname == NULL) {
return -1;
}
@@ -113,7 +122,7 @@ int csync_exclude_load(CSYNC *ctx, const char *fname) {
buf[i] = '\0';
if (*entry != '#') {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Adding entry: %s", entry);
rc = _csync_exclude_add(ctx, entry);
rc = _csync_exclude_add(list, entry);
if (rc < 0) {
goto out;
}
@@ -139,6 +148,49 @@ void csync_exclude_destroy(CSYNC *ctx) {
}
CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
CSYNC_EXCLUDE_TYPE match = CSYNC_NOT_EXCLUDED;
match = csync_excluded_no_ctx( ctx->excludes, path, filetype );
return match;
}
// See http://support.microsoft.com/kb/74496
static const char *win_reserved_words[] = {"CON","PRN","AUX", "NUL",
"COM1", "COM2", "COM3", "COM4",
"LPT1", "LPT2", "LPT3", "CLOCK$" };
bool csync_is_windows_reserved_word(const char* filename) {
size_t win_reserve_words_len = sizeof(win_reserved_words) / sizeof(char*);
size_t j;
for (j = 0; j < win_reserve_words_len; j++) {
int len_reserved_word = strlen(win_reserved_words[j]);
int len_filename = strlen(filename);
if (len_filename == 2 && filename[1] == ':') {
if (filename[0] >= 'a' && filename[0] <= 'z') {
return true;
}
if (filename[0] >= 'A' && filename[0] <= 'Z') {
return true;
}
}
if (c_strncasecmp(filename, win_reserved_words[j], len_reserved_word) == 0) {
if (len_filename == len_reserved_word) {
return true;
}
if ((len_filename > len_reserved_word) && (filename[len_reserved_word] == '.')) {
return true;
}
}
}
return false;
}
CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype) {
size_t i = 0;
const char *p = NULL;
char *bname = NULL;
@@ -184,6 +236,27 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
goto out;
}
#ifdef _WIN32
// Windows cannot sync files ending in spaces (#2176). It also cannot
// distinguish files ending in '.' from files without an ending,
// as '.' is a separator that is not stored internally, so let's
// not allow to sync those to avoid file loss/ambiguities (#416)
size_t blen = strlen(bname);
if (blen > 1 && (bname[blen-1]== ' ' || bname[blen-1]== '.' )) {
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
SAFE_FREE(bname);
SAFE_FREE(dname);
goto out;
}
if (csync_is_windows_reserved_word(bname)) {
match = CSYNC_FILE_EXCLUDE_INVALID_CHAR;
SAFE_FREE(bname);
SAFE_FREE(dname);
goto out;
}
#endif
rc = csync_fnmatch(".owncloudsync.log*", bname, 0);
if (rc == 0) {
match = CSYNC_FILE_SILENTLY_EXCLUDED;
@@ -202,7 +275,10 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
}
if (getenv("CSYNC_CONFLICT_FILE_USERNAME")) {
asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME"));
rc = asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME"));
if (rc < 0) {
goto out;
}
rc = csync_fnmatch(conflict, path, 0);
if (rc == 0) {
match = CSYNC_FILE_SILENTLY_EXCLUDED;
@@ -217,14 +293,14 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
SAFE_FREE(bname);
SAFE_FREE(dname);
if (ctx->excludes == NULL) {
if( ! excludes ) {
goto out;
}
/* Loop over all exclude patterns and evaluate the given path */
for (i = 0; match == CSYNC_NOT_EXCLUDED && i < ctx->excludes->count; i++) {
for (i = 0; match == CSYNC_NOT_EXCLUDED && i < excludes->count; i++) {
bool match_dirs_only = false;
char *pattern_stored = c_strdup(ctx->excludes->vector[i]);
char *pattern_stored = c_strdup(excludes->vector[i]);
char* pattern = pattern_stored;
type = CSYNC_FILE_EXCLUDE_LIST;
@@ -304,6 +380,7 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) {
SAFE_FREE(dname);
}
out:
return match;

View File

@@ -29,6 +29,11 @@ enum csync_exclude_type_e {
CSYNC_FILE_EXCLUDE_INVALID_CHAR
};
typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
#ifdef NDEBUG
int _csync_exclude_add(c_strlist_t **inList, const char *string);
#endif
/**
* @brief Load exclude list
*
@@ -37,7 +42,7 @@ typedef enum csync_exclude_type_e CSYNC_EXCLUDE_TYPE;
*
* @return 0 on success, -1 if an error occured with errno set.
*/
int csync_exclude_load(CSYNC *ctx, const char *fname);
int csync_exclude_load(const char *fname, c_strlist_t **list);
/**
* @brief Clear the exclude list in memory.
@@ -65,6 +70,22 @@ void csync_exclude_destroy(CSYNC *ctx);
*/
CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype);
/**
* @brief csync_excluded_no_ctx
* @param excludes
* @param path
* @param filetype
* @return
*/
CSYNC_EXCLUDE_TYPE csync_excluded_no_ctx(c_strlist_t *excludes, const char *path, int filetype);
#endif /* _CSYNC_EXCLUDE_H */
/**
* @brief Checks if filename is considered reserved by Windows
* @param file_name filename
* @return true if file is reserved, false otherwise
*/
bool csync_is_windows_reserved_word(const char *file_name);
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */

View File

@@ -47,52 +47,6 @@
#include "csync_macros.h"
#include "csync_log.h"
#ifdef _WIN32
char *csync_get_user_home_dir(void) {
wchar_t tmp[MAX_PATH];
char *szPath = NULL;
if( SHGetFolderPathW( NULL,
CSIDL_PROFILE|CSIDL_FLAG_CREATE,
NULL,
0,
tmp) == S_OK ) {
szPath = c_utf8_from_locale(tmp);
return szPath;
}
return NULL;
}
#else /* ************* !WIN32 ************ */
#ifndef NSS_BUFLEN_PASSWD
#define NSS_BUFLEN_PASSWD 4096
#endif /* NSS_BUFLEN_PASSWD */
char *csync_get_user_home_dir(void) {
const char *envp;
struct passwd pwd;
struct passwd *pwdbuf;
char buf[NSS_BUFLEN_PASSWD];
int rc;
envp = getenv("HOME");
if (envp != NULL && envp[0] != '\0') {
return c_strdup(envp);
}
/* Still nothing found, read the password file */
rc = getpwuid_r(getuid(), &pwd, buf, NSS_BUFLEN_PASSWD, &pwdbuf);
if (rc != 0) {
return c_strdup(pwd.pw_dir);
}
return NULL;
}
#endif /* ************* WIN32 ************ */
#ifdef HAVE_FNMATCH
#include <fnmatch.h>

View File

@@ -35,8 +35,6 @@
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#endif
char *csync_get_user_home_dir(void);
int csync_fnmatch(__const char *__pattern, __const char *__name, int __flags);
/**

View File

@@ -20,79 +20,12 @@
*/
#include "csync_owncloud.h"
#include "csync_owncloud_private.h"
#include <inttypes.h>
/*
* free the fetchCtx
*/
static void free_fetchCtx( struct listdir_context *ctx )
{
struct resource *newres, *res;
if( ! ctx ) return;
newres = ctx->list;
res = newres;
#include "csync_private.h"
ctx->ref--;
if (ctx->ref > 0) return;
SAFE_FREE(ctx->target);
while( res ) {
SAFE_FREE(res->uri);
SAFE_FREE(res->name);
SAFE_FREE(res->md5);
memset( res->file_id, 0, FILE_ID_BUF_SIZE+1 );
newres = res->next;
SAFE_FREE(res);
res = newres;
}
SAFE_FREE(ctx);
}
/*
* local variables.
*/
struct dav_session_s dav_session; /* The DAV Session, initialised in dav_connect */
int _connected = 0; /* flag to indicate if a connection exists, ie.
the dav_session is valid */
void *_userdata;
long long chunked_total_size = 0;
long long chunked_done = 0;
struct listdir_context *propfind_cache = 0;
bool is_first_propfind = true;
csync_vio_file_stat_t _stat_cache;
/* id cache, cache the ETag: header of a GET request */
struct { char *uri; char *id; } _id_cache = { NULL, NULL };
static void clean_caches() {
clear_propfind_recursive_cache();
free_fetchCtx(propfind_cache);
propfind_cache = NULL;
SAFE_FREE(_stat_cache.name);
SAFE_FREE(_stat_cache.etag );
memset( _stat_cache.file_id, 0, FILE_ID_BUF_SIZE+1 );
SAFE_FREE(_id_cache.uri);
SAFE_FREE(_id_cache.id);
}
#define PUT_BUFFER_SIZE 1024*5
char _buffer[PUT_BUFFER_SIZE];
/*
* helper method to build up a user text for SSL problems, called from the
@@ -116,7 +49,7 @@ static void addSSLWarning( char *ptr, const char *warn, int len )
* it to the csync callback to ask the user.
*/
#define LEN 4096
static int verify_sslcert(void *userdata, int failures,
static int ssl_callback_by_neon(void *userdata, int failures,
const ne_ssl_certificate *certificate)
{
char problem[LEN];
@@ -124,8 +57,8 @@ static int verify_sslcert(void *userdata, int failures,
int ret = -1;
const ne_ssl_certificate *cert = certificate;
csync_auth_callback authcb = NULL;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t*) userdata;
(void) userdata;
memset( problem, 0, LEN );
while( cert ) {
@@ -161,14 +94,14 @@ static int verify_sslcert(void *userdata, int failures,
}
addSSLWarning( problem, "Do you want to accept the certificate chain anyway?\nAnswer yes to do so and take the risk: ", LEN );
if( dav_session.csync_ctx ) {
authcb = csync_get_auth_callback( dav_session.csync_ctx );
if( ctx->csync_ctx ) {
authcb = csync_get_auth_callback( ctx->csync_ctx );
}
if( authcb ){
/* call the csync callback */
DEBUG_WEBDAV("Call the csync callback for SSL problems");
memset( buf, 0, NE_ABUFSIZ );
(*authcb) ( problem, buf, NE_ABUFSIZ-1, 1, 0, _userdata );
(*authcb) ( problem, buf, NE_ABUFSIZ-1, 1, 0, csync_get_userdata(ctx->csync_ctx) );
if( buf[0] == 'y' || buf[0] == 'Y') {
ret = 0;
} else {
@@ -177,48 +110,46 @@ static int verify_sslcert(void *userdata, int failures,
}
}
DEBUG_WEBDAV("## VERIFY_SSL CERT: %d", ret );
return ret;
return ret;
}
/*
* Authentication callback. Is set by ne_set_server_auth to be called
* from the neon lib to authenticate a request.
*/
static int ne_auth( void *userdata, const char *realm, int attempt,
static int authentication_callback_by_neon( void *userdata, const char *realm, int attempt,
char *username, char *password)
{
char buf[NE_ABUFSIZ];
csync_auth_callback authcb = NULL;
int re = attempt;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t*) userdata;
(void) userdata;
(void) realm;
/* DEBUG_WEBDAV( "Authentication required %s", realm ); */
if( username && password ) {
DEBUG_WEBDAV( "Authentication required %s", username );
if( dav_session.user ) {
if( ctx->dav_session.user ) {
/* allow user without password */
if( strlen( dav_session.user ) < NE_ABUFSIZ ) {
strcpy( username, dav_session.user );
if( strlen( ctx->dav_session.user ) < NE_ABUFSIZ ) {
strcpy( username, ctx->dav_session.user );
}
if( dav_session.pwd && strlen( dav_session.pwd ) < NE_ABUFSIZ ) {
strcpy( password, dav_session.pwd );
if( ctx->dav_session.pwd && strlen( ctx->dav_session.pwd ) < NE_ABUFSIZ ) {
strcpy( password, ctx->dav_session.pwd );
}
} else {
if( dav_session.csync_ctx ) {
authcb = csync_get_auth_callback( dav_session.csync_ctx );
}
authcb = csync_get_auth_callback( ctx->csync_ctx );
if( authcb != NULL ){
/* call the csync callback */
DEBUG_WEBDAV("Call the csync callback for %s", realm );
memset( buf, 0, NE_ABUFSIZ );
(*authcb) ("Enter your username: ", buf, NE_ABUFSIZ-1, 1, 0, _userdata );
(*authcb) ("Enter your username: ", buf, NE_ABUFSIZ-1, 1, 0, csync_get_userdata(ctx->csync_ctx) );
if( strlen(buf) < NE_ABUFSIZ ) {
strcpy( username, buf );
}
memset( buf, 0, NE_ABUFSIZ );
(*authcb) ("Enter your password: ", buf, NE_ABUFSIZ-1, 0, 0, _userdata );
(*authcb) ("Enter your password: ", buf, NE_ABUFSIZ-1, 0, 0, csync_get_userdata(ctx->csync_ctx) );
if( strlen(buf) < NE_ABUFSIZ) {
strcpy( password, buf );
}
@@ -235,15 +166,15 @@ static int ne_auth( void *userdata, const char *realm, int attempt,
* from the neon lib to authenticate against a proxy. The data to authenticate
* against comes from mirall throught vio_module_init function.
*/
static int ne_proxy_auth( void *userdata, const char *realm, int attempt,
static int proxy_authentication_callback_by_neon( void *userdata, const char *realm, int attempt,
char *username, char *password)
{
(void) userdata;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t*) userdata;
(void) realm;
if( dav_session.proxy_user && strlen( dav_session.proxy_user ) < NE_ABUFSIZ) {
strcpy( username, dav_session.proxy_user );
if( dav_session.proxy_pwd && strlen( dav_session.proxy_pwd ) < NE_ABUFSIZ) {
strcpy( password, dav_session.proxy_pwd );
if( ctx->dav_session.proxy_user && strlen( ctx->dav_session.proxy_user ) < NE_ABUFSIZ) {
strcpy( username, ctx->dav_session.proxy_user );
if( ctx->dav_session.proxy_pwd && strlen( ctx->dav_session.proxy_pwd ) < NE_ABUFSIZ) {
strcpy( password, ctx->dav_session.proxy_pwd );
}
}
/* NTLM needs several attempts */
@@ -251,42 +182,42 @@ static int ne_proxy_auth( void *userdata, const char *realm, int attempt,
}
/* Configure the proxy depending on the variables */
static int configureProxy( ne_session *session )
static int configureProxy( csync_owncloud_ctx_t *ctx, ne_session *session )
{
int port = 8080;
int re = -1;
if( ! session ) return -1;
if( ! dav_session.proxy_type ) return 0; /* Go by NoProxy per default */
if( ! ctx->dav_session.proxy_type ) return 0; /* Go by NoProxy per default */
if( dav_session.proxy_port > 0 ) {
port = dav_session.proxy_port;
if( ctx->dav_session.proxy_port > 0 ) {
port = ctx->dav_session.proxy_port;
}
if( c_streq(dav_session.proxy_type, "NoProxy" )) {
if( c_streq(ctx->dav_session.proxy_type, "NoProxy" )) {
DEBUG_WEBDAV("No proxy configured.");
re = 0;
} else if( c_streq(dav_session.proxy_type, "DefaultProxy") ||
c_streq(dav_session.proxy_type, "HttpProxy") ||
c_streq(dav_session.proxy_type, "HttpCachingProxy") ||
c_streq(dav_session.proxy_type, "Socks5Proxy")) {
} else if( c_streq(ctx->dav_session.proxy_type, "DefaultProxy") ||
c_streq(ctx->dav_session.proxy_type, "HttpProxy") ||
c_streq(ctx->dav_session.proxy_type, "HttpCachingProxy") ||
c_streq(ctx->dav_session.proxy_type, "Socks5Proxy")) {
if( dav_session.proxy_host ) {
DEBUG_WEBDAV("%s at %s:%d", dav_session.proxy_type, dav_session.proxy_host, port );
if (c_streq(dav_session.proxy_type, "Socks5Proxy")) {
ne_session_socks_proxy(session, NE_SOCK_SOCKSV5, dav_session.proxy_host, port,
dav_session.proxy_user, dav_session.proxy_pwd);
if( ctx->dav_session.proxy_host ) {
DEBUG_WEBDAV("%s at %s:%d", ctx->dav_session.proxy_type, ctx->dav_session.proxy_host, port );
if (c_streq(ctx->dav_session.proxy_type, "Socks5Proxy")) {
ne_session_socks_proxy(session, NE_SOCK_SOCKSV5, ctx->dav_session.proxy_host, port,
ctx->dav_session.proxy_user, ctx->dav_session.proxy_pwd);
} else {
ne_session_proxy(session, dav_session.proxy_host, port );
ne_session_proxy(session, ctx->dav_session.proxy_host, port );
}
re = 2;
} else {
DEBUG_WEBDAV("%s requested but no proxy host defined.", dav_session.proxy_type );
DEBUG_WEBDAV("%s requested but no proxy host defined.", ctx->dav_session.proxy_type );
/* we used to try ne_system_session_proxy here, but we should rather err out
to behave exactly like the caller. */
}
} else {
DEBUG_WEBDAV( "Unsupported Proxy: %s", dav_session.proxy_type );
DEBUG_WEBDAV( "Unsupported Proxy: %s", ctx->dav_session.proxy_type );
}
return re;
@@ -303,9 +234,9 @@ static void post_request_hook(ne_request *req, void *userdata, const ne_status *
const char *sc = NULL;
char *key = NULL;
(void) userdata;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t*) userdata;
if (dav_session.session_key)
if (ctx->dav_session.session_key)
return; /* We already have a session cookie, and we should ignore other ones */
if(!(status && req)) return;
@@ -373,8 +304,8 @@ static void post_request_hook(ne_request *req, void *userdata, const ne_status *
}
if( key ) {
DEBUG_WEBDAV("----> Session-key: %s", key);
SAFE_FREE(dav_session.session_key);
dav_session.session_key = key;
SAFE_FREE(ctx->dav_session.session_key);
ctx->dav_session.session_key = key;
}
}
@@ -385,13 +316,14 @@ static void post_request_hook(ne_request *req, void *userdata, const ne_status *
static void request_created_hook(ne_request *req, void *userdata,
const char *method, const char *requri)
{
(void) userdata;
// FIXME Can possibly be merged with pre_send_hook
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t *) userdata;
(void) method;
(void) requri;
if( !req ) return;
if(dav_session.proxy_type) {
if(ctx->dav_session.proxy_type) {
/* required for NTLM */
ne_add_request_header(req, "Proxy-Connection", "Keep-Alive");
}
@@ -404,12 +336,12 @@ static void request_created_hook(ne_request *req, void *userdata,
static void pre_send_hook(ne_request *req, void *userdata,
ne_buffer *header)
{
(void) userdata;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t *) userdata;
if( !req ) return;
if(dav_session.session_key) {
ne_buffer_concat(header, "Cookie: ", dav_session.session_key, "\r\n", NULL);
if(ctx->dav_session.session_key) {
ne_buffer_concat(header, "Cookie: ", ctx->dav_session.session_key, "\r\n", NULL);
} else {
DEBUG_WEBDAV("csync pre_send_hook We don't have a Auth Cookie (session_key), this is wrong!");
}
@@ -419,16 +351,15 @@ static int post_send_hook(ne_request *req, void *userdata,
const ne_status *status)
{
const char *location;
(void) userdata;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t *) userdata;
(void) status;
location = ne_get_response_header(req, "Location");
if( !location ) return NE_OK;
if( dav_session.redir_callback ) {
if( dav_session.redir_callback( dav_session.csync_ctx, location ) ) {
if( ctx->dav_session.redir_callback ) {
if( ctx->dav_session.redir_callback( ctx->csync_ctx, location ) ) {
return NE_REDIRECT;
} else {
return NE_RETRY;
@@ -438,37 +369,12 @@ static int post_send_hook(ne_request *req, void *userdata,
return NE_REDIRECT;
}
// as per http://sourceforge.net/p/predef/wiki/OperatingSystems/
// extend as required
static const char* get_platform() {
#if defined (_WIN32)
return "Windows";
#elif defined(__APPLE__)
return "Macintosh";
#elif defined(__gnu_linux__)
return "Linux";
#elif defined(__DragonFly__)
/* might also define __FreeBSD__ */
return "DragonFlyBSD";
#elif defined(__FreeBSD__)
return "FreeBSD";
#elif defined(__NetBSD__)
return "NetBSD";
#elif defined(__OpenBSD__)
return "OpenBSD";
#elif defined(sun) || defined(__sun)
return "Solaris";
#else
return "Unknown OS";
#endif
}
/*
* Connect to a DAV server
* This function sets the flag _connected if the connection is established
* and returns if the flag is set, so calling it frequently is save.
*/
static int dav_connect(const char *base_url) {
static int dav_connect(csync_owncloud_ctx_t *ctx, const char *base_url) {
int useSSL = 0;
int rc;
char protocol[6] = {'\0'};
@@ -479,11 +385,14 @@ static int dav_connect(const char *base_url) {
unsigned int port = 0;
int proxystate = -1;
if (_connected) {
if (ctx->_connected) {
return 0;
}
rc = c_parse_uri( base_url, &scheme, &dav_session.user, &dav_session.pwd, &host, &port, &path );
rc = c_parse_uri( base_url, &scheme,
&ctx->dav_session.user,
&ctx->dav_session.pwd,
&host, &port, &path );
if( rc < 0 ) {
DEBUG_WEBDAV("Failed to parse uri %s", base_url );
goto out;
@@ -505,29 +414,31 @@ static int dav_connect(const char *base_url) {
goto out;
}
DEBUG_WEBDAV("* user %s", dav_session.user ? dav_session.user : "");
DEBUG_WEBDAV("* user %s", ctx->dav_session.user ? ctx->dav_session.user : "");
if (port == 0) {
port = ne_uri_defaultport(protocol);
}
dav_session.ctx = ne_session_create( protocol, host, port);
ctx->dav_session.ctx = ne_session_create( protocol, host, port);
if (dav_session.ctx == NULL) {
if (ctx->dav_session.ctx == NULL) {
DEBUG_WEBDAV("Session create with protocol %s failed", protocol );
rc = -1;
goto out;
}
if (dav_session.read_timeout != 0) {
ne_set_read_timeout(dav_session.ctx, dav_session.read_timeout);
DEBUG_WEBDAV("Timeout set to %u seconds", dav_session.read_timeout );
if (ctx->dav_session.read_timeout != 0) {
ne_set_read_timeout(ctx->dav_session.ctx, ctx->dav_session.read_timeout);
DEBUG_WEBDAV("Timeout set to %u seconds", ctx->dav_session.read_timeout );
}
// Should never take more than some seconds, 30 is really a max.
ne_set_connect_timeout(ctx->dav_session.ctx, 30);
snprintf( uaBuf, sizeof(uaBuf), "Mozilla/5.0 (%s) csyncoC/%s",
get_platform(), CSYNC_STRINGIFY( LIBCSYNC_VERSION ));
ne_set_useragent( dav_session.ctx, uaBuf);
ne_set_server_auth(dav_session.ctx, ne_auth, 0 );
csync_owncloud_get_platform(), CSYNC_STRINGIFY( LIBCSYNC_VERSION ));
ne_set_useragent( ctx->dav_session.ctx, uaBuf);
ne_set_server_auth(ctx->dav_session.ctx, authentication_callback_by_neon, ctx);
if( useSSL ) {
if (!ne_has_support(NE_FEATURE_SSL)) {
@@ -536,28 +447,28 @@ static int dav_connect(const char *base_url) {
goto out;
}
ne_ssl_trust_default_ca( dav_session.ctx );
ne_ssl_set_verify( dav_session.ctx, verify_sslcert, 0 );
ne_ssl_trust_default_ca( ctx->dav_session.ctx );
ne_ssl_set_verify( ctx->dav_session.ctx, ssl_callback_by_neon, ctx);
}
/* Hook called when a request is created. It sets the proxy connection header. */
ne_hook_create_request( dav_session.ctx, request_created_hook, NULL );
ne_hook_create_request( ctx->dav_session.ctx, request_created_hook, ctx );
/* Hook called after response headers are read. It gets the Session ID. */
ne_hook_post_headers( dav_session.ctx, post_request_hook, NULL );
ne_hook_post_headers( ctx->dav_session.ctx, post_request_hook, ctx );
/* Hook called before a request is sent. It sets the cookies. */
ne_hook_pre_send( dav_session.ctx, pre_send_hook, NULL );
ne_hook_pre_send( ctx->dav_session.ctx, pre_send_hook, ctx );
/* Hook called after request is dispatched. Used for handling possible redirections. */
ne_hook_post_send( dav_session.ctx, post_send_hook, NULL );
ne_hook_post_send( ctx->dav_session.ctx, post_send_hook, ctx );
/* Proxy support */
proxystate = configureProxy( dav_session.ctx );
proxystate = configureProxy( ctx, ctx->dav_session.ctx );
if( proxystate < 0 ) {
DEBUG_WEBDAV("Error: Proxy-Configuration failed.");
} else if( proxystate > 0 ) {
ne_set_proxy_auth( dav_session.ctx, ne_proxy_auth, 0 );
ne_set_proxy_auth( ctx->dav_session.ctx, proxy_authentication_callback_by_neon, ctx );
}
_connected = 1;
ctx->_connected = 1;
rc = 0;
out:
SAFE_FREE(path);
@@ -573,24 +484,16 @@ out:
* and fills a resource struct and stores it to the result list which
* is stored in the listdir_context.
*/
static void results(void *userdata,
static void propfind_results_callback(void *userdata,
const ne_uri *uri,
const ne_prop_result_set *set)
{
struct listdir_context *fetchCtx = userdata;
struct resource *newres = 0;
const char *clength, *modtime = NULL;
const char *resourcetype = NULL;
const char *md5sum = NULL;
const char *file_id = NULL;
const ne_status *status = NULL;
char *path = ne_path_unescape( uri->path );
(void) status;
if( ! fetchCtx ) {
DEBUG_WEBDAV("No valid fetchContext");
return;
}
if( ! fetchCtx->target ) {
DEBUG_WEBDAV("error: target must not be zero!" );
@@ -599,37 +502,9 @@ static void results(void *userdata,
/* Fill the resource structure with the data about the file */
newres = c_malloc(sizeof(struct resource));
ZERO_STRUCTP(newres);
newres->uri = path; /* no need to strdup because ne_path_unescape already allocates */
newres->name = c_basename( path );
modtime = ne_propset_value( set, &ls_props[0] );
clength = ne_propset_value( set, &ls_props[1] );
resourcetype = ne_propset_value( set, &ls_props[2] );
md5sum = ne_propset_value( set, &ls_props[3] );
file_id = ne_propset_value( set, &ls_props[4] );
newres->type = resr_normal;
if( clength == NULL && resourcetype && strncmp( resourcetype, "<DAV:collection>", 16 ) == 0) {
newres->type = resr_collection;
}
if (modtime) {
newres->modtime = oc_httpdate_parse(modtime);
}
/* DEBUG_WEBDAV("Parsing Modtime: %s -> %llu", modtime, (unsigned long long) newres->modtime ); */
newres->size = 0;
if (clength) {
newres->size = atoll(clength);
/* DEBUG_WEBDAV("Parsed File size for %s from %s: %lld", newres->name, clength, (long long)newres->size ); */
}
if( md5sum ) {
newres->md5 = csync_normalize_etag(md5sum);
}
csync_vio_set_file_id(newres->file_id, file_id);
fill_webdav_properties_into_resource(newres, set);
/* prepend the new resource to the result list */
newres->next = fetchCtx->list;
@@ -643,7 +518,7 @@ static void results(void *userdata,
/*
* fetches a resource list from the WebDAV server. This is equivalent to list dir.
*/
static struct listdir_context *fetch_resource_list(const char *uri, int depth)
static struct listdir_context *fetch_resource_list(csync_owncloud_ctx_t *ctx, const char *uri, int depth)
{
struct listdir_context *fetchCtx;
int ret = 0;
@@ -657,15 +532,20 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
/* The old legacy one-level PROPFIND cache. Also gets filled
by the recursive cache if 'infinity' did not suceed. */
if (propfind_cache) {
if (c_streq(curi, propfind_cache->target)) {
if (ctx->propfind_cache) {
if (c_streq(curi, ctx->propfind_cache->target)) {
DEBUG_WEBDAV("fetch_resource_list Using simple PROPFIND cache %s", curi);
propfind_cache->ref++;
ctx->propfind_cache->ref++;
SAFE_FREE(curi);
return propfind_cache;
return ctx->propfind_cache;
}
}
if( ctx->csync_ctx->callbacks.update_callback ) {
ctx->csync_ctx->callbacks.update_callback(false, curi,
ctx->csync_ctx->callbacks.update_callback_userdata);
}
fetchCtx = c_malloc( sizeof( struct listdir_context ));
if (!fetchCtx) {
errno = ENOMEM;
@@ -678,10 +558,10 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
fetchCtx->ref = 1;
/* do a propfind request and parse the results in the results function, set as callback */
hdl = ne_propfind_create(dav_session.ctx, curi, depth);
hdl = ne_propfind_create(ctx->dav_session.ctx, curi, depth);
if(hdl) {
ret = ne_propfind_named(hdl, ls_props, results, fetchCtx);
ret = ne_propfind_named(hdl, ls_props, propfind_results_callback, fetchCtx);
request = ne_propfind_get_request( hdl );
req_status = ne_get_status( request );
}
@@ -694,14 +574,14 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
DEBUG_WEBDAV("ERROR: Request failed: status %d (%s)", req_status->code,
req_status->reason_phrase);
ret = NE_CONNECT;
set_error_message(req_status->reason_phrase);
set_error_message(ctx, req_status->reason_phrase);
}
DEBUG_WEBDAV("Simple propfind result code %d.", req_status ? req_status->code : -1);
} else {
if( ret == NE_ERROR && req_status->code == 404) {
errno = ENOENT;
} else {
set_errno_from_neon_errcode(ret);
set_errno_from_neon_errcode(ctx, ret);
}
}
@@ -716,18 +596,18 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
DEBUG_WEBDAV("ERROR: Content type of propfind request not XML: %s.",
content_type ? content_type: "<empty>");
errno = ERRNO_WRONG_CONTENT;
set_error_message("Server error: PROPFIND reply is not XML formatted!");
set_error_message(ctx, "Server error: PROPFIND reply is not XML formatted!");
ret = NE_CONNECT;
}
}
if( ret != NE_OK ) {
const char *err = NULL;
set_errno_from_neon_errcode(ret);
set_errno_from_neon_errcode(ctx, ret);
err = ne_get_error( dav_session.ctx );
err = ne_get_error( ctx->dav_session.ctx );
if(err) {
set_error_message(err);
set_error_message(ctx, err);
}
DEBUG_WEBDAV("WRN: propfind named failed with %d, request error: %s", ret, err ? err : "<nil>");
}
@@ -740,19 +620,19 @@ static struct listdir_context *fetch_resource_list(const char *uri, int depth)
return NULL;
}
free_fetchCtx(propfind_cache);
propfind_cache = fetchCtx;
propfind_cache->ref++;
free_fetchCtx(ctx->propfind_cache);
ctx->propfind_cache = fetchCtx;
ctx->propfind_cache->ref++;
return fetchCtx;
}
static struct listdir_context *fetch_resource_list_attempts(const char *uri, int depth)
static struct listdir_context *fetch_resource_list_attempts(csync_owncloud_ctx_t *ctx, const char *uri, int depth)
{
int i;
struct listdir_context *fetchCtx = NULL;
for(i = 0; i < 10; ++i) {
fetchCtx = fetch_resource_list(uri, depth);
fetchCtx = fetch_resource_list(ctx, uri, depth);
if(fetchCtx) break;
/* only loop in case the content is not XML formatted. Otherwise for every
* non successful stat (for non existing directories) its tried 10 times. */
@@ -764,165 +644,39 @@ static struct listdir_context *fetch_resource_list_attempts(const char *uri, int
return fetchCtx;
}
static void fill_stat_cache( csync_vio_file_stat_t *lfs ) {
if( _stat_cache.name ) SAFE_FREE(_stat_cache.name);
if( _stat_cache.etag ) SAFE_FREE(_stat_cache.etag );
if( !lfs) return;
_stat_cache.name = c_strdup(lfs->name);
_stat_cache.mtime = lfs->mtime;
_stat_cache.fields = lfs->fields;
_stat_cache.type = lfs->type;
_stat_cache.size = lfs->size;
csync_vio_file_stat_set_file_id(&_stat_cache, lfs->file_id);
if( lfs->etag ) {
_stat_cache.etag = c_strdup(lfs->etag);
}
}
/*
* file functions
*/
int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf) {
/* get props:
* modtime
* creattime
* size
*/
csync_vio_file_stat_t *lfs = NULL;
struct listdir_context *fetchCtx = NULL;
char *decodedUri = NULL;
int len = 0;
errno = 0;
buf->name = c_basename(uri);
if (buf->name == NULL) {
errno = ENOMEM;
return -1;
}
if( _stat_cache.name && strcmp( buf->name, _stat_cache.name ) == 0 ) {
buf->fields = CSYNC_VIO_FILE_STAT_FIELDS_NONE;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_MTIME;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERMISSIONS;
buf->fields = _stat_cache.fields;
buf->type = _stat_cache.type;
buf->mtime = _stat_cache.mtime;
buf->size = _stat_cache.size;
buf->mode = _stat_perms( _stat_cache.type );
buf->etag = NULL;
if( _stat_cache.etag ) {
buf->etag = c_strdup( _stat_cache.etag );
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ETAG;
}
csync_vio_file_stat_set_file_id( buf, _stat_cache.file_id );
return 0;
}
DEBUG_WEBDAV("owncloud_stat => Could not find in stat cache %s", uri);
/* fetch data via a propfind call. */
/* fetchCtx = fetch_resource_list( uri, NE_DEPTH_ONE); */
fetchCtx = fetch_resource_list_attempts( uri, NE_DEPTH_ONE);
DEBUG_WEBDAV("=> Errno after fetch resource list for %s: %d", uri, errno);
if (!fetchCtx) {
return -1;
}
if( fetchCtx ) {
struct resource *res = fetchCtx->list;
while( res ) {
/* remove trailing slashes */
len = strlen(res->uri);
while( len > 0 && res->uri[len-1] == '/' ) --len;
decodedUri = ne_path_unescape( fetchCtx->target ); /* allocates memory */
/* Only do the comparaison of the part of the string without the trailing
slashes, and make sure decodedUri is not too large */
if( strncmp(res->uri, decodedUri, len ) == 0 && decodedUri[len] == '\0') {
SAFE_FREE( decodedUri );
break;
}
res = res->next;
SAFE_FREE( decodedUri );
}
if( res ) {
DEBUG_WEBDAV("Working on file %s", res->name );
} else {
DEBUG_WEBDAV("ERROR: Result struct not valid!");
}
lfs = resourceToFileStat( res );
if( lfs ) {
buf->fields = CSYNC_VIO_FILE_STAT_FIELDS_NONE;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_MTIME;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERMISSIONS;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ETAG;
buf->fields = lfs->fields;
buf->type = lfs->type;
buf->mtime = lfs->mtime;
buf->size = lfs->size;
buf->mode = _stat_perms( lfs->type );
buf->etag = NULL;
if( lfs->etag ) {
buf->etag = c_strdup( lfs->etag );
}
csync_vio_file_stat_set_file_id( buf, lfs->file_id );
/* fill the static stat buf as input for the stat function */
csync_vio_file_stat_destroy( lfs );
}
free_fetchCtx( fetchCtx );
}
DEBUG_WEBDAV("STAT result from propfind: %s, mtime: %llu", buf->name ? buf->name:"NULL",
(unsigned long long) buf->mtime );
return 0;
}
/*
* directory functions
*/
csync_vio_handle_t *owncloud_opendir(const char *uri) {
csync_vio_handle_t *owncloud_opendir(CSYNC *ctx, const char *uri) {
struct listdir_context *fetchCtx = NULL;
char *curi = NULL;
DEBUG_WEBDAV("opendir method called on %s", uri );
if (dav_connect( uri ) < 0) {
if (dav_connect( ctx->owncloud_context, uri ) < 0) {
DEBUG_WEBDAV("connection failed");
return NULL;
}
curi = _cleanPath( uri );
if (is_first_propfind && !dav_session.no_recursive_propfind) {
is_first_propfind = false;
if (ctx->owncloud_context->is_first_propfind && !ctx->owncloud_context->dav_session.no_recursive_propfind) {
ctx->owncloud_context->is_first_propfind = false;
// Try to fill it
fill_recursive_propfind_cache(uri, curi);
fill_recursive_propfind_cache(ctx->owncloud_context, uri, curi);
}
if (propfind_recursive_cache) {
if (ctx->owncloud_context->propfind_recursive_cache) {
// Try to fetch from recursive cache (if we have one)
fetchCtx = get_listdir_context_from_recursive_cache(curi);
fetchCtx = get_listdir_context_from_recursive_cache(ctx->owncloud_context, curi);
}
SAFE_FREE(curi);
is_first_propfind = false;
ctx->owncloud_context->is_first_propfind = false;
if (fetchCtx) {
return fetchCtx;
}
/* fetchCtx = fetch_resource_list( uri, NE_DEPTH_ONE ); */
fetchCtx = fetch_resource_list_attempts( uri, NE_DEPTH_ONE);
fetchCtx = fetch_resource_list_attempts( ctx->owncloud_context, uri, NE_DEPTH_ONE);
if( !fetchCtx ) {
/* errno is set properly in fetch_resource_list */
DEBUG_WEBDAV("Errno set to %d", errno);
@@ -935,17 +689,16 @@ csync_vio_handle_t *owncloud_opendir(const char *uri) {
/* no freeing of curi because its part of the fetchCtx and gets freed later */
}
int owncloud_closedir(csync_vio_handle_t *dhandle) {
int owncloud_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
struct listdir_context *fetchCtx = dhandle;
free_fetchCtx(fetchCtx);
(void)ctx;
return 0;
}
csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle) {
csync_vio_file_stat_t *owncloud_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
struct listdir_context *fetchCtx = dhandle;
(void)ctx;
// DEBUG_WEBDAV("owncloud_readdir" );
// DEBUG_WEBDAV("owncloud_readdir %s ", fetchCtx->target);
@@ -971,8 +724,10 @@ csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle) {
*/
escaped_path = ne_path_escape( currResource->uri );
if (ne_path_compare(fetchCtx->target, escaped_path) != 0) {
csync_vio_file_stat_t* lfs = resourceToFileStat(currResource);
fill_stat_cache(lfs);
// Convert the resource for the caller
csync_vio_file_stat_t* lfs = csync_vio_file_stat_new();
resourceToFileStat(lfs, currResource);
SAFE_FREE( escaped_path );
return lfs;
}
@@ -984,39 +739,56 @@ csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle) {
return NULL;
}
char *owncloud_error_string(void)
char *owncloud_error_string(CSYNC* ctx)
{
return dav_session.error_string;
return ctx->owncloud_context->dav_session.error_string;
}
int owncloud_commit(void) {
int owncloud_commit(CSYNC* ctx) {
if (!ctx->owncloud_context) {
return 0;
}
clean_caches();
clear_propfind_recursive_cache(ctx->owncloud_context);
if( dav_session.ctx ) {
ne_forget_auth(dav_session.ctx);
ne_session_destroy( dav_session.ctx );
}
free_fetchCtx(ctx->owncloud_context->propfind_cache);
ctx->owncloud_context->propfind_cache = NULL;
if( ctx->owncloud_context->dav_session.ctx ) {
ne_forget_auth(ctx->owncloud_context->dav_session.ctx);
ne_session_destroy(ctx->owncloud_context->dav_session.ctx );
ctx->owncloud_context->dav_session.ctx = 0;
}
ctx->owncloud_context->is_first_propfind = true;
ctx->owncloud_context->dav_session.no_recursive_propfind = true;
/* DEBUG_WEBDAV( "********** vio_module_shutdown" ); */
dav_session.ctx = 0;
ctx->owncloud_context->dav_session.ctx = 0;
// ne_sock_exit();
_connected = 0; /* triggers dav_connect to go through the whole neon setup */
ctx->owncloud_context->_connected = 0; /* triggers dav_connect to go through the whole neon setup */
SAFE_FREE( dav_session.user );
SAFE_FREE( dav_session.pwd );
SAFE_FREE( dav_session.session_key);
SAFE_FREE( dav_session.error_string );
SAFE_FREE( ctx->owncloud_context->dav_session.user );
SAFE_FREE( ctx->owncloud_context->dav_session.pwd );
SAFE_FREE( ctx->owncloud_context->dav_session.session_key);
SAFE_FREE( ctx->owncloud_context->dav_session.error_string );
return 0;
}
int owncloud_set_property(const char *key, void *data) {
void owncloud_destroy(CSYNC* ctx)
{
owncloud_commit(ctx);
SAFE_FREE(ctx->owncloud_context);
ctx->owncloud_context = 0;
}
int owncloud_set_property(CSYNC* ctx, const char *key, void *data) {
#define READ_STRING_PROPERTY(P) \
if (c_streq(key, #P)) { \
SAFE_FREE(dav_session.P); \
dav_session.P = c_strdup((const char*)data); \
SAFE_FREE(ctx->owncloud_context->dav_session.P); \
ctx->owncloud_context->dav_session.P = c_strdup((const char*)data); \
return 0; \
}
READ_STRING_PROPERTY(session_key)
@@ -1027,48 +799,43 @@ int owncloud_set_property(const char *key, void *data) {
#undef READ_STRING_PROPERTY
if (c_streq(key, "proxy_port")) {
dav_session.proxy_port = *(int*)(data);
ctx->owncloud_context->dav_session.proxy_port = *(int*)(data);
return 0;
}
if (c_streq(key, "read_timeout") || c_streq(key, "timeout")) {
dav_session.read_timeout = *(int*)(data);
return 0;
}
if( c_streq(key, "csync_context")) {
dav_session.csync_ctx = data;
ctx->owncloud_context->dav_session.read_timeout = *(int*)(data);
return 0;
}
if( c_streq(key, "get_dav_session")) {
/* Give the ne_session to the caller */
*(ne_session**)data = dav_session.ctx;
*(ne_session**)data = ctx->owncloud_context->dav_session.ctx;
return 0;
}
if( c_streq(key, "no_recursive_propfind")) {
dav_session.no_recursive_propfind = *(bool*)(data);
ctx->owncloud_context->dav_session.no_recursive_propfind = *(bool*)(data);
return 0;
}
if( c_streq(key, "redirect_callback")) {
if (data) {
csync_owncloud_redirect_callback_t* cb_wrapper = data;
dav_session.redir_callback = *cb_wrapper;
ctx->owncloud_context->dav_session.redir_callback = *cb_wrapper;
} else {
dav_session.redir_callback = NULL;
ctx->owncloud_context->dav_session.redir_callback = NULL;
}
}
return -1;
}
void owncloud_init(void *userdata) {
void owncloud_init(CSYNC* ctx) {
_userdata = userdata;
_connected = 0; /* triggers dav_connect to go through the whole neon setup */
memset(&dav_session, 0, sizeof(dav_session));
ctx->owncloud_context = c_malloc( sizeof( struct csync_owncloud_ctx_s ));
ctx->owncloud_context->csync_ctx = ctx; // back reference
ctx->owncloud_context->is_first_propfind = true;
/* Disable it, Mirall can enable it for the first sync (= no DB)*/
dav_session.no_recursive_propfind = true;
ctx->owncloud_context->dav_session.no_recursive_propfind = true;
}
/* vim: set ts=4 sw=4 et cindent: */

View File

@@ -21,159 +21,18 @@
#ifndef CSYNC_OWNCLOUD_H
#define CSYNC_OWNCLOUD_H
#include <errno.h>
#include <stdio.h>
#include <time.h>
#include <limits.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "config_csync.h"
#ifdef NEON_WITH_LFS /* Switch on LFS in libneon. Never remove the NE_LFS! */
#define NE_LFS
#endif
#include <neon/ne_basic.h>
#include <neon/ne_socket.h>
#include <neon/ne_session.h>
#include <neon/ne_request.h>
#include <neon/ne_props.h>
#include <neon/ne_auth.h>
#include <neon/ne_dates.h>
#include <neon/ne_compress.h>
#include <neon/ne_redirect.h>
#include "c_rbtree.h"
#include "c_lib.h"
#include "csync.h"
#include "csync_misc.h"
#include "csync_macros.h"
#include "c_private.h"
#include "httpbf.h"
#include "vio/csync_vio_file_stat.h"
#include "vio/csync_vio.h"
#include "csync_log.h"
#define DEBUG_WEBDAV(...) csync_log( 9, "oc_module", __VA_ARGS__);
enum resource_type {
resr_normal = 0,
resr_collection,
resr_reference,
resr_error
};
/* Struct to store data for each resource found during an opendir operation.
* It represents a single file entry.
*/
typedef struct resource {
char *uri; /* The complete uri */
char *name; /* The filename only */
enum resource_type type;
int64_t size;
time_t modtime;
char* md5;
char file_id[FILE_ID_BUF_SIZE+1];
struct resource *next;
} resource;
/* Struct to hold the context of a WebDAV PropFind operation to fetch
* a directory listing from the server.
*/
struct listdir_context {
struct resource *list; /* The list of result resources */
struct resource *currResource; /* A pointer to the current resource */
char *target; /* Request-URI of the PROPFIND */
unsigned int result_count; /* number of elements stored in list */
int ref; /* reference count, only destroy when it reaches 0 */
};
/* Our cache, key is a char* */
extern c_rbtree_t *propfind_recursive_cache;
/* Values are propfind_recursive_element: */
struct propfind_recursive_element {
struct resource *self;
struct resource *children;
struct propfind_recursive_element *parent;
};
typedef struct propfind_recursive_element propfind_recursive_element_t;
void clear_propfind_recursive_cache(void);
struct listdir_context *get_listdir_context_from_recursive_cache(const char *curi);
void fill_recursive_propfind_cache(const char *uri, const char *curi);
struct listdir_context *get_listdir_context_from_cache(const char *curi);
void fetch_resource_list_recursive(const char *uri, const char *curi);
typedef int (*csync_owncloud_redirect_callback_t)(CSYNC* ctx, const char* uri);
/* Struct with the WebDAV session */
struct dav_session_s {
ne_session *ctx;
char *user;
char *pwd;
char *proxy_type;
char *proxy_host;
int proxy_port;
char *proxy_user;
char *proxy_pwd;
char *session_key;
char *error_string;
int read_timeout;
CSYNC *csync_ctx;
bool no_recursive_propfind;
csync_owncloud_redirect_callback_t redir_callback;
};
extern struct dav_session_s dav_session;
/* The list of properties that is fetched in PropFind on a collection */
static const ne_propname ls_props[] = {
{ "DAV:", "getlastmodified" },
{ "DAV:", "getcontentlength" },
{ "DAV:", "resourcetype" },
{ "DAV:", "getetag"},
{ "http://owncloud.org/ns", "id"},
{ NULL, NULL }
};
void set_errno_from_http_errcode( int err );
void set_error_message( const char *msg );
void set_errno_from_neon_errcode( int neon_code );
int http_result_code_from_session(void);
void set_errno_from_session(void);
time_t oc_httpdate_parse( const char *date );
char *_cleanPath( const char* uri );
int _stat_perms( int type );
csync_vio_file_stat_t *resourceToFileStat( struct resource *res );
// Public API from vio
csync_vio_handle_t *owncloud_opendir(const char *uri);
csync_vio_file_stat_t *owncloud_readdir(csync_vio_handle_t *dhandle);
int owncloud_closedir(csync_vio_handle_t *dhandle);
int owncloud_stat(const char *uri, csync_vio_file_stat_t *buf);
int owncloud_commit(void);
char *owncloud_error_string(void);
void owncloud_init(void *userdata);
int owncloud_set_property(const char *key, void *data);
// Public API used by csync
csync_vio_handle_t *owncloud_opendir(CSYNC* ctx, const char *uri);
csync_vio_file_stat_t *owncloud_readdir(CSYNC* ctx, csync_vio_handle_t *dhandle);
int owncloud_closedir(CSYNC* ctx, csync_vio_handle_t *dhandle);
int owncloud_commit(CSYNC* ctx);
void owncloud_destroy(CSYNC* ctx);
char *owncloud_error_string(CSYNC* ctx);
void owncloud_init(CSYNC* ctx);
int owncloud_set_property(CSYNC* ctx, const char *key, void *data);
#endif /* CSYNC_OWNCLOUD_H */

View File

@@ -0,0 +1,201 @@
/*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2011 by Andreas Schneider <asn@cryptomilk.org>
* Copyright (c) 2012 by Klaas Freitag <freitag@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CSYNC_OWNCLOUD_PRIVATE_H
#define CSYNC_OWNCLOUD_PRIVATE_H
#include <errno.h>
#include <stdio.h>
#include <time.h>
#include <limits.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "config_csync.h"
#ifdef NEON_WITH_LFS /* Switch on LFS in libneon. Never remove the NE_LFS! */
#define NE_LFS
#endif
#include <neon/ne_basic.h>
#include <neon/ne_socket.h>
#include <neon/ne_session.h>
#include <neon/ne_request.h>
#include <neon/ne_props.h>
#include <neon/ne_auth.h>
#include <neon/ne_dates.h>
#include <neon/ne_compress.h>
#include <neon/ne_redirect.h>
#include "c_rbtree.h"
#include "c_lib.h"
#include "csync.h"
#include "csync_misc.h"
#include "csync_macros.h"
#include "c_private.h"
#include "httpbf.h"
#include "vio/csync_vio_file_stat.h"
#include "vio/csync_vio.h"
#include "csync_log.h"
#include "csync_owncloud.h"
#define DEBUG_WEBDAV(...) csync_log( 9, "oc_module", __VA_ARGS__);
typedef int (*csync_owncloud_redirect_callback_t)(CSYNC* ctx, const char* uri);
/* Struct with the WebDAV session */
struct dav_session_s {
ne_session *ctx;
char *user;
char *pwd;
char *proxy_type;
char *proxy_host;
int proxy_port;
char *proxy_user;
char *proxy_pwd;
char *session_key;
char *error_string;
int read_timeout;
bool no_recursive_propfind;
csync_owncloud_redirect_callback_t redir_callback;
};
struct csync_owncloud_ctx_s {
CSYNC *csync_ctx;
// For the PROPFIND results
bool is_first_propfind;
struct listdir_context *propfind_cache;
c_rbtree_t *propfind_recursive_cache;
int propfind_recursive_cache_depth;
int propfind_recursive_cache_file_count;
int propfind_recursive_cache_folder_count;
// For the WebDAV connection
struct dav_session_s dav_session; /* The DAV Session, initialised in dav_connect */
int _connected; /* flag to indicate if a connection exists, ie.
the dav_session is valid */
};
typedef struct csync_owncloud_ctx_s csync_owncloud_ctx_t;
//typedef csync_owncloud_ctx_t* csync_owncloud_ctx_p;
enum resource_type {
resr_normal = 0,
resr_collection,
resr_reference,
resr_error
};
/* The list of properties that is fetched in PropFind on a collection */
static const ne_propname ls_props[] = {
{ "DAV:", "getlastmodified" },
{ "DAV:", "getcontentlength" },
{ "DAV:", "resourcetype" },
{ "DAV:", "getetag"},
{ "http://owncloud.org/ns", "id"},
{ "http://owncloud.org/ns", "dDU"},
{ "http://owncloud.org/ns", "dDC"},
{ "http://owncloud.org/ns", "permissions"},
{ NULL, NULL }
};
/* Struct to store data for each resource found during an opendir operation.
* It represents a single file entry.
*/
typedef struct resource {
char *uri; /* The complete uri */
char *name; /* The filename only */
enum resource_type type;
int64_t size;
time_t modtime;
char* md5;
char file_id[FILE_ID_BUF_SIZE+1];
// Those two are optional from the server. We can use those URL to download the file directly
// without going through the ownCloud instance.
char *directDownloadUrl;
char *directDownloadCookies;
// See https://github.com/owncloud/core/issues/8322
char remotePerm[REMOTE_PERM_BUF_SIZE+1];
struct resource *next;
} resource;
/* Struct to hold the context of a WebDAV PropFind operation to fetch
* a directory listing from the server.
*/
struct listdir_context {
struct resource *list; /* The list of result resources */
struct resource *currResource; /* A pointer to the current resource */
char *target; /* Request-URI of the PROPFIND */
unsigned int result_count; /* number of elements stored in list */
int ref; /* reference count, only destroy when it reaches 0 */
};
/* Values are propfind_recursive_element: */
struct propfind_recursive_element {
struct resource *self;
struct resource *children;
struct propfind_recursive_element *parent;
};
typedef struct propfind_recursive_element propfind_recursive_element_t;
void clear_propfind_recursive_cache(csync_owncloud_ctx_t *ctx);
struct listdir_context *get_listdir_context_from_recursive_cache(csync_owncloud_ctx_t *ctx, const char *curi);
void fill_recursive_propfind_cache(csync_owncloud_ctx_t *ctx, const char *uri, const char *curi);
struct listdir_context *get_listdir_context_from_cache(csync_owncloud_ctx_t *ctx, const char *curi);
void fetch_resource_list_recursive(csync_owncloud_ctx_t *ctx, const char *uri, const char *curi);
void set_errno_from_http_errcode( int err );
void set_error_message( csync_owncloud_ctx_t *ctx, const char *msg );
void set_errno_from_neon_errcode(csync_owncloud_ctx_t *ctx, int neon_code );
int http_result_code_from_session(csync_owncloud_ctx_t *ctx);
void set_errno_from_session(csync_owncloud_ctx_t *ctx);
time_t oc_httpdate_parse( const char *date );
char *_cleanPath( const char* uri );
void fill_webdav_properties_into_resource(struct resource* newres, const ne_prop_result_set *set);
void resourceToFileStat( csync_vio_file_stat_t *lfs, struct resource *res );
void resource_free(struct resource* o);
struct resource* resource_dup(struct resource* o);
void free_fetchCtx( struct listdir_context *ctx );
const char* csync_owncloud_get_platform(void);
#endif // CSYNC_OWNCLOUD_PRIVATE_H

View File

@@ -20,42 +20,7 @@
*/
#include "csync_owncloud.h"
c_rbtree_t *propfind_recursive_cache = NULL;
int propfind_recursive_cache_depth = 0;
int propfind_recursive_cache_file_count = 0;
int propfind_recursive_cache_folder_count = 0;
static struct resource* resource_dup(struct resource* o) {
struct resource *r = c_malloc (sizeof( struct resource ));
ZERO_STRUCTP(r);
r->uri = c_strdup(o->uri);
r->name = c_strdup(o->name);
r->type = o->type;
r->size = o->size;
r->modtime = o->modtime;
if( o->md5 ) {
r->md5 = c_strdup(o->md5);
}
r->next = o->next;
csync_vio_set_file_id(r->file_id, o->file_id);
return r;
}
static void resource_free(struct resource* o) {
struct resource* old = NULL;
while (o)
{
old = o;
o = o->next;
SAFE_FREE(old->uri);
SAFE_FREE(old->name);
SAFE_FREE(old->md5);
SAFE_FREE(old);
}
}
#include "csync_owncloud_private.h"
static void _tree_destructor(void *data) {
propfind_recursive_element_t *element = data;
@@ -64,31 +29,34 @@ static void _tree_destructor(void *data) {
SAFE_FREE(element);
}
void clear_propfind_recursive_cache(void)
void clear_propfind_recursive_cache(csync_owncloud_ctx_t *ctx)
{
if (propfind_recursive_cache) {
if (ctx->propfind_recursive_cache) {
DEBUG_WEBDAV("clear_propfind_recursive_cache Invalidating..");
c_rbtree_destroy(propfind_recursive_cache, _tree_destructor);
propfind_recursive_cache = NULL;
c_rbtree_destroy(ctx->propfind_recursive_cache, _tree_destructor);
ctx->propfind_recursive_cache = NULL;
}
}
struct listdir_context *get_listdir_context_from_recursive_cache(const char *curi)
struct listdir_context *get_listdir_context_from_recursive_cache(csync_owncloud_ctx_t *ctx, const char *curi)
{
propfind_recursive_element_t *element = NULL;
struct listdir_context *fetchCtx = NULL;
struct resource *iterator, *r;
if (!propfind_recursive_cache) {
if (!ctx->propfind_recursive_cache) {
DEBUG_WEBDAV("get_listdir_context_from_recursive_cache No cache");
return NULL;
}
element = c_rbtree_node_data(c_rbtree_find(propfind_recursive_cache, curi));
element = c_rbtree_node_data(c_rbtree_find(ctx->propfind_recursive_cache, curi));
if (!element) {
DEBUG_WEBDAV("get_listdir_context_from_recursive_cache No element %s in cache found", curi);
return NULL;
}
if( ctx->csync_ctx->callbacks.update_callback ) {
ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
}
/* Out of the element, create a listdir_context.. if we could be sure that it is immutable, we could ref instead.. need to investigate */
fetchCtx = c_malloc( sizeof( struct listdir_context ));
@@ -128,84 +96,62 @@ static int _data_cmp(const void *a, const void *b) {
const propfind_recursive_element_t *elementB = b;
return ne_path_compare(elementA->self->uri, elementB->self->uri);
}
static void propfind_results_recursive(void *userdata,
static void propfind_results_recursive_callback(void *userdata,
const ne_uri *uri,
const ne_prop_result_set *set)
{
struct resource *newres = 0;
const char *clength, *modtime, *file_id = NULL;
const char *resourcetype = NULL;
const char *md5sum = NULL;
const ne_status *status = NULL;
char *path = ne_path_unescape( uri->path );
char *parentPath;
char *propfindRootUri = (char*) userdata;
propfind_recursive_element_t *element = NULL;
propfind_recursive_element_t *pElement = NULL;
int depth = 0;
csync_owncloud_ctx_t *ctx = (csync_owncloud_ctx_t*) userdata;
(void) status;
(void) propfindRootUri;
if (!propfind_recursive_cache) {
c_rbtree_create(&propfind_recursive_cache, _key_cmp, _data_cmp);
if (!ctx->propfind_recursive_cache) {
c_rbtree_create(&ctx->propfind_recursive_cache, _key_cmp, _data_cmp);
}
/* Fill the resource structure with the data about the file */
newres = c_malloc(sizeof(struct resource));
ZERO_STRUCTP(newres);
newres->uri = path; /* no need to strdup because ne_path_unescape already allocates */
newres->name = c_basename( path );
fill_webdav_properties_into_resource(newres, set);
modtime = ne_propset_value( set, &ls_props[0] );
clength = ne_propset_value( set, &ls_props[1] );
resourcetype = ne_propset_value( set, &ls_props[2] );
md5sum = ne_propset_value( set, &ls_props[3] );
file_id = ne_propset_value( set, &ls_props[4] );
newres->type = resr_normal;
if( resourcetype && strncmp( resourcetype, "<DAV:collection>", 16 ) == 0) {
newres->type = resr_collection;
propfind_recursive_cache_folder_count++;
if( newres->type == resr_collection) {
ctx->propfind_recursive_cache_folder_count++;
} else {
/* DEBUG_WEBDAV("propfind_results_recursive %s [%d]", newres->uri, newres->type); */
propfind_recursive_cache_file_count++;
ctx->propfind_recursive_cache_file_count++;
}
if (modtime) {
newres->modtime = oc_httpdate_parse(modtime);
}
/* DEBUG_WEBDAV("Parsing Modtime: %s -> %llu", modtime, (unsigned long long) newres->modtime ); */
newres->size = 0;
if (clength) {
newres->size = atoll(clength);
/* DEBUG_WEBDAV("Parsed File size for %s from %s: %lld", newres->name, clength, (long long)newres->size ); */
}
if( md5sum ) {
newres->md5 = csync_normalize_etag(md5sum);
}
csync_vio_set_file_id(newres->file_id, file_id);
/*
DEBUG_WEBDAV("propfind_results_recursive %s [%s] %s", newres->uri, newres->type == resr_collection ? "collection" : "file", newres->md5);
*/
/* Create new item in rb tree */
if (newres->type == resr_collection) {
DEBUG_WEBDAV("propfind_results_recursive %s is a folder", newres->uri);
/* Check if in rb tree */
element = c_rbtree_node_data(c_rbtree_find(propfind_recursive_cache,uri->path));
element = c_rbtree_node_data(c_rbtree_find(ctx->propfind_recursive_cache,uri->path));
/* If not, create a new item and insert it */
if (!element) {
element = c_malloc(sizeof(propfind_recursive_element_t));
element->self = resource_dup(newres);
element->self->next = 0;
element->children = NULL;
element->parent = NULL;
c_rbtree_insert(propfind_recursive_cache, element);
c_rbtree_insert(ctx->propfind_recursive_cache, element);
/* DEBUG_WEBDAV("results_recursive Added collection %s", newres->uri); */
// We do this here and in get_listdir_context_from_recursive_cache because
// a recursive PROPFIND might take some time but we still want to
// be informed. Later when get_listdir_context_from_recursive_cache is
// called the DB queries might be the problem causing slowness, so do it again there then.
if( ctx->csync_ctx->callbacks.update_callback ) {
ctx->csync_ctx->callbacks.update_callback(false, path, ctx->csync_ctx->callbacks.update_callback_userdata);
}
}
}
@@ -214,7 +160,7 @@ static void propfind_results_recursive(void *userdata,
if (parentPath) {
propfind_recursive_element_t *parentElement = NULL;
parentElement = c_rbtree_node_data(c_rbtree_find(propfind_recursive_cache,parentPath));
parentElement = c_rbtree_node_data(c_rbtree_find(ctx->propfind_recursive_cache,parentPath));
free(parentPath);
if (parentElement) {
@@ -230,9 +176,9 @@ static void propfind_results_recursive(void *userdata,
depth++;
pElement = pElement->parent;
}
if (depth > propfind_recursive_cache_depth) {
if (depth > ctx->propfind_recursive_cache_depth) {
DEBUG_WEBDAV("propfind_results_recursive %s new maximum tree depth %d", newres->uri, depth);
propfind_recursive_cache_depth = depth;
ctx->propfind_recursive_cache_depth = depth;
}
/* DEBUG_WEBDAV("results_recursive Added child %s to collection %s", newres->uri, element->self->uri); */
@@ -244,7 +190,7 @@ static void propfind_results_recursive(void *userdata,
newres = NULL;
}
void fetch_resource_list_recursive(const char *uri, const char *curi)
void fetch_resource_list_recursive(csync_owncloud_ctx_t *ctx, const char *uri, const char *curi)
{
int ret = 0;
ne_propfind_handler *hdl = NULL;
@@ -254,12 +200,15 @@ void fetch_resource_list_recursive(const char *uri, const char *curi)
int depth = NE_DEPTH_INFINITE;
DEBUG_WEBDAV("fetch_resource_list_recursive Starting recursive propfind %s %s", uri, curi);
if( ctx->csync_ctx->callbacks.update_callback ) {
ctx->csync_ctx->callbacks.update_callback(false, curi, ctx->csync_ctx->callbacks.update_callback_userdata);
}
/* do a propfind request and parse the results in the results function, set as callback */
hdl = ne_propfind_create(dav_session.ctx, curi, depth);
hdl = ne_propfind_create(ctx->dav_session.ctx, curi, depth);
if(hdl) {
ret = ne_propfind_named(hdl, ls_props, propfind_results_recursive, (void*)curi);
ret = ne_propfind_named(hdl, ls_props, propfind_results_recursive_callback, ctx);
request = ne_propfind_get_request( hdl );
req_status = ne_get_status( request );
}
@@ -271,14 +220,14 @@ void fetch_resource_list_recursive(const char *uri, const char *curi)
DEBUG_WEBDAV("ERROR: Request failed: status %d (%s)", req_status->code,
req_status->reason_phrase);
ret = NE_CONNECT;
set_error_message(req_status->reason_phrase);
set_error_message(ctx, req_status->reason_phrase);
}
DEBUG_WEBDAV("Recursive propfind result code %d.", req_status ? req_status->code : 0);
} else {
if( ret == NE_ERROR && req_status->code == 404) {
errno = ENOENT;
} else {
set_errno_from_neon_errcode(ret);
set_errno_from_neon_errcode(ctx, ret);
}
}
@@ -293,7 +242,7 @@ void fetch_resource_list_recursive(const char *uri, const char *curi)
DEBUG_WEBDAV("ERROR: Content type of propfind request not XML: %s.",
content_type ? content_type: "<empty>");
errno = ERRNO_WRONG_CONTENT;
set_error_message("Server error: PROPFIND reply is not XML formatted!");
set_error_message(ctx, "Server error: PROPFIND reply is not XML formatted!");
ret = NE_CONNECT;
}
}
@@ -301,7 +250,7 @@ void fetch_resource_list_recursive(const char *uri, const char *curi)
if( ret != NE_OK ) {
const char *err = NULL;
err = ne_get_error( dav_session.ctx );
err = ne_get_error( ctx->dav_session.ctx );
DEBUG_WEBDAV("WRN: propfind named failed with %d, request error: %s", ret, err ? err : "<nil>");
}
@@ -316,22 +265,21 @@ void fetch_resource_list_recursive(const char *uri, const char *curi)
}
/* Called by owncloud_opendir()->fetch_resource_list() to fill the cache */
extern struct listdir_context *propfind_cache;
void fill_recursive_propfind_cache(const char *uri, const char *curi) {
fetch_resource_list_recursive(uri, curi);
void fill_recursive_propfind_cache(csync_owncloud_ctx_t *ctx, const char *uri, const char *curi) {
fetch_resource_list_recursive(ctx, uri, curi);
if (propfind_recursive_cache_depth <= 2) {
if (ctx->propfind_recursive_cache_depth <= 2) {
DEBUG_WEBDAV("fill_recursive_propfind_cache %s Server maybe did not give us an 'infinity' depth result", curi);
/* transform the cache to the normal cache in propfind_cache */
propfind_cache = get_listdir_context_from_recursive_cache(curi);
ctx->propfind_cache = get_listdir_context_from_recursive_cache(ctx, curi);
/* clear the cache, it is bogus since the server returned only results for Depth 1 */
clear_propfind_recursive_cache();
clear_propfind_recursive_cache(ctx);
} else {
DEBUG_WEBDAV("fill_recursive_propfind_cache %s We received %d elements deep for 'infinity' depth (%d folders, %d files)",
curi,
propfind_recursive_cache_depth,
propfind_recursive_cache_folder_count,
propfind_recursive_cache_file_count);
ctx->propfind_recursive_cache_depth,
ctx->propfind_recursive_cache_folder_count,
ctx->propfind_recursive_cache_file_count);
}
}

View File

@@ -20,13 +20,15 @@
*/
#include "csync_owncloud.h"
#include "csync_owncloud_private.h"
#include "csync_misc.h"
void set_error_message( const char *msg )
void set_error_message( csync_owncloud_ctx_t *ctx, const char *msg )
{
SAFE_FREE(dav_session.error_string);
SAFE_FREE(ctx->dav_session.error_string);
if( msg )
dav_session.error_string = c_strdup(msg);
ctx->dav_session.error_string = c_strdup(msg);
}
void set_errno_from_http_errcode( int err ) {
@@ -104,12 +106,12 @@ void set_errno_from_http_errcode( int err ) {
errno = new_errno;
}
int http_result_code_from_session() {
const char *p = ne_get_error( dav_session.ctx );
int http_result_code_from_session(csync_owncloud_ctx_t *ctx) {
const char *p = ne_get_error( ctx->dav_session.ctx );
char *q;
int err;
set_error_message(p); /* remember the error message */
set_error_message(ctx, p); /* remember the error message */
err = strtol(p, &q, 10);
if (p == q) {
@@ -118,8 +120,8 @@ int http_result_code_from_session() {
return err;
}
void set_errno_from_session() {
int err = http_result_code_from_session();
void set_errno_from_session(csync_owncloud_ctx_t *ctx) {
int err = http_result_code_from_session(ctx);
if( err == EIO || err == ERRNO_ERROR_STRING) {
errno = err;
@@ -128,7 +130,7 @@ void set_errno_from_session() {
}
}
void set_errno_from_neon_errcode( int neon_code ) {
void set_errno_from_neon_errcode(csync_owncloud_ctx_t *ctx, int neon_code ) {
if( neon_code != NE_OK ) {
DEBUG_WEBDAV("Neon error code was %d", neon_code);
@@ -137,7 +139,7 @@ void set_errno_from_neon_errcode( int neon_code ) {
switch(neon_code) {
case NE_OK: /* Success, but still the possiblity of problems */
case NE_ERROR: /* Generic error; use ne_get_error(session) for message */
set_errno_from_session(); /* Something wrong with http communication */
set_errno_from_session(ctx); /* Something wrong with http communication */
break;
case NE_LOOKUP: /* Server or proxy hostname lookup failed */
errno = ERRNO_LOOKUP_ERROR;
@@ -279,19 +281,9 @@ time_t oc_httpdate_parse( const char *date ) {
/*
* helper: convert a resource struct to file_stat struct.
*/
csync_vio_file_stat_t *resourceToFileStat( struct resource *res )
void resourceToFileStat(csync_vio_file_stat_t *lfs, struct resource *res )
{
csync_vio_file_stat_t *lfs = NULL;
if( ! res ) {
return NULL;
}
lfs = c_malloc(sizeof(csync_vio_file_stat_t));
if (lfs == NULL) {
errno = ENOMEM;
return NULL;
}
ZERO_STRUCTP(lfs);
lfs->name = c_strdup( res->name );
@@ -312,30 +304,179 @@ csync_vio_file_stat_t *resourceToFileStat( struct resource *res )
lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
if( res->md5 ) {
lfs->etag = c_strdup(res->md5);
lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ETAG;
}
lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ETAG;
csync_vio_file_stat_set_file_id(lfs, res->file_id);
return lfs;
}
/* WebDAV does not deliver permissions. Set a default here. */
int _stat_perms( int type ) {
int ret = 0;
if( type == CSYNC_VIO_FILE_TYPE_DIRECTORY ) {
/* DEBUG_WEBDAV("Setting mode in stat (dir)"); */
/* directory permissions */
ret = S_IFDIR | S_IRUSR | S_IWUSR | S_IXUSR /* directory, rwx for user */
| S_IRGRP | S_IXGRP /* rx for group */
| S_IROTH | S_IXOTH; /* rx for others */
} else {
/* regualar file permissions */
/* DEBUG_WEBDAV("Setting mode in stat (file)"); */
ret = S_IFREG | S_IRUSR | S_IWUSR /* regular file, user read & write */
| S_IRGRP /* group read perm */
| S_IROTH; /* others read perm */
if (res->directDownloadUrl) {
lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_DIRECTDOWNLOADURL;
lfs->directDownloadUrl = c_strdup(res->directDownloadUrl);
}
if (res->directDownloadCookies) {
lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_DIRECTDOWNLOADCOOKIES;
lfs->directDownloadCookies = c_strdup(res->directDownloadCookies);
}
if (strlen(res->remotePerm) > 0) {
lfs->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERM;
strncpy(lfs->remotePerm, res->remotePerm, sizeof(lfs->remotePerm));
}
return ret;
}
void fill_webdav_properties_into_resource(struct resource* newres, const ne_prop_result_set *set)
{
const char *clength, *modtime, *file_id = NULL;
const char *directDownloadUrl = NULL;
const char *directDownloadCookies = NULL;
const char *resourcetype = NULL;
const char *etag = NULL;
const char *perm = NULL;
modtime = ne_propset_value( set, &ls_props[0] );
clength = ne_propset_value( set, &ls_props[1] );
resourcetype = ne_propset_value( set, &ls_props[2] );
etag = ne_propset_value( set, &ls_props[3] );
file_id = ne_propset_value( set, &ls_props[4] );
directDownloadUrl = ne_propset_value( set, &ls_props[5] );
directDownloadCookies = ne_propset_value( set, &ls_props[6] );
// permission flags: Defined in https://github.com/owncloud/core/issues/8322
perm = ne_propset_value( set, &ls_props[7] );
if( resourcetype && strncmp( resourcetype, "<DAV:collection>", 16 ) == 0) {
newres->type = resr_collection;
} else {
newres->type = resr_normal;
}
if (modtime) {
newres->modtime = oc_httpdate_parse(modtime);
}
/* DEBUG_WEBDAV("Parsing Modtime: %s -> %llu", modtime, (unsigned long long) newres->modtime ); */
newres->size = 0;
if (clength) {
newres->size = atoll(clength);
/* DEBUG_WEBDAV("Parsed File size for %s from %s: %lld", newres->name, clength, (long long)newres->size ); */
}
if( etag ) {
newres->md5 = csync_normalize_etag(etag);
}
csync_vio_set_file_id(newres->file_id, file_id);
/*
DEBUG_WEBDAV("propfind_results_recursive %s [%s] %s", newres->uri, newres->type == resr_collection ? "collection" : "file", newres->md5);
*/
if (directDownloadUrl) {
newres->directDownloadUrl = c_strdup(directDownloadUrl);
}
if (directDownloadCookies) {
newres->directDownloadCookies = c_strdup(directDownloadCookies);
}
if (perm && !perm[0]) {
// special meaning for our code: server returned permissions but are empty
// meaning only reading is allowed for this resource
newres->remotePerm[0] = ' ';
// see _csync_detect_update()
} else if (perm && strlen(perm) < sizeof(newres->remotePerm)) {
strncpy(newres->remotePerm, perm, sizeof(newres->remotePerm));
} else {
// old server, keep newres->remotePerm empty
}
}
struct resource* resource_dup(struct resource* o) {
struct resource *r = c_malloc (sizeof( struct resource ));
ZERO_STRUCTP(r);
r->uri = c_strdup(o->uri);
r->name = c_strdup(o->name);
r->type = o->type;
r->size = o->size;
r->modtime = o->modtime;
if( o->md5 ) {
r->md5 = c_strdup(o->md5);
}
if (o->directDownloadUrl) {
r->directDownloadUrl = c_strdup(o->directDownloadUrl);
}
if (o->directDownloadCookies) {
r->directDownloadCookies = c_strdup(o->directDownloadCookies);
}
if (o->remotePerm) {
strncpy(r->remotePerm, o->remotePerm, sizeof(r->remotePerm));
}
r->next = o->next;
csync_vio_set_file_id(r->file_id, o->file_id);
return r;
}
void resource_free(struct resource* o) {
struct resource* old = NULL;
while (o)
{
old = o;
o = o->next;
SAFE_FREE(old->uri);
SAFE_FREE(old->name);
SAFE_FREE(old->md5);
SAFE_FREE(old->directDownloadUrl);
SAFE_FREE(old->directDownloadCookies);
SAFE_FREE(old);
}
}
void free_fetchCtx( struct listdir_context *ctx )
{
struct resource *newres, *res;
if( ! ctx ) return;
newres = ctx->list;
res = newres;
ctx->ref--;
if (ctx->ref > 0) return;
SAFE_FREE(ctx->target);
while( res ) {
SAFE_FREE(res->uri);
SAFE_FREE(res->name);
SAFE_FREE(res->md5);
memset( res->file_id, 0, FILE_ID_BUF_SIZE+1 );
SAFE_FREE(res->directDownloadUrl);
SAFE_FREE(res->directDownloadCookies);
newres = res->next;
SAFE_FREE(res);
res = newres;
}
SAFE_FREE(ctx);
}
// as per http://sourceforge.net/p/predef/wiki/OperatingSystems/
// extend as required
const char* csync_owncloud_get_platform() {
#if defined (_WIN32)
return "Windows";
#elif defined(__APPLE__)
return "Macintosh";
#elif defined(__gnu_linux__)
return "Linux";
#elif defined(__DragonFly__)
/* might also define __FreeBSD__ */
return "DragonFlyBSD";
#elif defined(__FreeBSD__)
return "FreeBSD";
#elif defined(__NetBSD__)
return "NetBSD";
#elif defined(__OpenBSD__)
return "OpenBSD";
#elif defined(sun) || defined(__sun)
return "Solaris";
#else
return "Unknown OS";
#endif
}

View File

@@ -61,18 +61,6 @@
*/
#define MAX_DEPTH 50
/**
* Maximum time difference between two replicas in seconds
*/
#define MAX_TIME_DIFFERENCE 10
/**
* Maximum size of a buffer for transfer
*/
#ifndef MAX_XFER_BUF_SIZE
#define MAX_XFER_BUF_SIZE (16 * 1024)
#endif
#define CSYNC_STATUS_INIT 1 << 0
#define CSYNC_STATUS_UPDATE 1 << 1
#define CSYNC_STATUS_RECONCILE 1 << 2
@@ -90,6 +78,8 @@ enum csync_replica_e {
typedef struct csync_file_stat_s csync_file_stat_t;
struct csync_owncloud_ctx_s; // csync_owncloud.c
/**
* @brief csync public structure
*/
@@ -97,6 +87,8 @@ struct csync_s {
struct {
csync_auth_callback auth_function;
void *userdata;
csync_update_callback update_callback;
void *update_callback_userdata;
} callbacks;
c_strlist_t *excludes;
@@ -104,11 +96,12 @@ struct csync_s {
char *file;
sqlite3 *db;
int exists;
int disabled;
sqlite3_stmt* by_hash_stmt;
sqlite3_stmt* by_fileid_stmt;
sqlite3_stmt* by_inode_stmt;
int lastReturnValue;
} statedb;
struct {
@@ -116,7 +109,6 @@ struct csync_s {
c_rbtree_t *tree;
c_list_t *list;
enum csync_replica_e type;
c_list_t *ignored_cleanup;
} local;
struct {
@@ -125,23 +117,13 @@ struct csync_s {
c_list_t *list;
enum csync_replica_e type;
int read_from_db;
c_list_t *ignored_cleanup;
} remote;
struct {
int sync_symbolic_links;
char *config_dir;
bool local_only_mode;
int timeout;
#if defined(HAVE_ICONV) && defined(WITH_ICONV)
iconv_t iconv_cd;
#endif
} options;
struct {
uid_t uid;
uid_t euid;
} pwd;
iconv_t iconv_cd;
} options;
#endif
/* replica we are currently walking */
enum csync_replica_e current;
@@ -162,6 +144,12 @@ struct csync_s {
volatile int abort;
void *rename_info;
int read_from_db_disabled;
struct csync_owncloud_ctx_s *owncloud_context;
/* hooks for checking the white list */
void *checkSelectiveSyncBlackListData;
int (*checkSelectiveSyncBlackListHook)(void*, const char*);
};
@@ -174,17 +162,20 @@ struct csync_file_stat_s {
int64_t size; /* u64 */
size_t pathlen; /* u64 */
uint64_t inode; /* u64 */
uid_t uid; /* u32 */
gid_t gid; /* u32 */
mode_t mode; /* u32 */
int nlink; /* u32 */
int type; /* u32 */
int child_modified;/*bool*/
int should_update_etag; /*bool */
int has_ignored_files; /*bool: specify that a directory, or child directory contains ignored files */
char *destpath; /* for renames */
const char *etag;
char file_id[FILE_ID_BUF_SIZE+1]; /* the ownCloud file id is fixed width of 21 byte. */
char *directDownloadUrl;
char *directDownloadCookies;
char remotePerm[REMOTE_PERM_BUF_SIZE+1];
CSYNC_STATUS error_status;
enum csync_instructions_e instruction; /* u32 */

View File

@@ -134,6 +134,15 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
break;
/* file has been removed on the opposite replica */
case CSYNC_INSTRUCTION_NONE:
if (cur->has_ignored_files) {
/* Do not remove a directory that has ignored files */
break;
}
if (cur->child_modified) {
/* re-create directory that has modified contents */
cur->instruction = CSYNC_INSTRUCTION_NEW;
break;
}
cur->instruction = CSYNC_INSTRUCTION_REMOVE;
break;
case CSYNC_INSTRUCTION_EVAL_RENAME:
@@ -184,6 +193,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
csync_vio_set_file_id( other->file_id, cur->file_id );
}
other->inode = cur->inode;
other->should_update_etag = true;
cur->instruction = CSYNC_INSTRUCTION_NONE;
} else if (other->instruction == CSYNC_INSTRUCTION_REMOVE) {
other->instruction = CSYNC_INSTRUCTION_RENAME;
@@ -193,6 +203,7 @@ static int _csync_merge_algorithm_visitor(void *obj, void *data) {
csync_vio_set_file_id( other->file_id, cur->file_id );
}
other->inode = cur->inode;
other->should_update_etag = true;
cur->instruction = CSYNC_INSTRUCTION_NONE;
} else if (other->instruction == CSYNC_INSTRUCTION_NEW) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "OOOO=> NEW detected in other tree!");

View File

@@ -50,6 +50,22 @@
#define BUF_SIZE 16
#define sqlite_open(A, B) sqlite3_open_v2(A,B, SQLITE_OPEN_READONLY+SQLITE_OPEN_NOMUTEX, NULL)
#define SQLTM_TIME 150000
#define SQLTM_COUNT 10
#define SQLITE_BUSY_HANDLED(F) if(1) { \
int n = 0; \
do { rc = F ; \
if( (rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED) ) { \
n++; \
usleep(SQLTM_TIME); \
} \
}while( (n < SQLTM_COUNT) && ((rc == SQLITE_BUSY) || (rc == SQLITE_LOCKED))); \
}
void csync_set_statedb_exists(CSYNC *ctx, int val) {
ctx->statedb.exists = val;
}
@@ -58,28 +74,6 @@ int csync_get_statedb_exists(CSYNC *ctx) {
return ctx->statedb.exists;
}
/* Set the hide attribute in win32. That makes it invisible in normal explorers */
static void _csync_win32_hide_file( const char *file ) {
#ifdef _WIN32
mbchar_t *fileName;
DWORD dwAttrs;
if( !file ) return;
fileName = c_utf8_to_locale( file );
dwAttrs = GetFileAttributesW(fileName);
if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
if (!(dwAttrs & FILE_ATTRIBUTE_HIDDEN)) {
SetFileAttributesW(fileName, dwAttrs | FILE_ATTRIBUTE_HIDDEN );
}
}
c_free_locale_string(fileName);
#else
(void) file;
#endif
}
static int _csync_check_db_integrity(sqlite3 *db) {
c_strlist_t *result = NULL;
int rc = -1;
@@ -95,85 +89,12 @@ static int _csync_check_db_integrity(sqlite3 *db) {
c_strlist_destroy(result);
}
return rc;
}
static int _csync_statedb_check(const char *statedb) {
int fd = -1, rc;
ssize_t r;
char buf[BUF_SIZE] = {0};
sqlite3 *db = NULL;
csync_stat_t sb;
mbchar_t *wstatedb = c_utf8_to_locale(statedb);
if (wstatedb == NULL) {
return -1;
}
/* check db version */
#ifdef _WIN32
_fmode = _O_BINARY;
#endif
fd = _topen(wstatedb, O_RDONLY);
if (fd >= 0) {
/* Check size. Size of zero is a valid database actually. */
rc = _tfstat(fd, &sb);
if (rc == 0) {
if (sb.st_size == 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Database size is zero byte!");
close(fd);
} else {
r = read(fd, (void *) buf, sizeof(buf) - 1);
close(fd);
if (r >= 0) {
buf[BUF_SIZE - 1] = '\0';
if (c_streq(buf, "SQLite format 3")) {
if (sqlite3_open(statedb, &db ) == SQLITE_OK) {
rc = _csync_check_db_integrity(db);
if( sqlite3_close(db) != 0 ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "WARN: sqlite3_close error!");
}
if( rc >= 0 ) {
/* everything is fine */
c_free_locale_string(wstatedb);
return 0;
}
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "Integrity check failed!");
} else {
/* resources need to be freed even when open failed */
sqlite3_close(db);
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "database corrupted, removing!");
}
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "sqlite version mismatch");
}
}
}
} else {
close(fd);
}
/* if it comes here, the database is broken and should be recreated. */
_tunlink(wstatedb);
if( sqlite3_threadsafe() == 0 ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "* WARNING: SQLite module is not threadsafe!");
rc = -1;
}
c_free_locale_string(wstatedb);
/* create database */
rc = sqlite3_open(statedb, &db);
if (rc == SQLITE_OK) {
sqlite3_close(db);
_csync_win32_hide_file(statedb);
return 1;
}
sqlite3_close(db);
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "sqlite3_open failed: %s %s", sqlite3_errmsg(db), statedb);
return -1;
return rc;
}
static int _csync_statedb_is_empty(sqlite3 *db) {
@@ -201,7 +122,6 @@ static void sqlite_profile( void *x, const char* sql, sqlite3_uint64 time)
int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb) {
int rc = -1;
int check_rc = -1;
c_strlist_t *result = NULL;
sqlite3 *db = NULL;
@@ -209,19 +129,15 @@ int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb) {
return -1;
}
/* csync_statedb_check tries to open the statedb and creates it in case
* its not there.
*/
check_rc = _csync_statedb_check(statedb);
if (check_rc < 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: checking csync database failed - bail out.");
rc = -1;
goto out;
if (ctx->statedb.db) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: DB already open");
return -1;
}
/* Open or create the temporary database */
if (sqlite3_open(statedb, &db) != SQLITE_OK) {
ctx->statedb.lastReturnValue = SQLITE_OK;
/* Openthe database */
if (sqlite_open(statedb, &db) != SQLITE_OK) {
const char *errmsg= sqlite3_errmsg(ctx->statedb.db);
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: Failed to sqlite3 open statedb - bail out: %s.",
errmsg ? errmsg : "<no sqlite3 errormsg>");
@@ -230,25 +146,45 @@ int csync_statedb_load(CSYNC *ctx, const char *statedb, sqlite3 **pdb) {
goto out;
}
/* If check_rc == 1 the database is new and empty as a result. */
if ((check_rc == 1) || _csync_statedb_is_empty(db)) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "statedb doesn't exist");
if (_csync_check_db_integrity(db) != 0) {
const char *errmsg= sqlite3_errmsg(db);
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "ERR: sqlite3 integrity check failed - bail out: %s.",
errmsg ? errmsg : "<no sqlite3 errormsg>");
rc = -1;
goto out;
}
if (_csync_statedb_is_empty(db)) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "statedb contents doesn't exist");
csync_set_statedb_exists(ctx, 0);
} else {
csync_set_statedb_exists(ctx, 1);
}
/* Print out the version */
//
result = csync_statedb_query(db, "SELECT sqlite_version();");
if (result && result->count >= 1) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "sqlite3 version \"%s\"", *result->vector);
}
c_strlist_destroy(result);
/* optimization for speeding up SQLite */
result = csync_statedb_query(db, "PRAGMA synchronous = FULL;");
result = csync_statedb_query(db, "PRAGMA synchronous = NORMAL;");
c_strlist_destroy(result);
result = csync_statedb_query(db, "PRAGMA case_sensitive_like = ON;");
c_strlist_destroy(result);
/* set a busy handler with 5 seconds timeout */
sqlite3_busy_timeout(db, 5000);
#ifndef NDEBUG
sqlite3_profile(db, sqlite_profile, 0 );
#endif
*pdb = db;
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "Success");
return 0;
out:
sqlite3_close(db);
@@ -263,22 +199,25 @@ int csync_statedb_close(CSYNC *ctx) {
}
/* deallocate query resources */
if( ctx->statedb.by_hash_stmt ) {
rc = sqlite3_finalize(ctx->statedb.by_hash_stmt);
ctx->statedb.by_hash_stmt = NULL;
}
if( ctx->statedb.by_fileid_stmt ) {
rc = sqlite3_finalize(ctx->statedb.by_fileid_stmt);
sqlite3_finalize(ctx->statedb.by_fileid_stmt);
ctx->statedb.by_fileid_stmt = NULL;
}
if( ctx->statedb.by_inode_stmt ) {
rc = sqlite3_finalize(ctx->statedb.by_inode_stmt);
if( ctx->statedb.by_hash_stmt ) {
sqlite3_finalize(ctx->statedb.by_hash_stmt);
ctx->statedb.by_hash_stmt = NULL;
}
if( ctx->statedb.by_inode_stmt) {
sqlite3_finalize(ctx->statedb.by_inode_stmt);
ctx->statedb.by_inode_stmt = NULL;
}
sqlite3_close(ctx->statedb.db);
ctx->statedb.lastReturnValue = SQLITE_OK;
int sr = sqlite3_close(ctx->statedb.db);
CSYNC_LOG(CSYNC_LOG_PRIORITY_NOTICE, "sqlite3_close=%d", sr);
ctx->statedb.db = 0;
return rc;
}
@@ -300,7 +239,7 @@ static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3
column_count = sqlite3_column_count(stmt);
rc = sqlite3_step(stmt);
SQLITE_BUSY_HANDLED( sqlite3_step(stmt) );
if( rc == SQLITE_ROW ) {
if(column_count > 7) {
@@ -322,8 +261,6 @@ static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3
name = (const char*) sqlite3_column_text(stmt, 2);
memcpy((*st)->path, (len ? name : ""), len + 1);
(*st)->inode = sqlite3_column_int64(stmt,3);
(*st)->uid = sqlite3_column_int(stmt, 4);
(*st)->gid = sqlite3_column_int(stmt, 5);
(*st)->mode = sqlite3_column_int(stmt, 6);
(*st)->modtime = strtoul((char*)sqlite3_column_text(stmt, 7), NULL, 10);
@@ -337,6 +274,15 @@ static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3
if(column_count > 10 && sqlite3_column_text(stmt,10)) {
csync_vio_set_file_id((*st)->file_id, (char*) sqlite3_column_text(stmt, 10));
}
if(column_count > 11 && sqlite3_column_text(stmt,11)) {
strncpy((*st)->remotePerm,
(char*) sqlite3_column_text(stmt, 11),
REMOTE_PERM_BUF_SIZE);
}
}
} else {
if( rc != SQLITE_DONE ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "WARN: Query results in %d", rc);
}
}
return rc;
@@ -356,7 +302,8 @@ csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx,
if( ctx->statedb.by_hash_stmt == NULL ) {
const char *hash_query = "SELECT * FROM metadata WHERE phash=?1";
rc = sqlite3_prepare_v2(ctx->statedb.db, hash_query, strlen(hash_query), &ctx->statedb.by_hash_stmt, NULL);
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, hash_query, strlen(hash_query), &ctx->statedb.by_hash_stmt, NULL));
ctx->statedb.lastReturnValue = rc;
if( rc != SQLITE_OK ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for hash query.");
return NULL;
@@ -369,8 +316,10 @@ csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx,
sqlite3_bind_int64(ctx->statedb.by_hash_stmt, 1, (long long signed int)phash);
if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt) < 0 ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata!");
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt);
ctx->statedb.lastReturnValue = rc;
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
}
sqlite3_reset(ctx->statedb.by_hash_stmt);
@@ -396,7 +345,8 @@ csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx,
if( ctx->statedb.by_fileid_stmt == NULL ) {
const char *query = "SELECT * FROM metadata WHERE fileid=?1";
rc = sqlite3_prepare_v2(ctx->statedb.db, query, strlen(query), &ctx->statedb.by_fileid_stmt, NULL);
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, query, strlen(query), &ctx->statedb.by_fileid_stmt, NULL));
ctx->statedb.lastReturnValue = rc;
if( rc != SQLITE_OK ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for file id query.");
return NULL;
@@ -406,8 +356,10 @@ csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx,
/* bind the query value */
sqlite3_bind_text(ctx->statedb.by_fileid_stmt, 1, file_id, -1, SQLITE_STATIC);
if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt) < 0 ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata!");
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt);
ctx->statedb.lastReturnValue = rc;
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
}
// clear the resources used by the statement.
sqlite3_reset(ctx->statedb.by_fileid_stmt);
@@ -433,7 +385,8 @@ csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx,
if( ctx->statedb.by_inode_stmt == NULL ) {
const char *inode_query = "SELECT * FROM metadata WHERE inode=?1";
rc = sqlite3_prepare_v2(ctx->statedb.db, inode_query, strlen(inode_query), &ctx->statedb.by_inode_stmt, NULL);
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, inode_query, strlen(inode_query), &ctx->statedb.by_inode_stmt, NULL));
ctx->statedb.lastReturnValue = rc;
if( rc != SQLITE_OK ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for inode query.");
return NULL;
@@ -446,8 +399,10 @@ csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx,
sqlite3_bind_int64(ctx->statedb.by_inode_stmt, 1, (long long signed int)inode);
if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt) < 0 ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode!");
rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt);
ctx->statedb.lastReturnValue = rc;
if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode: %d!", rc);
}
sqlite3_reset(ctx->statedb.by_inode_stmt);
@@ -476,7 +431,7 @@ char *csync_statedb_get_etag( CSYNC *ctx, uint64_t jHash ) {
return ret;
}
#define BELOW_PATH_QUERY "SELECT phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid FROM metadata WHERE path LIKE(?)"
#define BELOW_PATH_QUERY "SELECT phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm FROM metadata WHERE pathlen>? AND path LIKE(?)"
int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
int rc;
@@ -484,6 +439,7 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
int64_t cnt = 0;
char *likepath;
int asp;
int min_path_len;
if( !path ) {
return -1;
@@ -493,9 +449,10 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
return -1;
}
rc = sqlite3_prepare_v2(ctx->statedb.db, BELOW_PATH_QUERY, -1, &stmt, NULL);
SQLITE_BUSY_HANDLED(sqlite3_prepare_v2(ctx->statedb.db, BELOW_PATH_QUERY, -1, &stmt, NULL));
ctx->statedb.lastReturnValue = rc;
if( rc != SQLITE_OK ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for hash query.");
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Unable to create stmt for below path query.");
return -1;
}
@@ -509,10 +466,13 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
return -1;
}
sqlite3_bind_text(stmt, 1, likepath, -1, SQLITE_STATIC);
min_path_len = strlen(path);
sqlite3_bind_int(stmt, 1, min_path_len);
sqlite3_bind_text(stmt, 2, likepath, -1, SQLITE_STATIC);
cnt = 0;
ctx->statedb.lastReturnValue = rc;
do {
csync_file_stat_t *st = NULL;
@@ -528,6 +488,7 @@ int csync_statedb_get_below_path( CSYNC *ctx, const char *path ) {
}
} while( rc == SQLITE_ROW );
ctx->statedb.lastReturnValue = rc;
if( rc != SQLITE_DONE ) {
ctx->status_code = CSYNC_STATUS_TREE_ERROR;
} else {

View File

@@ -98,27 +98,6 @@ int csync_statedb_get_below_path(CSYNC *ctx, const char *path);
*/
c_strlist_t *csync_statedb_query(sqlite3 *db, const char *statement);
/**
* @brief Insert function for the statedb.
*
* @param ctx The csync context.
* @param statement The SQL statement to insert into the statedb.
*
* @return The rowid of the most recent INSERT on success, 0 if the query
* wasn't successful.
*/
typedef struct csync_progressinfo_s {
struct csync_progressinfo_s *next;
uint64_t phash;
uint64_t modtime;
char *md5;
int error;
int chunk;
int transferId;
char *tmpfile;
char *error_string;
} csync_progressinfo_t;
#ifdef __cplusplus
}
#endif

View File

@@ -100,6 +100,10 @@ static bool _csync_sameextension(const char *p1, const char *p2) {
}
#endif
static bool _last_db_return_error(CSYNC* ctx) {
return ctx->statedb.lastReturnValue != SQLITE_OK && ctx->statedb.lastReturnValue != SQLITE_DONE && ctx->statedb.lastReturnValue != SQLITE_ROW;
}
static int _csync_detect_update(CSYNC *ctx, const char *file,
const csync_vio_file_stat_t *fs, const int type) {
uint64_t h = 0;
@@ -146,21 +150,21 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
if (excluded != CSYNC_NOT_EXCLUDED) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "%s excluded (%d)", path, excluded);
if (excluded == CSYNC_FILE_EXCLUDE_AND_REMOVE) {
switch (ctx->current) {
case LOCAL_REPLICA:
ctx->local.ignored_cleanup = c_list_append(ctx->local.ignored_cleanup, c_strdup(path));
break;
case REMOTE_REPLICA:
ctx->remote.ignored_cleanup = c_list_append(ctx->remote.ignored_cleanup, c_strdup(path));
break;
default:
break;
}
return 0;
return 1;
}
if (excluded == CSYNC_FILE_SILENTLY_EXCLUDED) {
return 0;
return 1;
}
if (ctx->current_fs) {
ctx->current_fs->has_ignored_files = true;
}
}
if (ctx->current == REMOTE_REPLICA && ctx->checkSelectiveSyncBlackListHook) {
if (ctx->checkSelectiveSyncBlackListHook(ctx->checkSelectiveSyncBlackListData, path)) {
return 1;
}
}
h = _hash_of_file(ctx, file );
@@ -179,17 +183,26 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
st->instruction = CSYNC_INSTRUCTION_NONE;
st->etag = NULL;
st->child_modified = 0;
st->has_ignored_files = 0;
/* check hardlink count */
if (type == CSYNC_FTW_TYPE_FILE ) {
if( fs->nlink > 1) {
st->instruction = CSYNC_INSTRUCTION_IGNORE;
st->error_status = CSYNC_STATUS_INDIVIDUAL_IS_HARDLINK;
goto out;
}
if (fs->mtime == 0) {
tmp = csync_statedb_get_stat_by_hash(ctx, h);
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s - mtime is zero!", path);
tmp = csync_statedb_get_stat_by_hash(ctx, h);
if(_last_db_return_error(ctx)) {
SAFE_FREE(st);
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
return -1;
}
if (tmp == NULL) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s - not found in db, IGNORE!", path);
st->instruction = CSYNC_INSTRUCTION_IGNORE;
@@ -226,16 +239,28 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
if (csync_get_statedb_exists(ctx)) {
tmp = csync_statedb_get_stat_by_hash(ctx, h);
if(_last_db_return_error(ctx)) {
SAFE_FREE(st);
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
return -1;
}
if(tmp && tmp->phash == h ) { /* there is an entry in the database */
/* we have an update! */
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Database entry found, compare: %" PRId64 " <-> %" PRId64 ", etag: %s <-> %s, inode: %" PRId64 " <-> %" PRId64,
((int64_t) fs->mtime), ((int64_t) tmp->modtime), fs->etag, tmp->etag, (uint64_t) fs->inode, (uint64_t) tmp->inode);
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Database entry found, compare: %" PRId64 " <-> %" PRId64
", etag: %s <-> %s, inode: %" PRId64 " <-> %" PRId64
", size: %" PRId64 " <-> %" PRId64 ", perms: %s <-> %s",
((int64_t) fs->mtime), ((int64_t) tmp->modtime),
fs->etag, tmp->etag, (uint64_t) fs->inode, (uint64_t) tmp->inode,
(uint64_t) fs->size, (uint64_t) tmp->size, fs->remotePerm, tmp->remotePerm );
if( !fs->etag) {
st->instruction = CSYNC_INSTRUCTION_EVAL;
goto out;
}
if((ctx->current == REMOTE_REPLICA && !c_streq(fs->etag, tmp->etag ))
|| (ctx->current == LOCAL_REPLICA && (fs->mtime != tmp->modtime
// zero size in statedb can happen during migration
|| (tmp->size != 0 && fs->size != tmp->size)
#if 0
|| fs->inode != tmp->inode
#endif
@@ -254,20 +279,22 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
st->instruction = CSYNC_INSTRUCTION_EVAL;
goto out;
}
bool metadata_differ = (ctx->current == REMOTE_REPLICA && (!c_streq(fs->file_id, tmp->file_id)
|| !c_streq(fs->remotePerm, tmp->remotePerm)))
|| (ctx->current == LOCAL_REPLICA && fs->inode != tmp->inode);
if (type == CSYNC_FTW_TYPE_DIR && ctx->current == REMOTE_REPLICA
&& c_streq(fs->file_id, tmp->file_id) && !ctx->read_from_db_disabled) {
&& !metadata_differ && !ctx->read_from_db_disabled) {
/* If both etag and file id are equal for a directory, read all contents from
* the database.
* The comparison of file id ensure that we fetch all the file id when upgrading from
* owncloud 5 to owncloud 6.
* The metadata comparison ensure that we fetch all the file id or permission when
* upgrading owncloud
*/
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Reading from database: %s", path);
ctx->remote.read_from_db = true;
}
if (!c_streq(fs->file_id, tmp->file_id) && ctx->current == REMOTE_REPLICA) {
/* file id has changed. Which means we need to update the DB.
* (upgrade from owncloud 5 to owncloud 6 for instence) */
if (metadata_differ) {
/* file id or permissions has changed. Which means we need to update them in the DB. */
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Need to update metadata for: %s", path);
st->should_update_etag = true;
}
st->instruction = CSYNC_INSTRUCTION_NONE;
@@ -283,6 +310,12 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
tmp = csync_statedb_get_stat_by_inode(ctx, fs->inode);
if(_last_db_return_error(ctx)) {
SAFE_FREE(st);
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
return -1;
}
/* translate the file type between the two stat types csync has. */
if( tmp && tmp->type == 0 ) {
tmp_vio_type = CSYNC_VIO_FILE_TYPE_REGULAR;
@@ -313,6 +346,12 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
} else {
/* Remote Replica Rename check */
tmp = csync_statedb_get_stat_by_file_id(ctx, fs->file_id);
if(_last_db_return_error(ctx)) {
SAFE_FREE(st);
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
return -1;
}
if(tmp ) { /* tmp existing at all */
if ((tmp->type == CSYNC_FTW_TYPE_DIR && fs->type != CSYNC_VIO_FILE_TYPE_DIRECTORY) ||
(tmp->type == CSYNC_FTW_TYPE_FILE && fs->type != CSYNC_VIO_FILE_TYPE_REGULAR)) {
@@ -340,7 +379,9 @@ static int _csync_detect_update(CSYNC *ctx, const char *file,
}
}
} else {
st->instruction = CSYNC_INSTRUCTION_NEW;
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Unable to open statedb" );
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
return -1;
}
out:
@@ -364,8 +405,6 @@ out:
st->mode = fs->mode;
st->size = fs->size;
st->modtime = fs->mtime;
st->uid = fs->uid;
st->gid = fs->gid;
st->nlink = fs->nlink;
st->type = type;
st->etag = NULL;
@@ -374,6 +413,17 @@ out:
st->etag = c_strdup(fs->etag);
}
csync_vio_set_file_id(st->file_id, fs->file_id);
if (fs->fields & CSYNC_VIO_FILE_STAT_FIELDS_DIRECTDOWNLOADURL) {
SAFE_FREE(st->directDownloadUrl);
st->directDownloadUrl = c_strdup(fs->directDownloadUrl);
}
if (fs->fields & CSYNC_VIO_FILE_STAT_FIELDS_DIRECTDOWNLOADCOOKIES) {
SAFE_FREE(st->directDownloadCookies);
st->directDownloadCookies = c_strdup(fs->directDownloadCookies);
}
if (fs->fields & CSYNC_VIO_FILE_STAT_FIELDS_PERM) {
strncpy(st->remotePerm, fs->remotePerm, REMOTE_PERM_BUF_SIZE);
}
fastout: /* target if the file information is read from database into st */
st->phash = h;
@@ -419,11 +469,19 @@ int csync_walker(CSYNC *ctx, const char *file, const csync_vio_file_stat_t *fs,
switch (flag) {
case CSYNC_FTW_FLAG_FILE:
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s [file_id=%s]", file, fs->file_id);
if (ctx->current == REMOTE_REPLICA) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s [file_id=%s size=%" PRIu64 "]", file, fs->file_id, fs->size);
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "file: %s [inode=%" PRIu64 " size=%" PRIu64 "]", file, fs->inode, fs->size);
}
type = CSYNC_FTW_TYPE_FILE;
break;
case CSYNC_FTW_FLAG_DIR: /* enter directory */
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "directory: %s [file_id=%s]", file, fs->file_id);
if (ctx->current == REMOTE_REPLICA) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "directory: %s [file_id=%s]", file, fs->file_id);
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "directory: %s [inode=%" PRIu64 "]", file, fs->inode);
}
type = CSYNC_FTW_TYPE_DIR;
break;
case CSYNC_FTW_FLAG_NSTAT: /* not statable file */
@@ -523,6 +581,17 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
if (asp < 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "asprintf failed!");
}
} else if(errno == ERRNO_SERVICE_UNAVAILABLE) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Service was not available!");
if (ctx->current_fs) {
ctx->current_fs->instruction = CSYNC_INSTRUCTION_IGNORE;
ctx->current_fs->error_status = CSYNC_STATUS_SERVICE_UNAVAILABLE;
/* If a directory has ignored files, put the flag on the parent directory as well */
if( previous_fs ) {
previous_fs->has_ignored_files = true;
}
goto done;
}
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "opendir failed for %s - errno %d", uri, errno);
}
@@ -579,19 +648,27 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
path = filename + ulen;
/* skip ".csync_journal.db" and ".csync_journal.db.ctmp" */
/* Isn't this done via csync_exclude already? */
if (c_streq(path, ".csync_journal.db")
|| c_streq(path, ".csync_journal.db.ctmp")
|| c_streq(path, ".csync_journal.db.ctmp-journal")
|| c_streq(path, ".csync-progressdatabase")) {
|| c_streq(path, ".csync-progressdatabase")
|| c_streq(path, ".csync_journal.db-shm")
|| c_streq(path, ".csync_journal.db-wal")) {
csync_vio_file_stat_destroy(dirent);
dirent = NULL;
SAFE_FREE(filename);
continue;
}
/* == see if really stat has to be called. */
fs = csync_vio_file_stat_new();
res = csync_vio_stat(ctx, filename, fs);
/* Only for the local replica we have to stat(), for the remote one we have all data already */
if (ctx->replica == LOCAL_REPLICA) {
fs = csync_vio_file_stat_new();
res = csync_vio_stat(ctx, filename, fs);
} else {
fs = dirent;
res = 0;
}
if( res == 0) {
switch (fs->type) {
@@ -623,6 +700,11 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
uint64_t h = c_jhash64((uint8_t *) path, len, 0);
etag = csync_statedb_get_etag( ctx, h );
if(_last_db_return_error(ctx)) {
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
goto error;
}
if( etag ) {
SAFE_FREE(fs->etag);
fs->etag = etag;
@@ -642,12 +724,11 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
rc = fn(ctx, filename, fs, flag);
/* this function may update ctx->current and ctx->read_from_db */
if (ctx->current_fs && previous_fs && ctx->current_fs->child_modified) {
previous_fs->child_modified = ctx->current_fs->child_modified;
/* Only for the local replica we have to destroy stat(), for the remote one it is a pointer to dirent */
if (ctx->replica == LOCAL_REPLICA) {
csync_vio_file_stat_destroy(fs);
}
csync_vio_file_stat_destroy(fs);
if (rc < 0) {
if (CSYNC_STATUS_IS_OK(ctx->status_code)) {
ctx->status_code = CSYNC_STATUS_UPDATE_ERROR;
@@ -657,7 +738,7 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
goto error;
}
if (flag == CSYNC_FTW_FLAG_DIR && depth
if (flag == CSYNC_FTW_FLAG_DIR && depth && rc == 0
&& (!ctx->current_fs || ctx->current_fs->instruction != CSYNC_INSTRUCTION_IGNORE)) {
rc = csync_ftw(ctx, filename, fn, depth - 1);
if (rc < 0) {
@@ -670,12 +751,21 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
ctx->current_fs->instruction = CSYNC_INSTRUCTION_NONE;
ctx->current_fs->should_update_etag = true;
}
if (ctx->current_fs && previous_fs && ctx->current_fs->has_ignored_files) {
/* If a directory has ignored files, put the flag on the parent directory as well */
previous_fs->has_ignored_files = ctx->current_fs->has_ignored_files;
}
}
if (ctx->current_fs && previous_fs && ctx->current_fs->child_modified) {
/* If a directory has modified files, put the flag on the parent directory as well */
previous_fs->child_modified = ctx->current_fs->child_modified;
}
if (flag == CSYNC_FTW_FLAG_DIR && ctx->current_fs
&& (ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL ||
ctx->current_fs->instruction == CSYNC_INSTRUCTION_NEW ||
ctx->current_fs->instruction == CSYNC_INSTRUCTION_EVAL_RENAME)) {
ctx->current_fs->instruction == CSYNC_INSTRUCTION_NEW)) {
ctx->current_fs->should_update_etag = true;
}

View File

@@ -128,59 +128,6 @@ void csync_win32_set_file_hidden( const char *file, bool h ) {
#endif
}
csync_vio_file_stat_t *csync_vio_convert_file_stat(csync_file_stat_t *st) {
csync_vio_file_stat_t *vfs = NULL;
if (st == NULL) {
return NULL;
}
vfs = csync_vio_file_stat_new();
if (vfs == NULL) {
return NULL;
}
vfs->acl = NULL;
if (st->pathlen > 0) {
vfs->name = c_strdup(st->path);
}
vfs->uid = st->uid;
vfs->gid = st->gid;
vfs->atime = 0;
vfs->mtime = st->modtime;
vfs->ctime = 0;
vfs->size = st->size;
vfs->blksize = 0; /* Depricated. */
vfs->blkcount = 0;
vfs->mode = st->mode;
vfs->device = 0;
vfs->inode = st->inode;
vfs->nlink = st->nlink;
/* fields. */
vfs->fields = CSYNC_VIO_FILE_STAT_FIELDS_TYPE
+ CSYNC_VIO_FILE_STAT_FIELDS_PERMISSIONS
+ CSYNC_VIO_FILE_STAT_FIELDS_INODE
+ CSYNC_VIO_FILE_STAT_FIELDS_LINK_COUNT
+ CSYNC_VIO_FILE_STAT_FIELDS_SIZE
+ CSYNC_VIO_FILE_STAT_FIELDS_MTIME
+ CSYNC_VIO_FILE_STAT_FIELDS_UID
+ CSYNC_VIO_FILE_STAT_FIELDS_GID;
if (st->type == CSYNC_FTW_TYPE_DIR)
vfs->type = CSYNC_VIO_FILE_TYPE_DIRECTORY;
else if (st->type == CSYNC_FTW_TYPE_FILE)
vfs->type = CSYNC_VIO_FILE_TYPE_REGULAR;
else if (st->type == CSYNC_FTW_TYPE_SLINK)
vfs->type = CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK;
else
vfs->type = CSYNC_VIO_FILE_TYPE_UNKNOWN;
return vfs;
}
bool (*csync_file_locked_or_open_ext) (const char*) = 0; // filled in by library user
void set_csync_file_locked_or_open_ext(bool (*f) (const char*));
void set_csync_file_locked_or_open_ext(bool (*f) (const char*)) {
@@ -193,7 +140,9 @@ bool csync_file_locked_or_open( const char *dir, const char *fname) {
if (!csync_file_locked_or_open_ext) {
return false;
}
asprintf(&tmp_uri, "%s/%s", dir, fname);
if (asprintf(&tmp_uri, "%s/%s", dir, fname) < 0) {
return -1;
}
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "csync_file_locked_or_open %s", tmp_uri);
ret = csync_file_locked_or_open_ext(tmp_uri);
SAFE_FREE(tmp_uri);

View File

@@ -32,8 +32,5 @@ void csync_memstat_check(void);
void csync_win32_set_file_hidden( const char *file, bool hidden );
/* Convert a csync_file_stat_t to csync_vio_file_stat_t */
csync_vio_file_stat_t *csync_vio_convert_file_stat(csync_file_stat_t *st);
bool csync_file_locked_or_open( const char *dir, const char *fname);
#endif /* _CSYNC_UTIL_H */

View File

@@ -96,6 +96,7 @@ hbf_transfer_t *hbf_init_transfer( const char *dest_uri ) {
transfer->block_size = DEFAULT_BLOCK_SIZE;
transfer->threshold = transfer->block_size;
transfer->modtime_accepted = 0;
transfer->oc_header_modtime = 0;
return transfer;
}
@@ -491,8 +492,8 @@ Hbf_State hbf_transfer( ne_session *session, hbf_transfer_t *transfer, const cha
snprintf(buf, sizeof(buf), "%"PRId64, transfer->stat_size);
ne_add_request_header(req, "OC-Total-Length", buf);
if( transfer->modtime > 0 ) {
snprintf(buf, sizeof(buf), "%"PRId64, transfer->modtime);
if( transfer->oc_header_modtime > 0 ) {
snprintf(buf, sizeof(buf), "%"PRId64, transfer->oc_header_modtime);
ne_add_request_header(req, "X-OC-Mtime", buf);
}

View File

@@ -92,6 +92,7 @@ struct hbf_transfer_s {
int64_t stat_size;
time_t modtime;
time_t oc_header_modtime;
int64_t block_size;
int64_t threshold;

View File

@@ -20,8 +20,6 @@ set(CSTDLIB_LINK_LIBRARIES
set(cstdlib_SRCS
c_alloc.c
c_dir.c
c_file.c
c_list.c
c_path.c
c_rbtree.c

View File

@@ -1,189 +0,0 @@
/*
* cynapses libc functions
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "c_private.h"
#include "c_macro.h"
#include "c_alloc.h"
#include "c_dir.h"
#include "c_string.h"
int c_mkdirs(const char *path, mode_t mode) {
int tmp;
csync_stat_t sb;
mbchar_t *wpath = c_utf8_to_locale(path);
mbchar_t *swpath = NULL;
if (path == NULL) {
errno = EINVAL;
return -1;
}
if (_tstat(wpath, &sb) == 0) {
if (! S_ISDIR(sb.st_mode)) {
errno = ENOTDIR;
c_free_locale_string(wpath);
return -1;
}
}
tmp = strlen(path);
while(tmp > 0 && path[tmp - 1] == '/') --tmp;
while(tmp > 0 && path[tmp - 1] != '/') --tmp;
while(tmp > 0 && path[tmp - 1] == '/') --tmp;
if (tmp > 0) {
char subpath[tmp + 1];
memcpy(subpath, path, tmp);
subpath[tmp] = '\0';
swpath = c_utf8_to_locale(subpath);
if (_tstat(swpath, &sb) == 0) {
if (! S_ISDIR(sb.st_mode)) {
c_free_locale_string(swpath);
c_free_locale_string(wpath);
errno = ENOTDIR;
return -1;
}
} else if (errno != ENOENT) {
c_free_locale_string(wpath);
c_free_locale_string(swpath);
return -1;
} else if (c_mkdirs(subpath, mode) < 0) {
c_free_locale_string(swpath);
c_free_locale_string(wpath);
return -1;
}
}
tmp = _tmkdir(wpath, mode);
c_free_locale_string(swpath);
c_free_locale_string(wpath);
if ((tmp < 0) && (errno == EEXIST)) {
return 0;
}
return tmp;
}
int c_rmdirs(const char *path) {
_TDIR *d;
struct _tdirent *dp;
csync_stat_t sb;
char *fname = NULL;
mbchar_t *wfname = NULL;
mbchar_t *wpath = c_utf8_to_locale(path);
char *rd_name = NULL;
if ((d = _topendir(wpath)) != NULL) {
while( _tstat(wpath, &sb) == 0) {
/* if we can remove the directory we're done */
if (_trmdir(wpath) == 0) {
break;
}
switch (errno) {
case ENOTEMPTY:
case EEXIST:
case EBADF:
break; /* continue */
default:
_tclosedir(d);
c_free_locale_string(wpath);
return 0;
}
while ((dp = _treaddir(d)) != NULL) {
size_t len;
rd_name = c_utf8_from_locale(dp->d_name);
/* skip '.' and '..' */
if( c_streq( rd_name, "." ) || c_streq( rd_name, ".." ) ) {
c_free_locale_string(rd_name);
continue;
}
len = strlen(path) + strlen(rd_name) + 2;
fname = c_malloc(len);
if (fname == NULL) {
_tclosedir(d);
c_free_locale_string(rd_name);
c_free_locale_string(wpath);
return -1;
}
snprintf(fname, len, "%s/%s", path, rd_name);
wfname = c_utf8_to_locale(fname);
/* stat the file */
if (_tstat(wfname, &sb) != -1) {
#ifdef __unix__
if (S_ISDIR(sb.st_mode) && !S_ISLNK(sb.st_mode)) {
#else
if (S_ISDIR(sb.st_mode)) {
#endif
if (_trmdir(wfname) < 0) { /* can't be deleted */
if (errno == EACCES) {
_tclosedir(d);
SAFE_FREE(fname);
c_free_locale_string(wfname);
c_free_locale_string(rd_name);
c_free_locale_string(wpath);
return -1;
}
c_rmdirs(fname);
}
} else {
_tunlink(wfname);
}
} /* lstat */
SAFE_FREE(fname);
c_free_locale_string(wfname);
c_free_locale_string(rd_name);
} /* readdir */
_trewinddir(d);
}
} else {
c_free_locale_string(wpath);
return -1;
}
c_free_locale_string(wpath);
_tclosedir(d);
return 0;
}
int c_isdir(const char *path) {
csync_stat_t sb;
mbchar_t *wpath = c_utf8_to_locale(path);
int re = 0;
if (path != NULL) {
if (_tstat (wpath, &sb) == 0 && S_ISDIR(sb.st_mode)) {
re = 1;
}
}
c_free_locale_string(wpath);
return re;
}

View File

@@ -1,86 +0,0 @@
/*
* cynapses libc functions
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file c_dir.h
*
* @brief Interface of the cynapses libc directory function
*
* @defgroup cynDirInternals cynapses libc directory functions
* @ingroup cynLibraryAPI
*
* @{
*/
#ifndef _C_DIR_H
#define _C_DIR_H
#include <sys/types.h>
/**
* @brief Create parent directories as needed.
*
* The newly created directory will be owned by the effective user ID of the
* process.
*
* @param path The path to the directory to create.
*
* @param mode Specifies the permissions to use. It is modified
* by the process's umask in the usual way: the
* permissions of the created file are (mode & ~umask).
*
* @return 0 on success, < 0 on error with errno set:
* - EACCES The parent directory does not allow write
* permission to the process, or one of the directories
* - ENOTDIR if durl is not a directory
* - EINVAL NULL durl passed or smbc_init not called.
* - ENOMEM Insufficient memory was available.
*
* @see mkdir()
*/
int c_mkdirs(const char *path, mode_t mode);
/**
* @brief Remove the directory and subdirectories including the content.
*
* This removes all directories and files recursivly.
*
* @param dir The directory to remove recusively.
*
* @return 0 on success, < 0 on error with errno set.
*/
int c_rmdirs(const char *dir);
/**
* @brief Check if a path is a directory.
*
* @param path The path to check.
*
* @return 1 if the path is a directory, 0 if the path doesn't exist, is a
* file or can't be accessed.
*/
int c_isdir(const char *path);
/**
* }@
*/
#endif /* _CDIR_H */

View File

@@ -1,346 +0,0 @@
/*
* cynapses libc functions
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef _WIN32
#include <windef.h>
#include <winbase.h>
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include "c_file.h"
#include "c_string.h"
#include "c_private.h"
#ifdef _WIN32
/* check if path is a symlink */
int c_islink(const char *path) {
int re = 0;
mbchar_t *wpath = 0;
DWORD dwAttrs;
WIN32_FIND_DATAW FindFileData;
HANDLE hFind;
wpath = c_utf8_to_locale(path);
dwAttrs = GetFileAttributesW(wpath);
if (dwAttrs != INVALID_FILE_ATTRIBUTES) {
if ((dwAttrs & FILE_ATTRIBUTE_REPARSE_POINT)) {
hFind = FindFirstFileW(wpath, &FindFileData );
if (hFind != INVALID_HANDLE_VALUE) {
if( (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) &&
(FindFileData.dwReserved0 & IO_REPARSE_TAG_SYMLINK) ) {
re = 1;
}
}
FindClose(hFind);
}
}
c_free_locale_string(wpath);
return re;
}
#endif
/* check if path is a file */
int c_isfile(const char *path) {
csync_stat_t sb;
mbchar_t *wpath = c_utf8_to_locale(path);
int re = _tstat(wpath, &sb);
c_free_locale_string(wpath);
if (re< 0) {
return 0;
}
#ifdef __unix__
if (S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)) {
#else
if (S_ISREG(sb.st_mode)) {
#endif
return 1;
}
return 0;
}
/* copy file from src to dst, overwrites dst */
#ifdef _WIN32
int c_copy(const char* src, const char *dst, mode_t mode) {
int rc = -1;
mbchar_t *wsrc = 0;
mbchar_t *wdst = 0;
(void) mode; /* unused on win32 */
if(src && dst) {
wsrc = c_utf8_to_locale(src);
wdst = c_utf8_to_locale(dst);
if (CopyFileW(wsrc, wdst, FALSE)) {
rc = 0;
}
c_free_locale_string(wsrc);
c_free_locale_string(wdst);
if( rc < 0 ) {
errno = GetLastError();
}
}
return rc;
}
#else
int c_copy(const char* src, const char *dst, mode_t mode) {
int srcfd = -1;
int dstfd = -1;
int rc = -1;
ssize_t bread, bwritten;
csync_stat_t sb;
char buf[4096];
if (c_streq(src, dst)) {
return -1;
}
srcfd = open(src, O_RDONLY, 0);
if (srcfd < 0) {
goto out;
}
rc = _tfstat(srcfd, &sb);
if (rc < 0) {
goto out;
}
if (S_ISDIR(sb.st_mode)) {
errno = EISDIR;
rc = -1;
goto out;
}
if (mode == 0) {
mode = sb.st_mode;
}
dstfd = open(dst, O_CREAT|O_WRONLY|O_TRUNC, mode);
if (dstfd < 0) {
rc = -1;
goto out;
}
rc = _tfstat(dstfd, &sb);
if (rc == 0) {
if (S_ISDIR(sb.st_mode)) {
errno = EISDIR;
rc = -1;
goto out;
}
}
for (;;) {
bread = read(srcfd, buf, sizeof(buf));
if (bread == 0) {
/* done */
break;
} else if (bread < 0) {
errno = ENODATA;
rc = -1;
goto out;
}
bwritten = write(dstfd, buf, bread);
if (bwritten < 0) {
errno = ENODATA;
rc = -1;
goto out;
}
if (bread != bwritten) {
errno = EFAULT;
rc = -1;
goto out;
}
}
#ifdef __unix__
fsync(dstfd);
#endif
rc = 0;
out:
if (srcfd >= 0) {
close(srcfd);
}
if (dstfd >= 0) {
close(dstfd);
}
if (rc < 0 && c_isfile(dst)) {
unlink(dst);
}
return rc;
}
#endif
int c_rename( const char *src, const char *dst ) {
mbchar_t *nuri = NULL;
mbchar_t *ouri = NULL;
int rc = 0;
nuri = c_utf8_to_locale(dst);
if (nuri == NULL) {
return -1;
}
ouri = c_utf8_to_locale(src);
if (ouri == NULL) {
c_free_locale_string(nuri);
return -1;
}
#ifdef _WIN32
{
#define MAX_TRIES_RENAME 3
int err = 0;
int cnt = 0;
do {
BOOL ok;
ok = MoveFileExW(ouri,
nuri,
MOVEFILE_COPY_ALLOWED +
MOVEFILE_REPLACE_EXISTING +
MOVEFILE_WRITE_THROUGH);
if (!ok) {
/* error */
err = GetLastError();
if( (err == ERROR_ACCESS_DENIED ||
err == ERROR_LOCK_VIOLATION ||
err == ERROR_SHARING_VIOLATION) && cnt < MAX_TRIES_RENAME ) {
cnt++;
Sleep(cnt*100);
continue;
}
}
break;
} while( 1 );
if( err != 0 ) {
errno = err;
rc = -1;
}
}
#else
rc = rename(ouri, nuri);
#endif
c_free_locale_string(nuri);
c_free_locale_string(ouri);
return rc;
}
int c_compare_file( const char *f1, const char *f2 ) {
mbchar_t *wf1, *wf2;
int fd1 = -1, fd2 = -1;
size_t size1, size2;
char buffer1[BUFFER_SIZE];
char buffer2[BUFFER_SIZE];
csync_stat_t stat1;
csync_stat_t stat2;
int rc = -1;
if(f1 == NULL || f2 == NULL) return -1;
wf1 = c_utf8_to_locale(f1);
if(wf1 == NULL) {
return -1;
}
wf2 = c_utf8_to_locale(f2);
if(wf2 == NULL) {
c_free_locale_string(wf1);
return -1;
}
#ifdef _WIN32
_fmode = _O_BINARY;
#endif
fd1 = _topen(wf1, O_RDONLY);
if(fd1 < 0) {
rc = -1;
goto out;
}
fd2 = _topen(wf2, O_RDONLY);
if(fd2 < 0) {
rc = -1;
goto out;
}
/* compare size first. */
rc = _tfstat(fd1, &stat1);
if (rc < 0) {
goto out;
}
rc = _tfstat(fd2, &stat2);
if (rc < 0) {
goto out;
}
/* if sizes are different, the files can not be equal. */
if (stat1.st_size != stat2.st_size) {
rc = 0;
goto out;
}
while( (size1 = read(fd1, buffer1, BUFFER_SIZE)) > 0 ) {
size2 = read( fd2, buffer2, BUFFER_SIZE );
if( size1 != size2 ) {
rc = 0;
goto out;
}
if(memcmp(buffer1, buffer2, size1) != 0) {
/* buffers are different */
rc = 0;
goto out;
}
}
rc = 1;
out:
if(fd1 > -1) close(fd1);
if(fd2 > -1) close(fd2);
c_free_locale_string( wf1 );
c_free_locale_string( wf2 );
return rc;
}

View File

@@ -1,102 +0,0 @@
/*
* cynapses libc functions
*
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file c_file.h
*
* @brief Interface of the cynapses libc file function
*
* @defgroup cynFileInternals cynapses libc file functions
* @ingroup cynLibraryAPI
*
* @{
*/
#ifndef _C_FILE_H
#define _C_FILE_H
#include <sys/types.h>
#include <stdio.h>
#ifndef BUFFER_SIZE
#define BUFFER_SIZE (16 * 1024)
#endif
#ifdef _WIN32
/**
* @brief Check if a path is a link.
*
* @param path The path to check.
*
* @return 1 if the path is a symbolic link, 0 if the path doesn't
* exist or is something else.
*/
int c_islink(const char *path);
#endif
/**
* @brief Check if a path is a regular file or a link.
*
* @param path The path to check.
*
* @return 1 if the path is a file, 0 if the path doesn't exist, is
* something else or can't be accessed.
*/
int c_isfile(const char *path);
/**
* @brief copy a file from source to destination.
*
* @param src Path to the source file
* @param dst Path to the destination file
* @param mode File creation mode of the destination. If mode is 0 then the
* mode from the source will be used.
*
* @return 0 on success, less than 0 on error with errno set.
* EISDIR if src or dst is a file.
*/
int c_copy(const char *src, const char *dst, mode_t mode);
/**
* @brief Compare the content of two files byte by byte.
* @param f1 Path of file 1
* @param f2 Path of file 2
*
* @return 0 if the files differ, 1 if the files are equal or -1 on
* error with errno set.
*/
int c_compare_file( const char *f1, const char *f2 );
/**
* @brief move a file from source to destination.
*
* @param src Path to the source file
* @param dst Path to the destination file
*
* @return 0 on success, less than 0 on error with errno set.
*/
int c_rename( const char *src, const char *dst );
/**
* }@
*/
#endif /* _C_FILE_H */

View File

@@ -23,45 +23,9 @@
#include "c_macro.h"
#include "c_alloc.h"
#include "c_dir.h"
#include "c_file.h"
#include "c_list.h"
#include "c_path.h"
#include "c_rbtree.h"
#include "c_string.h"
#include "c_time.h"
#include "c_private.h"
#ifndef UNIT_TESTING
#ifdef malloc
#undef malloc
#endif
#define malloc(x) DO_NOT_CALL_MALLOC__USE_C_MALLOC_INSTEAD
#ifdef calloc
#undef calloc
#endif
#define calloc(x,y) DO_NOT_CALL_CALLOC__USE_C_CALLOC_INSTEAD
#endif
#ifdef realloc
#undef realloc
#endif
#define realloc(x,y) DO_NOT_CALL_REALLOC__USE_C_REALLOC_INSTEAD
#ifdef dirname
#undef dirname
#endif
#define dirname(x) DO_NOT_CALL_MALLOC__USE_C_DIRNAME_INSTEAD
#ifdef basename
#undef basename
#endif
#define basename(x) DO_NOT_CALL_MALLOC__USE_C_BASENAME_INSTEAD
#ifdef strdup
#undef strdup
#endif
#define strdup(x) DO_NOT_CALL_STRDUP__USE_C_STRDUP_INSTEAD

View File

@@ -117,81 +117,6 @@ char *c_basename (const char *path) {
return newbuf;
}
char *c_tmpname(const char *templ) {
char *tmp = NULL;
char *target = NULL;
int rc;
int i = 0;
if (!templ) {
goto err;
}
/* If the template does not contain the XXXXXX it will be appended. */
if( !strstr( templ, "XXXXXX" )) {
/* split up the path */
char *path = c_dirname(templ);
char *base = c_basename(templ);
if (!base) {
if (path) {
SAFE_FREE(path);
}
goto err;
}
/* Create real hidden files for unixoide. */
if( path ) {
#ifdef _WIN32
rc = asprintf(&target, "%s/%s.~XXXXXX", path, base);
#else
rc = asprintf(&target, "%s/.%s.~XXXXXX", path, base);
#endif
} else {
#ifdef _WIN32
rc = asprintf(&target, "%s.~XXXXXX", base);
#else
rc = asprintf(&target, ".%s.~XXXXXX", base);
#endif
}
SAFE_FREE(path);
SAFE_FREE(base);
if (rc < 0) {
goto err;
}
} else {
target = c_strdup(templ);
}
if (!target) {
goto err;
}
tmp = strstr( target, "XXXXXX" );
if (!tmp) {
goto err;
}
for (i = 0; i < 6; ++i) {
#ifdef _WIN32
/* in win32 MAX_RAND is 32767, thus we can not shift that far,
* otherwise the last three chars are 0
*/
int hexdigit = (rand() >> (i * 2)) & 0x1f;
#else
int hexdigit = (rand() >> (i * 5)) & 0x1f;
#endif
tmp[i] = hexdigit > 9 ? hexdigit + 'a' - 10 : hexdigit + '0';
}
return target;
err:
errno = EINVAL;
return NULL;
}
int c_parse_uri(const char *uri,
char **scheme,
char **user, char **passwd,
@@ -470,84 +395,3 @@ int c_parse_uri(const char *uri,
return -1;
}
/*
* http://refactormycode.com/codes/1345-extracting-directory-filename-and-extension-from-a-path
* Allocate a block of memory that holds the PATHINFO at the beginning
* followed by the actual path. Two extra bytes are allocated (+3 instead
* of just +1) to deal with shifting the filename and extension to protect the trailing '/'
* and the leading '.'. These extra bytes also double as the empty string, as
* well as a pad to keep from reading past the memory block.
*
*/
C_PATHINFO * c_split_path(const char* pathSrc)
{
size_t length = strlen(pathSrc);
size_t len=0;
C_PATHINFO * pathinfo = (C_PATHINFO *) c_malloc(sizeof(C_PATHINFO) + length + 3);
if (pathinfo)
{
char * path = (char *) &pathinfo[1]; // copy of the path
char * theEnd = &path[length + 1]; // second null terminator
char * extension;
char * lastSep;
// Copy the original string and double null terminate it.
strcpy(path, pathSrc);
*theEnd = '\0';
pathinfo->directory = theEnd; // Assume no path
pathinfo->extension = theEnd; // Assume no extension
pathinfo->filename = path; // Assume filename only
lastSep = strrchr(path, '/');
if (lastSep)
{
pathinfo->directory = path; // Pick up the path
memmove(lastSep + 1, lastSep, strlen(lastSep));
*lastSep++ ='/';
*lastSep++ ='\0'; // Truncate directory
pathinfo->filename = lastSep; // Pick up name after path
}
// Start at the second character of the filename to handle
// filenames that start with '.' like ".login".
// We don't overrun the buffer in the cases of an empty path
// or a path that looks like "/usr/bin/" because of the extra
// byte.
extension = strrchr(&pathinfo->filename[1], '.');
if (extension)
{
// Shift the extension over to protect the leading '.' since
// we need to truncate the filename.
memmove(extension + 1, extension, strlen(extension));
pathinfo->extension = extension + 1;
*extension = '\0'; // Truncate filename
}
else
{
len=strlen(pathinfo->filename);
if(len>1)
{
//tmp files from kate/kwrite "somefile~": '~' should be the extension
if(pathinfo->filename[len-1]=='~')
{
extension = &pathinfo->filename[len-1];
memmove(extension + 1, extension, strlen(extension));
pathinfo->extension = extension + 1;
*extension = '\0'; // Truncate filename
}
}
}
}
return pathinfo;
}

View File

@@ -66,19 +66,6 @@ char *c_dirname(const char *path);
*/
char *c_basename (const char *path);
/**
* @brief Make a temporary filename.
*
* @param templ The template to replace. If the template contains six X like
* 'XXXXXX', these are replaced by a random string. If not, the
* templ is interpreted as a path, and a name to a hidden file
* with six random is returned.
* The caller has to free the memory.
*
* @return a poitner to the random hidden filename or NULL.
*/
char *c_tmpname(const char *templ);
/**
* @brief parse a uri and split it into components.
*
@@ -120,15 +107,6 @@ typedef struct
char * extension;
} C_PATHINFO;
/**
* @brief Extracting directory, filename and extension from a path.
*
* @param pathSrc The path to parse.
*
* @return Returns a C_PATHINFO structure that should be freed using SAFE_FREE().
*/
C_PATHINFO * c_split_path(const char* pathSrc);
/**
* }@

View File

@@ -134,6 +134,14 @@ static char *c_iconv(const char* str, enum iconv_direction dir)
}
#endif /* defined(HAVE_ICONV) && defined(WITH_ICONV) */
int c_strncasecmp(const char *a, const char *b, size_t n) {
#ifdef _WIN32
return _strnicmp(a, b, n);
#else
return strncasecmp(a, b, n);
#endif
}
int c_streq(const char *a, const char *b) {
register const char *s1 = a;
register const char *s2 = b;
@@ -239,69 +247,6 @@ void c_strlist_destroy(c_strlist_t *strlist) {
SAFE_FREE(strlist);
}
char *c_strreplace(char *src, const char *pattern, const char *repl) {
char *p = NULL;
while ((p = strstr(src, pattern)) != NULL) {
size_t of = p - src;
size_t l = strlen(src);
size_t pl = strlen(pattern);
size_t rl = strlen(repl);
if (rl > pl) {
src = (char *) c_realloc(src, strlen(src) + rl - pl + 1);
}
if (rl != pl) {
memmove(src + of + rl, src + of + pl, l - of - pl + 1);
}
strncpy(src + of, repl, rl);
}
return src;
}
char *c_uppercase(const char* str) {
char *new;
char *p;
if (str == NULL) {
return NULL;
}
new = c_strdup(str);
if (new == NULL) {
return NULL;
}
for (p = new; *p; p++) {
*p = toupper(*p);
}
return new;
}
char *c_lowercase(const char* str) {
char *new;
char *p;
if (str == NULL) {
return NULL;
}
new = c_strdup(str);
if (new == NULL) {
return NULL;
}
for (p = new; *p; p++) {
*p = tolower(*p);
}
return new;
}
/* Convert a wide multibyte String to UTF8 */
char* c_utf8_from_locale(const mbchar_t *wstr)
{

View File

@@ -59,6 +59,17 @@ struct c_strlist_s {
size_t size;
};
/**
* @brief Compare to strings case insensitively.
*
* @param a First string to compare.
* @param b Second string to compare.
* @param n Max comparison length.
*
* @return see strncasecmp
*/
int c_strncasecmp(const char *a, const char *b, size_t n);
/**
* @brief Compare to strings if they are equal.
*
@@ -119,37 +130,6 @@ void c_strlist_clear(c_strlist_t *strlist);
*/
void c_strlist_destroy(c_strlist_t *strlist);
/**
* @breif Replace a string with another string in a source string.
*
* @param src String to search for pattern.
*
* @param pattern Pattern to search for in the source string.
*
* @param repl The string which which should replace pattern if found.
*
* @return Return a pointer to the source string.
*/
char *c_strreplace(char *src, const char *pattern, const char *repl);
/**
* @brief Uppercase a string.
*
* @param str The String to uppercase.
*
* @return The malloced uppered string or NULL on error.
*/
char *c_uppercase(const char* str);
/**
* @brief Lowercase a string.
*
* @param str The String to lowercase.
*
* @return The malloced lowered string or NULL on error.
*/
char *c_lowercase(const char* str);
/**
* @brief Convert a platform locale string to utf8.
*

View File

@@ -24,6 +24,7 @@
#include <errno.h>
#include <stdio.h>
#include <assert.h>
#include "csync_private.h"
#include "csync_util.h"
@@ -44,9 +45,12 @@ csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name) {
if(ctx->remote.read_from_db) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Read from db flag is true, should not!" );
}
return owncloud_opendir(name);
return owncloud_opendir(ctx, name);
break;
case LOCAL_REPLICA:
if( ctx->callbacks.update_callback ) {
ctx->callbacks.update_callback(ctx->replica, name, ctx->callbacks.update_callback_userdata);
}
return csync_vio_local_opendir(name);
break;
default:
@@ -69,7 +73,7 @@ int csync_vio_closedir(CSYNC *ctx, csync_vio_handle_t *dhandle) {
if( ctx->remote.read_from_db ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Remote ReadFromDb is true, should not!");
}
rc = owncloud_closedir(dhandle);
rc = owncloud_closedir(ctx, dhandle);
break;
case LOCAL_REPLICA:
rc = csync_vio_local_closedir(dhandle);
@@ -87,7 +91,7 @@ csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle
if( ctx->remote.read_from_db ) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Remote readfromdb is true, should not!");
}
return owncloud_readdir(dhandle);
return owncloud_readdir(ctx, dhandle);
break;
case LOCAL_REPLICA:
return csync_vio_local_readdir(dhandle);
@@ -106,7 +110,8 @@ int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf) {
switch(ctx->replica) {
case REMOTE_REPLICA:
rc = owncloud_stat(uri, buf);
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "ERROR: Cannot call remote stat, not implemented");
assert(ctx->replica != REMOTE_REPLICA);
break;
case LOCAL_REPLICA:
rc = csync_vio_local_stat(uri, buf);
@@ -121,21 +126,9 @@ int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf) {
return rc;
}
char *csync_vio_get_status_string(CSYNC *ctx) {
if(ctx->error_string) {
return ctx->error_string;
}
return owncloud_error_string();
}
int csync_vio_set_property(CSYNC* ctx, const char* key, void* data) {
(void) ctx;
return owncloud_set_property(key, data);
}
int csync_vio_commit(CSYNC *ctx) {
(void) ctx;
return owncloud_commit();
return owncloud_error_string(ctx);
}

View File

@@ -39,10 +39,7 @@ csync_vio_file_stat_t *csync_vio_readdir(CSYNC *ctx, csync_vio_handle_t *dhandle
int csync_vio_stat(CSYNC *ctx, const char *uri, csync_vio_file_stat_t *buf);
int csync_vio_set_property(CSYNC *ctx, const char *key, void *data);
char *csync_vio_get_status_string(CSYNC *ctx);
int csync_vio_commit(CSYNC *ctx);
#endif /* _CSYNC_VIO_H */

View File

@@ -22,14 +22,8 @@
#include "vio/csync_vio_file_stat.h"
csync_vio_file_stat_t *csync_vio_file_stat_new(void) {
csync_vio_file_stat_t *file_stat = NULL;
file_stat = (csync_vio_file_stat_t *) c_malloc(sizeof(csync_vio_file_stat_t));
if (file_stat == NULL) {
return NULL;
}
file_stat->etag = NULL;
memset(file_stat->file_id, 0, FILE_ID_BUF_SIZE+1);
csync_vio_file_stat_t *file_stat = (csync_vio_file_stat_t *) c_malloc(sizeof(csync_vio_file_stat_t));
ZERO_STRUCTP(file_stat);
return file_stat;
}
@@ -39,15 +33,11 @@ void csync_vio_file_stat_destroy(csync_vio_file_stat_t *file_stat) {
return;
}
if (file_stat->fields & CSYNC_VIO_FILE_STAT_FIELDS_SYMLINK_NAME) {
SAFE_FREE(file_stat->u.symlink_name);
}
if (file_stat->fields & CSYNC_VIO_FILE_STAT_FIELDS_CHECKSUM) {
SAFE_FREE(file_stat->u.checksum);
}
if (file_stat->fields & CSYNC_VIO_FILE_STAT_FIELDS_ETAG) {
SAFE_FREE(file_stat->etag);
}
SAFE_FREE(file_stat->directDownloadUrl);
SAFE_FREE(file_stat->directDownloadCookies);
SAFE_FREE(file_stat->name);
SAFE_FREE(file_stat);
}

View File

@@ -34,6 +34,9 @@
#define FILE_ID_BUF_SIZE 21
// currently specified at https://github.com/owncloud/core/issues/8322 are 9 to 10
#define REMOTE_PERM_BUF_SIZE 15
typedef struct csync_vio_file_stat_s csync_vio_file_stat_t;
enum csync_vio_file_flags_e {
@@ -56,48 +59,44 @@ enum csync_vio_file_type_e {
enum csync_vio_file_stat_fields_e {
CSYNC_VIO_FILE_STAT_FIELDS_NONE = 0,
CSYNC_VIO_FILE_STAT_FIELDS_TYPE = 1 << 0,
CSYNC_VIO_FILE_STAT_FIELDS_PERMISSIONS = 1 << 1,
CSYNC_VIO_FILE_STAT_FIELDS_MODE = 1 << 1, // local POSIX mode
CSYNC_VIO_FILE_STAT_FIELDS_FLAGS = 1 << 2,
CSYNC_VIO_FILE_STAT_FIELDS_DEVICE = 1 << 3,
CSYNC_VIO_FILE_STAT_FIELDS_INODE = 1 << 4,
CSYNC_VIO_FILE_STAT_FIELDS_LINK_COUNT = 1 << 5,
CSYNC_VIO_FILE_STAT_FIELDS_SIZE = 1 << 6,
CSYNC_VIO_FILE_STAT_FIELDS_BLOCK_COUNT = 1 << 7, /* will be removed */
CSYNC_VIO_FILE_STAT_FIELDS_BLOCK_SIZE = 1 << 8, /* will be removed */
// CSYNC_VIO_FILE_STAT_FIELDS_BLOCK_COUNT = 1 << 7, /* will be removed */
// CSYNC_VIO_FILE_STAT_FIELDS_BLOCK_SIZE = 1 << 8, /* will be removed */
CSYNC_VIO_FILE_STAT_FIELDS_ATIME = 1 << 9,
CSYNC_VIO_FILE_STAT_FIELDS_MTIME = 1 << 10,
CSYNC_VIO_FILE_STAT_FIELDS_CTIME = 1 << 11,
CSYNC_VIO_FILE_STAT_FIELDS_SYMLINK_NAME = 1 << 12,
CSYNC_VIO_FILE_STAT_FIELDS_CHECKSUM = 1 << 13,
CSYNC_VIO_FILE_STAT_FIELDS_ACL = 1 << 14,
CSYNC_VIO_FILE_STAT_FIELDS_UID = 1 << 15,
CSYNC_VIO_FILE_STAT_FIELDS_GID = 1 << 16,
// CSYNC_VIO_FILE_STAT_FIELDS_SYMLINK_NAME = 1 << 12,
// CSYNC_VIO_FILE_STAT_FIELDS_CHECKSUM = 1 << 13,
// CSYNC_VIO_FILE_STAT_FIELDS_ACL = 1 << 14,
// CSYNC_VIO_FILE_STAT_FIELDS_UID = 1 << 15,
// CSYNC_VIO_FILE_STAT_FIELDS_GID = 1 << 16,
CSYNC_VIO_FILE_STAT_FIELDS_ETAG = 1 << 17,
CSYNC_VIO_FILE_STAT_FIELDS_FILE_ID = 1 << 18
CSYNC_VIO_FILE_STAT_FIELDS_FILE_ID = 1 << 18,
CSYNC_VIO_FILE_STAT_FIELDS_DIRECTDOWNLOADURL = 1 << 19,
CSYNC_VIO_FILE_STAT_FIELDS_DIRECTDOWNLOADCOOKIES = 1 << 20,
CSYNC_VIO_FILE_STAT_FIELDS_PERM = 1 << 21 // remote oC perm
};
struct csync_vio_file_stat_s {
union {
char *symlink_name;
char *checksum;
} u;
void *acl;
char *name;
char *etag;
char *etag; // FIXME: Should this be inlined like file_id and perm?
char file_id[FILE_ID_BUF_SIZE+1];
uid_t uid;
gid_t gid;
char *directDownloadUrl;
char *directDownloadCookies;
char remotePerm[REMOTE_PERM_BUF_SIZE+1];
time_t atime;
time_t mtime;
time_t ctime;
int64_t size;
int64_t blksize; /* will be removed in future, not used in csync */
unsigned long blkcount; /* will be removed in future, not used in csync */
mode_t mode;
@@ -109,10 +108,6 @@ struct csync_vio_file_stat_s {
enum csync_vio_file_type_e type;
enum csync_vio_file_flags_e flags;
void *reserved1;
void *reserved2;
void *reserved3;
};
csync_vio_file_stat_t *csync_vio_file_stat_new(void);

View File

@@ -227,9 +227,6 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_FLAGS;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
buf->mode = 666;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERMISSIONS;
buf->device = fileInfo.dwVolumeSerialNumber;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_DEVICE;
@@ -240,7 +237,7 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
/* printf("Index: %I64i\n", FileIndex.QuadPart); */
buf->inode = FileIndex.QuadPart;
buf->size = (fileInfo.nFileSizeHigh * (int64_t)(MAXDWORD+1)) + fileInfo.nFileSizeLow;
buf->size = (fileInfo.nFileSizeHigh * ((int64_t)(MAXDWORD)+1)) + fileInfo.nFileSizeLow;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;
/* Get the file time with a win32 call rather than through stat. See
@@ -316,7 +313,7 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_TYPE;
buf->mode = sb.st_mode;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_PERMISSIONS;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_MODE;
if (buf->type == CSYNC_VIO_FILE_TYPE_SYMBOLIC_LINK) {
/* FIXME: handle symlink */
@@ -332,11 +329,6 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
buf->inode = sb.st_ino;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_INODE;
/* Both values are only initialized to zero as they are not used in csync */
/* They are deprecated and will be rmemoved later. */
buf->blksize = 0;
buf->blkcount = 0;
buf->atime = sb.st_atime;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_ATIME;
@@ -349,12 +341,6 @@ int csync_vio_local_stat(const char *uri, csync_vio_file_stat_t *buf) {
buf->nlink = sb.st_nlink;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_LINK_COUNT;
buf->uid = sb.st_uid;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_UID;
buf->gid = sb.st_gid;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_GID;
buf->size = sb.st_size;
buf->fields |= CSYNC_VIO_FILE_STAT_FIELDS_SIZE;

Some files were not shown because too many files have changed in this diff Show More