[Box Backup] Symlink error in bbackupd?

Chris Wilson boxbackup@fluffy.co.uk
Wed, 7 Nov 2007 19:26:27 +0000 (GMT)


Hi Hans-Joachim,

On Wed, 7 Nov 2007, Hans-Joachim Baader wrote:

>> Thanks for the detailed report, I've found and fixed the bug now. Will 
>> get it into trunk as soon as I can write to Subversion again.
>
> I guess you added the fix in changeset 1923. However I cannot verify 
> that it fixes the problem. My trace shows no access to lstat.

That's strange, this is what I get during the test for the bug (which did 
fail before I fixed the code):

open("rt1/symlink_test/b/link", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0666) 
= 5
read(4, "\27\3\1\0 ", 5)                = 5
read(4, ..., 32)                        = 32
read(4, "\27\3\1\0\320", 5)             = 5
read(4, ..., 208)                       = 208
close(5)                                = 0
unlink("rt1/symlink_test/b/link")       = 0
symlink("/home/chris/project/boxi/bb-trunk/debug/test/bbackupd/testfiles/TestDir1/symlink_test/a/subdir", 
"rt1/symlink_test/b/link") = 0
geteuid32()                             = 500
write(1, ".", 1)                        = 1
lstat64("rt1/symlink_test/b/link", {st_mode=S_IFLNK|0777, st_size=94, 
...}) = 0
geteuid32()                             = 500
chmod("rt1/symlink_test/b", 0775)       = 0
geteuid32()                             = 500
chmod("rt1/symlink_test", 0755)         = 0
geteuid32()                             = 500
chmod("rt1", 0775)                      = 0

Note that there is an lstat64() now, where there used to be a stat64() 
before.

> Were there changes to bbackupd? I only tried the latest bbackupquery. 
> Maybe you missed a 'stat' somewhere or I missed to redo the backup.

No changes to bbackupd, I didn't miss a stat, and the backup doesn't need 
to be redone. The error is only on restore. The change is one line, 
changing stat() to lstat() in lib/common/Utils.cpp.

Cheers, Chris.
-- 
_____ __     _
\  __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |