rdiffdir patch crashes if a file is changed to a non-regular file (symlink, fifo, ...)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Duplicity version: 0.6.23-1ubuntu4.1
Python version: 2.7.6
Distro: Ubuntu 14.04 64bit
Traceback from the error:
Patching testfile
Traceback (most recent call last):
File "/usr/bin/
main()
File "/usr/bin/
patch(
File "/usr/bin/
patchdir.
File "/usr/lib/
patch_
File "/usr/lib/
ITR( basis_path.index, basis_path, diff_ropath )
File "/usr/lib/
last_
File "/usr/lib/
return function(*args)
File "/usr/lib/
assert diff_ropath.
AssertionError: snapshot
I'm not sure if this is a bug in delta generation or patching, but maybe it should be fixed in both ends. The delta file could include a delete for the original file before the symlink is created, and patching could add a special case for the reg->sym change.
Here's a sample script to reproduce this:
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: $0 <workdir>"
exit 1
fi
set -x
cd $1
rm -f rdiff-signature rdiff-delta
rm -rf source target
mkdir source target
touch source/testfile
ln -s otherfile target/testfile
rdiffdir -v9 sig source rdiff-signature
rdiffdir -v9 delta rdiff-signature target rdiff-delta
rdiffdir -v9 patch source rdiff-delta
tags: | added: rdiffdir |
summary: |
- rdiffdir patch crashes if a file is changed to a symlink + rdiffdir patch crashes if a file is changed to a non-regular file + (symlink, fifo, ...) |
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.7.03 |
status: | New → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
Here's a patch that fixes the rdiffdir patch command for me. I'm not sure if the difftype == "snapshot" is the correct way to detect a symlink, but it seems to work fine.
It looks like this bug affects other types of non-regular files as well (e.g. fifos).