Commit Graph

6135 Commits

Author SHA1 Message Date
Patrick Ohly 499c1c72d5 syncevolution.org: drop binary compatibility hack for old libnotify
syncevolution.org binaries are going to support distros >= Ubuntu Trusty.
All of those have libnotify.so.4, so the old binary compatibility hack is
no longer needed.
2016-09-20 06:51:11 -07:00
Patrick Ohly bf3c8d5361 ClientTest.cpp: fix clang warning
SOURCE_ASSERT_EQUAL() expects to get an expression as first parameter
which may become NULL. Passing a known-non-NULL pointer makes no sense
and triggers a warning from clang:

ClientTestAssert.h:109:50: error: nonnull argument 'copy' compared to NULL
[-Werror=nonnull-compare]
 # define CT_ASSERT_TRUE_CLANG_BUILD(_expression) if (!(_expression)) {
 exit(1); }
...                                                  ^
ClientTest.cpp:859:5: note: in
expansion of macro 'SOURCE_ASSERT_EQUAL'
SOURCE_ASSERT_EQUAL(&copy, 0, config.m_dump(client, copy, copyFile));
2016-08-29 04:59:38 -07:00
Patrick Ohly a53e5289bd dbus-sync.cpp: fix cppcheck performance warning
cppcheck correctly warned that initializing a reference is enough,
no need to copy the string:

dbus-sync.cpp:97: cppcheck performance: passedByValue - Function parameter
'source' should be passed by reference.
2016-08-29 04:58:24 -07:00
Patrick Ohly 16e6e854c3 gdbus-cxx-bridge.h: avoid false cppcheck warning
cppcheck seems to mix up different template variations. The following error
needs to be suppressed in the classes which don't even have an m_a member:

gdbus-cxx-bridge.h:330: cppcheck warning: uninitMemberVar - Member variable
'Set::m_a' is not initialized in the constructor.
gdbus-cxx-bridge.h:339: cppcheck warning: uninitMemberVar - Member variable
'Set::m_a' is not initialized in the constructor.
2016-08-29 04:55:24 -07:00
Patrick Ohly d560aeda07 compilation: fix std::find() == 0 misuse
cppcheck correctly warns about the old code as less efficient (looks
at entire string instead of just the start). Using boost::starts_with
is less obscure and avoids the warning.
2016-08-29 04:52:49 -07:00
Patrick Ohly f7dbb2ed72 runtests.py: better logging of failed command
When execution of a command fails, then printing the actual
string passed to system() is more readable and accurate than
the original array.
2016-08-26 11:20:30 -07:00
Patrick Ohly 2b4b93f1ab compilation: fix const/non-const issue under C++14/gcc 6
Building client-test fails because a const pointer looses the
const attribute while passing it through boost::bind.

Fixes:

boost/lambda/detail/function_adaptors.hpp:357:16: error: invalid conversion
from 'const SyncEvo::SyncSource*' to 'SyncEvo::SyncSource*' [-fpermissive]
return func(a1);
2016-08-26 11:18:20 -07:00
Patrick Ohly 14452722fd compilation: fix push_back ambiguity under gcc 6/C++14
When compiling as C++14 (the default under gcc 6), template
expansion no longer picks the right instantiation of push_back.
We have to disambiguate which of the different push_back
alternatives we want.

Fixes:

Cmdline.cpp:1734:85: error: no matching function for call to 'bind(<unresolved
overloaded function type>, const boost::reference_wrapper<std::__cxx11::list<std::__cxx11::basic_string<char> >
>, const boost::arg<1>&)'
     processLUIDs(source, boost::bind(&list<string>::push_back, boost::ref(luids), _1));
2016-08-26 11:15:23 -07:00
Patrick Ohly 3299613591 compilation: fix boost::shared_ptr->bool issue under C++14
The implicit conversion of boost::shared_ptr->bool is no
longer supported when compiling as C++14 (the default under
gcc 6). We have to cast explicitly.

Fixes errors like this:

Logging.h:258:41: error: cannot convert 'const boost::shared_ptr<SyncEvo::Logger>' to 'bool' in return
         operator bool () const { return m_logger; }
2016-08-26 11:14:44 -07:00
Patrick Ohly 4e2dd07580 autotools: disable timezone override hack when using libical v2
libical v2 provides support for interoperable timezone definitions
again, so the copy of the original code that was added for libical v1
is not needed anymore and also wouldn't compile.

Therefore SyncEvolution can drop it when being compiled for v2. In that
case, a corresponding change in libsynthesis calls
icaltzutil_set_exact_vtimezones_support(0) to enable interoperable
timezones.

This addresses compilation and running with libical v2, i.e. what
normal distros are doing. Compiling with libical v1 and running
with v2 needs to be addressed separately, if possible at all.
2016-08-26 09:15:22 -07:00
Tino Mettler a9aaf5b1e6 1.5.1-2 package 2016-07-14 09:50:37 +02:00
Tino Mettler b5f5312b1c Fix remaining FTBFS with GCC 6 by downgrading the C++ dialect to gnu++98
Closes: #811624
2016-07-14 09:50:11 +02:00
Tino Mettler 80a82f6d27 Merge tag 'patches/1.5.1-2'
Patches for 1.5.1-2
2016-07-14 09:48:41 +02:00
Tino Mettler 9286b88515 Add missing casts from shared_ptr to bool to fix FTBFS with GCC 6 2016-07-08 12:54:32 +02:00
Tino Mettler 46a2401a19 1.5.1-1 package 2016-05-19 16:23:30 +02:00
Tino Mettler 0751ac954e Depend on recent libsynthesis package 2016-05-19 16:23:30 +02:00
Tino Mettler 470ecf0810 Remove old debug package definition, use the new dbgsym packages 2016-05-19 16:23:30 +02:00
Tino Mettler 254581a15b Upstream generates a manpage, remove outdated and obsolete own version 2016-05-19 16:23:30 +02:00
Tino Mettler 6a291c3ca9 Add dh_auto_clean quirk to make the package build twice in a row 2016-05-19 16:23:30 +02:00
Tino Mettler ce127cfff5 Bump standards version, no changes needed 2016-05-19 16:23:24 +02:00
Tino Mettler b2bcf9e9f2 Update Vcs-* fields to new URLs 2016-05-19 10:14:39 +02:00
Tino Mettler cd3958d29d New upstream release 2016-05-19 10:14:39 +02:00
Tino Mettler b096541898 Merge tag 'patches/1.5.1-1'
Patches for 1.5.1-1
2016-05-19 10:14:34 +02:00
Tino Mettler 5feaaf8692 Fix FTBFS with libical2
Use patch from Fedora package to fix FTBFS with libical2.

Taken from http://pkgs.fedoraproject.org/cgit/rpms/syncevolution.git/commit/syncevolution-1.5.1-libical2.patch?id=a53ce39a06ba73e210fd229690392bea8e800d20

Closes: #824426
2016-05-19 10:08:39 +02:00
Tino Mettler 9cc6dae34b Merge tag 'upstream/1.5.1' into patch-queue/upstream
Upstream version 1.5.1
2016-03-01 10:15:27 +01:00
Tino Mettler ed33df2b0d 1.4.99.4-5 package 2016-02-26 11:58:09 +01:00
Tino Mettler b281c6ad3f Build-depend on libopenobex2-dev (Closes: #813819) 2016-02-26 11:58:09 +01:00
Tino Mettler ef8aa5f277 1.4.99.4-4 was released 2016-02-26 11:58:09 +01:00
Tino Mettler e8235b149d 1.4.99.4-4 2015-09-10 11:50:07 +02:00
Tino Mettler 409e631301 Fix libsynthesis depencency after GCC5 transition
The libsynthesis0 package was renamed to  libsynthesis0v5.

Closes: #797966
2015-09-10 11:37:51 +02:00
Patrick Ohly bbfe468290 mkdir_p: support non-readable parent directories (FDO #91000)
The previous mkdir_p() walked down top to bottom and checked each path
entry as it went along. That approach failed unnecessarily when some
existing parent directory could not be read (non-readable /home, for
example).

The new version tries to create the lowest directories first
(brute-force) and only walks up when that is necessary to avoid an
ENOENT.
2015-08-14 18:42:47 +02:00
Patrick Ohly 5a7bb9b572 autotools, NEWS: SyncEvolution 1.5.1 2015-06-05 14:58:41 +02:00
frdsktp bcf21809d5 syncevo-http-server: stop using deprecated twisted.web.error (FDO #90419)
twisted.web.error.NoResource was replaced by
twisted.web.resource.NoResource.  This has become a real problem for
example on Fedora 22 where the old name is no longer available.
2015-06-05 14:31:43 +02:00
Patrick Ohly a5f0139a10 syncing: avoid segfault for invalid text inside items (FDO #90118)
As reported by Canonical, syncing fails if data items contain
text which is not correct UTF-8 in one of the fields that
SyncEvolution logs in the command line output (like SUMMARY of
a calendar event).

That is because the byte string coming from the item is passed
unchecked to the D-Bus implementation for transmission via D-Bus. But
D-Bus strings must be correct UTF-8, so depending on the D-Bus library
in use, one gets a segfault (GIO D-Bus, due to an unchecked NULL
pointer access) or an "out of memory" error (libdbus, which checks for
NULL).

What the D-Bus bindings now do is checking the string in advance (to
avoid error messages inside the D-Bus implementations) and then
replacing all invalid bytes with question marks. The rest of the
string is preserved.

Handling this inside the D-Bus binding layer is not the "correct"
solution (which would be to check for UTF-8 in the higher layers were
such bad data might get into SyncEvolution), but it is the less
intrusive and more complete one. Changing the bindings such that all
strings must be declared explicitly as "UTF-8 string" would have been
a way to find all places where such checks are missing, but it turned
out to be too complex and requiring too many changes.
2015-06-05 05:26:26 -07:00
Patrick Ohly 1385ac43fb file backend: log item manipulation
Extracting a meaningful description of each item from the Synthesis
engine when updating and adding items is easy to do for items of
certain known types (contacts and calendar items) and arguably an
improvement; in particular it makes tests like
TestCmdline.testSyncOutput more realistic.
2015-06-01 14:23:46 +02:00
Patrick Ohly c9a7cf1901 D-Bus testing: check sync result on both sides of TestLocalSync.testSync
Checking that the item still exists on the side where it was created
is okay, but it is more important to check that it also reached the
other side.
2015-06-01 14:22:19 +02:00
Patrick Ohly 0ac91f5658 command line: preserve log prefix of target side of local sync
In some cases, the prefix which was supposed to be embedded
in the log messages from the target side of a local sync got
lost on the way to the command line tool.

Primarily this affected the added/updated/deleted messages, as in:

[INFO remote@client] @client/addressbook: started
[INFO remote@client] updating "Joan Doe"
[INFO remote@client] @client/addressbook: received 1/1

This was not caught by automated testing because the corresponding
test (TestCmdline.testSyncOutput and TestCmdline.testSyncOutput2) is
using the file backend, which does not generate such messages at the
moment (to be changed separately).
2015-06-01 14:17:14 +02:00
Niels Ole Salscheider cd93586d0b Use ${PKG_CONFIG} instead of pkg-config.
This fixes the build on Exherbo that only has prefixed versions of pkg-config.
2015-04-17 10:41:44 +02:00
Patrick Ohly 84a30285a9 WebDAV: handle 403 during Google OAuth authentication
When sending an access token with insufficient scope (for example,
because the Ubuntu Online Accounts service definition was incomplete,
as documented in FDO #86824), Google responds with a 403 "service
denied" error.

Neon (arguably correctly) treats this as a permanent error and not
as a transient authentication error. Google should better send
a 401 error.

To activate the 401 error handling in SyncEvolution, detect this
special case and turn the general SE_ERROR error into SE_AUTH.
2015-03-03 10:44:03 +01:00
Patrick Ohly d84f323398 signon: ensure consistent use of "username" provider prefix
The Ubuntu Online Accounts signon backend complained about
invalid "username" content with an error message containing "sso",
the string used for gSSO.

Define these magic strings once and then use only the defines.
2015-03-03 10:44:03 +01:00
Alberto Mardegan 9acfd11de7 signon-accounts: implement getCredentials
Use the information contained in the AgAuthData object to decide which
authentication method is being used.
Move the common authentication code into a private authenticate()
method.

[PO: fixed g_variant_builder_end() mem leak]
[PO: avoid issue found via cppcheck: returning std::string::c_str() in
a method returning a std::string forces a string copy, which is
inefficient.]
[PO: UiPolicy was not set because of an invalid g_variant_builder_add()
"sv" parameter.]
2015-03-03 10:43:26 +01:00
Alberto Mardegan c58ed9ff59 signon-accounts: pass the AgAuthData to the SignonAuthProvider
Instead of passing the session data and the mechanism, pass the full
AgAuthData object to the SignonAuthProvider constructor.
This object can be used to build the session data without converting all
dictionaries to and from GHashTable.

[PO: fixed g_variant_builder_end() mem leak]
[PO: ForceTokenRefresh was not set because of an invalid g_variant_builder_add()
"sv" parameter.]
2015-03-03 10:41:52 +01:00
Alberto Mardegan 382c81e70f signon-accounts: do not create identities on the fly
It's not sync-evolution task to complete the account creation; in those
platforms where this backend is deployed (Ubuntu, Elementary, KDE) the
account should already be created with a proper SignonIdentity attached
to it.
2015-03-03 10:30:53 +01:00
Alberto Mardegan ff12834be1 AuthProvider: removed failure count
Remove the failure count from the getOAuth2Bearer() method, and add an
invalidateCachedSecrets() method instead.

This moves the logic of how to deal with failures back to the
AuthProvider backend and simplifies the session code, which only needs
to call invalidateCachedSecrets() when the token is wrong.
This will help implementing a similar logic for the getCredentials()
method, where authentication errors could lead to requesting a new
password.

[PO: avoid issue found via cppcheck: returning std::string::c_str() in
a method returning a std::string forces a string copy, which is
inefficient.]
2015-03-03 10:30:29 +01:00
Alberto Mardegan ab4524ab9f signon: move libaccounts-based plugins into their own source file
The libaccounts-based backends ("gsso" and "uoa") are going to use more
of libaccounts-glib, making sharing of code with the plain "signon"
plugin much harder to maintain.
2015-03-03 10:15:44 +01:00
Patrick Ohly 75115022c5 CalDAV: more efficient "is empty" check (FDO #86335)
Since 1.4.99.4, syncing WebDAV collections always checks first
whether there are items in the collections. This was partly done for
slow sync prevention (which is not necessary for empty collections),
partly for the "is the datastore usable" check.

However, this did not take into account that for CalDAV collections,
the entire content gets downloaded for this check. That is because
filtering by item type (VEVENT vs. VJOURNAL) is not implemented
correctly by all servers. So now all CalDAV syncs, whether incremental
or slow, always transfered all items, which is not the
intention (incremental syncs should be fast and efficient).

This commit adds a more efficient isEmpty() check: for simple CardDAV
collections, only luid and etag get transferred, as in
listAllItems(). This is the behavior from 1.5.

For CalDAV, a report with a filter for the content type is used and
the transfer gets aborted after the first item, without actually
double-checking the content of the item. This is different from
listAllItems(), which really transfers the content. This extra content
check would only be needed for some old servers (Radical 0.7) and is
not essential, because reporting "not empty" even when empty is safe.
2015-03-03 10:15:44 +01:00
Patrick Ohly 7e5638fd90 WebDAV: utility class for ne_status
Besides offering C++ wrappers for the C API, this class also ensures
that memory for the "reason_string" is properly freed.
2015-03-03 10:15:44 +01:00
Patrick Ohly 85df49a68b WebDAV: enhance report handling (status, aborting)
Capture the item status and pass it to the response handler.

Response handlers are allowed to return a non-zero integer when using
the initAbortingReportParser(), which then aborts processing of the
response.

This leads to errors being returned by
ne_xml_dispatch_request(). Session::run() needs to be told if the
request was aborted, in which case all errors are ignored.
2015-03-03 10:15:44 +01:00
Patrick Ohly 905ca53824 WebDAV: send Basic Auth via http in some cases (FDO #57248)
It turned out that finding databases on an Apple Calendar server accessed via
http depends on sending Basic Auth even when the server does not ask for it:
without authentication, there is no information about the current principal,
which is necessary for finding the user's databases.

To make this work again, sending the authentication header is now forced for
plain http if (and only if) the request which should have returned the
principal URL fails to include it. This implies sending the same request
twice, but as this scenario should be rare in practise (was only done for
testing), this is acceptable.
2015-03-03 10:15:44 +01:00
Patrick Ohly 096b7e61aa wrappercheck.sh: enhanced killing of daemon
Occasionally the script shutdown got stuck on Ubuntu Vivid because killing
the background daemon failed although it was still runnning, thus causing the
wait to hang forever.

Not exactly sure what caused this. The enhancement tries to fall back to
killing the process instead of the process group (in case that there is
a race condition, which shouldn't be the case when waiting for the daemon),
preserves stderr from the kill commands and adds ps output when there is
an unexpected failure.
2015-03-03 10:15:44 +01:00