[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rdiff-backup-users] Rdiff-backup fails to backup device files when
From: |
dean gaudet |
Subject: |
Re: [rdiff-backup-users] Rdiff-backup fails to backup device files when not root |
Date: |
Tue, 7 Nov 2006 02:01:34 -0800 (PST) |
On Mon, 6 Nov 2006, fake wrote:
>
> I have discovered a serious bug in rdiff-backup 1.1.5-3~bpo.1 from debian
> backports.org, were, when creating a backup as a none root user on the
> backup repository side, rdiff-backup fails to backup device files and
> possibly other special files.
> When rdiff-backup fails in this case it reports no errors and exits
> cleanly, giving the user the false impression that the backup was
> successful. This may result in data lose when a recover is attempted.
> Normally the read end usually needs root privileges to read and send
> special files for backup, but the write end may not be running as root for
> security reasons. I have created a test case were this is done on the
> localhost as root, to read the files for backup, and a normal user to
> write the backup.
>
> I have created and attached a test case script that demonstrates the bug,
> and a patch to overcome it.
hmm... first off, thanks for the wonderfully detailed report with test
case...
but i'm not sure i'm seeing the bug... here's what i see from your test:
--- snip ---
test_case.sh is about to remove /tmp/foo and /tmp/bar
Do you wish to continue? [y|anything else to quit]y
Source and target directories, if they existed, have been removed.
mkdir: created directory `/tmp/foo'
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.00105594 seconds, 970 kB/s
mode of `/tmp/foo/testfile' retained as 0644 (rw-r--r--)
total 12
drwxr-xr-x 2 root root 4096 Nov 7 01:44 .
drwxrwxrwt 7 root root 4096 Nov 7 01:44 ..
crw-rw-rw- 1 root root 1, 3 Nov 4 18:28 null
-rw-r--r-- 1 root root 1024 Nov 7 01:44 testfile
A new source directory has been set up with a device file and
a regular file.
Backing up /tmp/foo as user "dean".
su -m -c 'rdiff-backup --terminal-verbosity 2 --verbosity 9
--print-statistics ::/tmp/foo /tmp/bar' "dean"
--------------[ Session statistics ]--------------
StartTime 1162892650.00 (Tue Nov 7 01:44:10 2006)
EndTime 1162892650.22 (Tue Nov 7 01:44:10 2006)
ElapsedTime 0.22 (0.22 seconds)
SourceFiles 3
SourceFileSize 1024 (1.00 KB)
MirrorFiles 1
MirrorFileSize 0 (0 bytes)
NewFiles 2
NewFileSize 1024 (1.00 KB)
DeletedFiles 0
DeletedFileSize 0 (0 bytes)
ChangedFiles 1
ChangedSourceSize 0 (0 bytes)
ChangedMirrorSize 0 (0 bytes)
IncrementFiles 0
IncrementFileSize 0 (0 bytes)
TotalDestinationSizeChange 1024 (1.00 KB)
Errors 0
--------------------------------------------------
You can visually scan the preceding output for 'UpdateError' and also
notice rdiff-backup reported that it completed with 'Errors 0'.
test_case.sh can list the contents of '/tmp/bar' and the metedata file
ls -al /tmp/bar/*
-rw-rw-rw- 1 dean dean 0 Nov 7 01:44 /tmp/bar/null
-rw-r--r-- 1 dean dean 1024 Nov 7 01:44 /tmp/bar/testfile
/tmp/bar/rdiff-backup-data:
total 32
drwx------ 3 dean dean 4096 Nov 7 01:44 .
drwxr-xr-x 3 dean dean 4096 Nov 7 01:44 ..
-rw------- 1 dean dean 2256 Nov 7 01:44 backup.log
-rw------- 1 dean dean 0 Nov 7 01:44 chars_to_quote
-rw------- 1 dean dean 10 Nov 7 01:44
current_mirror.2006-11-07T01:44:10-08:00.data
-rw------- 1 dean dean 0 Nov 7 01:44
error_log.2006-11-07T01:44:10-08:00.data
-rw------- 1 dean dean 0 Nov 7 01:44
extended_attributes.2006-11-07T01:44:10-08:00.snapshot
-rw------- 1 dean dean 211 Nov 7 01:44
file_statistics.2006-11-07T01:44:10-08:00.data.gz
drwx------ 2 dean dean 4096 Nov 7 01:44 increments
-rw------- 1 dean dean 271 Nov 7 01:44
mirror_metadata.2006-11-07T01:44:10-08:00.snapshot.gz
-rw------- 1 dean dean 471 Nov 7 01:44
session_statistics.2006-11-07T01:44:10-08:00.data
File .
Type dir
ModTime 1162892647
Uid 0
Uname root
Gid 0
Gname root
Permissions 493
File null
Type dev
DeviceNum c 1 3
Uid 0
Uname root
Gid 0
Gname root
Permissions 438
File testfile
Type reg
Size 1024
SHA1Digest 10f3d636d534d92c1a98c33271080ee6d33373af
ModTime 1162892647
Uid 0
Uname root
Gid 0
Gname root
Permissions 420
--- snip ---
the metadata looks right...
and when i restore from it:
# PYTHONPATH=$RDB_CVS $RDB_CVS/rdiff-backup -r 0B bar baz
# find baz -ls
8896561 4 drwxr-xr-x 2 root root 4096 Nov 7 01:44 baz
8896563 0 crw-rw-rw- 1 root root Nov 7 01:50 baz/null
8896564 4 -rw-r--r-- 1 root root 1024 Nov 7 01:44 baz/testfile
do you see the bug with the current cvs head?
my box is linux...
-dean
p.s. oh i mod'd the script to use "PYTHONPATH=$RDB_CVS
$RDB_CVS/rdiff-backup" as well... so that it'd run from my cvs checkout
copy.