librsync 1.0.0 breaks duplicity/_librsyncmodule.c compilation

Bug #1416344 reported by Roman Tereshonkov on 2015-01-30
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Duplicity
Medium
Unassigned

Bug Description

librsync version 1.0.0 changes rs_sig_begin function API as
-rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len);
+rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
+ rs_long_t sig_magic);

This makes the problem to compile duplicity/_librsyncmodule.c file.
It uses the old rs_sig_begin format:
sm->sig_job = rs_sig_begin((size_t)blocklen,
                           (size_t)RS_DEFAULT_STRONG_LEN);

Duplicity is not ready for librsync v1.0.0. Please continue to use the
older 0.9.0 version.

On Fri, Jan 30, 2015 at 4:32 AM, Roman Tereshonkov <
<email address hidden>> wrote:

> Public bug reported:
>
> librsync version 1.0.0 changes rs_sig_begin function API as
> -rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len);
> +rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
> + rs_long_t sig_magic);
>
>
> This makes the problem to compile duplicity/_librsyncmodule.c file.
> It uses the old rs_sig_begin format:
> sm->sig_job = rs_sig_begin((size_t)blocklen,
> (size_t)RS_DEFAULT_STRONG_LEN);
>
> ** Affects: duplicity
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1416344
>
> Title:
> librsync 1.0.0 breaks duplicity/_librsyncmodule.c compilation
>
> Status in Duplicity - Bandwidth Efficient Encrypted Backup:
> New
>
> Bug description:
> librsync version 1.0.0 changes rs_sig_begin function API as
> -rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len);
> +rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
> + rs_long_t sig_magic);
>
>
> This makes the problem to compile duplicity/_librsyncmodule.c file.
> It uses the old rs_sig_begin format:
> sm->sig_job = rs_sig_begin((size_t)blocklen,
> (size_t)RS_DEFAULT_STRONG_LEN);
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1416344/+subscriptions
>

Sorry, should have said librsync 0.9.7, which is available in most
repositories as librsync1.

librsync 1.0.0 has an incompatible file format and will break current
backup chains.

On Fri, Jan 30, 2015 at 6:39 AM, Kenneth Loafman <email address hidden>
wrote:

> Duplicity is not ready for librsync v1.0.0. Please continue to use the
> older 0.9.0 version.
>
>
> On Fri, Jan 30, 2015 at 4:32 AM, Roman Tereshonkov <
> <email address hidden>> wrote:
>
>> Public bug reported:
>>
>> librsync version 1.0.0 changes rs_sig_begin function API as
>> -rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len);
>> +rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
>> + rs_long_t sig_magic);
>>
>>
>> This makes the problem to compile duplicity/_librsyncmodule.c file.
>> It uses the old rs_sig_begin format:
>> sm->sig_job = rs_sig_begin((size_t)blocklen,
>> (size_t)RS_DEFAULT_STRONG_LEN);
>>
>> ** Affects: duplicity
>> Importance: Undecided
>> Status: New
>>
>> --
>> You received this bug notification because you are subscribed to
>> Duplicity.
>> https://bugs.launchpad.net/bugs/1416344
>>
>> Title:
>> librsync 1.0.0 breaks duplicity/_librsyncmodule.c compilation
>>
>> Status in Duplicity - Bandwidth Efficient Encrypted Backup:
>> New
>>
>> Bug description:
>> librsync version 1.0.0 changes rs_sig_begin function API as
>> -rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len);
>> +rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
>> + rs_long_t sig_magic);
>>
>>
>> This makes the problem to compile duplicity/_librsyncmodule.c file.
>> It uses the old rs_sig_begin format:
>> sm->sig_job = rs_sig_begin((size_t)blocklen,
>> (size_t)RS_DEFAULT_STRONG_LEN);
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/duplicity/+bug/1416344/+subscriptions
>>
>
>

Kari Hautio (khautio) wrote :

Backward compatibility can easily be achieved with librsync 1.0.0. If the sig_magic is set to RS_MD4_SIG_MAGIC.

The RS_DEFAULT_STRONG_LEN is also gone and thus the value is set in code.

Something like should be compatible with either version.

#ifdef RS_MD4_SIG_MAGIC // librasync >= 1.0.0
sm->sig_job = rs_sig_begin((size_t)blocklen,
                           (size_t)8, RS_MD4_SIG_MAGIC);
#else
sm->sig_job = rs_sig_begin((size_t)blocklen,
                           (size_t)RS_DEFAULT_STRONG_LEN);
#endif

Thanks khautio!

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.7.02
status: New → Fix Committed

The proposed solution will not work. It will fail for librasync >= 1.0.0.
RS_MD4_SIG_MAGIC is a constant of the enumeration.
So #ifdef RS_MD4_SIG_MAGIC is always false.
The possible working solution could be based
on RS_DEFAULT_STRONG_LEN which exists for
librasync < 1.0.0 only.

#ifdef RS_DEFAULT_STRONG_LEN
  sm->sig_job = rs_sig_begin((size_t)blocklen,
                           (size_t)RS_DEFAULT_STRONG_LEN);
#else /* librasync >= 1.0.0 */
  sm->sig_job = rs_sig_begin((size_t)blocklen,
                           (size_t)8, RS_MD4_SIG_MAGIC);
#endif

Fix has been committed in rev 1075. Thanks Roman for the catch.

On Thu, Feb 12, 2015 at 6:14 AM, Roman Tereshonkov <
<email address hidden>> wrote:

> The proposed solution will not work. It will fail for librasync >= 1.0.0.
> RS_MD4_SIG_MAGIC is a constant of the enumeration.
> So #ifdef RS_MD4_SIG_MAGIC is always false.
> The possible working solution could be based
> on RS_DEFAULT_STRONG_LEN which exists for
> librasync < 1.0.0 only.
>
> #ifdef RS_DEFAULT_STRONG_LEN
> sm->sig_job = rs_sig_begin((size_t)blocklen,
> (size_t)RS_DEFAULT_STRONG_LEN);
> #else /* librasync >= 1.0.0 */
> sm->sig_job = rs_sig_begin((size_t)blocklen,
> (size_t)8, RS_MD4_SIG_MAGIC);
> #endif
>
> --
> You received this bug notification because you are subscribed to
> Duplicity.
> https://bugs.launchpad.net/bugs/1416344
>
> Title:
> librsync 1.0.0 breaks duplicity/_librsyncmodule.c compilation
>
> Status in Duplicity - Bandwidth Efficient Encrypted Backup:
> Fix Committed
>
> Bug description:
> librsync version 1.0.0 changes rs_sig_begin function API as
> -rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len);
> +rs_job_t *rs_sig_begin(size_t new_block_len, size_t strong_sum_len,
> + rs_long_t sig_magic);
>
>
> This makes the problem to compile duplicity/_librsyncmodule.c file.
> It uses the old rs_sig_begin format:
> sm->sig_job = rs_sig_begin((size_t)blocklen,
> (size_t)RS_DEFAULT_STRONG_LEN);
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/duplicity/+bug/1416344/+subscriptions
>

Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers