bugrdiff-backup - Bugs: bug #22407, UpdateError with hardlinked und...

 
 

bug #22407: UpdateError with hardlinked und suid files

Submitted by:  Christian Hattemer <krille>
Submitted on:  Sun 24 Feb 2008 09:49:35 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 14 Jun 2008 05:04:05 PM UTC, comment #1:

Hi,

I cannot reproduce this bug using the CVS version of rdiff-backup. I am going to mark the bug as fixed. There have been many bug fixes for issues related to this over the last few years in the 1.1.x branch, so I assume that this got straightened-out at some point.

Also, the current version of the rdiff-backup manpage does not say that the hardlink information would be preserved in the metadata if --no-hard-links is specified. I don't know when that change took place.

If you have any questions, or wish to provide a testcase which I can check against the CVS version, please re-open or file a new bug report.

Thanks,
Andrew

Andrew Ferguson <owsla>
Project Administrator
Sun 24 Feb 2008 09:49:35 PM UTC, original submission:

Hi,

I'm using rdiff-backup 1.0.5 on NetBSD 4.0 and found the following problem:

If the backup contains files that are both hardlinked and have set user id status and the writer-part of rdiff-backup is running as an unprivileged user, then rdiff-backup will only mirror the first name of each set of hardlinked files.

Example:
krille@webster:~ > rdiff-backup /usr/bin userbackup
UpdateError atq Updated mirror temp file userbackup/rdiff-backup.tmp.10 does not match source
UpdateError atrm Updated mirror temp file userbackup/rdiff-backup.tmp.11 does not match source
UpdateError batch Updated mirror temp file userbackup/rdiff-backup.tmp.18 does not match source
UpdateError chpass Updated mirror temp file userbackup/rdiff-backup.tmp.40 does not match source
UpdateError chsh Updated mirror temp file userbackup/rdiff-backup.tmp.41 does not match source
UpdateError passwd Updated mirror temp file userbackup/rdiff-backup.tmp.243 does not match source
UpdateError systat Updated mirror temp file userbackup/rdiff-backup.tmp.335 does not match source
UpdateError yppasswd Updated mirror temp file userbackup/rdiff-backup.tmp.404 does not match source

The problematic files look like this:
krille@webster:/usr/bin > ll -i at atq atrm batch
8225590 -r-sr-xr-x 4 root wheel 27K Nov 10 15:02 at
8225590 -r-sr-xr-x 4 root wheel 27K Nov 10 15:02 atq
8225590 -r-sr-xr-x 4 root wheel 27K Nov 10 15:02 atrm
8225590 -r-sr-xr-x 4 root wheel 27K Nov 10 15:02 batch

In the mirror there's only at:
krille@webster:~/userbackup > ll at
-r-xr-xr-x 1 krille users 27K Nov 10 15:02 at

The metatdata shows this:
File at
Type reg
Size 28147
NumHardLinks 4
Inode 8225590
DeviceLoc 0
ModTime 1194703348
Uid 0
Uname root
Gid 0
Gname wheel
Permissions 2413

The other hardlinked names are missing.

If the writer-part of rdiff-backup is running as root, or if a file is only hardlinked or only suid, but not both at the same time, then everything is fine.

Here's some output with -v7 and a bit of my own debug output. This was created by printing self.data and other.data in rpath.py:equal_loose().

Processing changed file at
Regular copying ('at',) to testbackup/rdiff-backup.tmp.9
Writing file object to testbackup/rdiff-backup.tmp.9
Copying attributes from ('at',) to testbackup/rdiff-backup.tmp.9
Setting time of testbackup/rdiff-backup.tmp.9 to 1167757801
self:{'uid': 0, 'perms': 2413, 'type': 'reg', 'gname': 'wheel', 'ctime': 1167766012, 'devloc': 0L, 'uname': 'root', 'nlink': 4, 'gid': 0, 'mtime': 1167757801, 'atime': 1203881372, 'inode': 3630396L, 'size': 28094L}
othe:{'uid': 1000, 'perms': 2413, 'type': 'reg', 'gname': 'users', 'ctime': 1203881961, 'devloc': 0L, 'uname': 'krille', 'nlink': 1, 'gid': 100, 'mtime': 1167757801, 'atime': 1203881961, 'inode': 1380740L, 'size': 28094L}
Renaming testbackup/rdiff-backup.tmp.9 to testbackup/at
Processing changed file atq
Hard linking testbackup/rdiff-backup.tmp.10 to testbackup/at
self:{'uid': 0, 'perms': 2413, 'type': 'reg', 'gname': 'wheel', 'ctime': 1167766012, 'devloc': 0L, 'uname': 'root', 'nlink': 4, 'gid': 0, 'mtime': 1167757801, 'atime': 1203881961, 'inode': 3630396L, 'size': 28094L}
othe:{'uid': 1000, 'perms': 365, 'type': 'reg', 'gname': 'users', 'ctime': 1203881961, 'devloc': 0L, 'uname': 'krille', 'nlink': 2, 'gid': 100, 'mtime': 1167757801, 'atime': 1203881961, 'inode': 1380740L, 'size': 28094L}
Deleting testbackup/rdiff-backup.tmp.10

It fails here since the perms are different. I think the real cause of this is that the metadata for the new file wasn't recorded for some reason. (Please note that this last example was created on a different version of the OS, but that shouldn't make any difference.)

Could this be fixed?

BTW: Using --no-hard-links works around this problem. With this option everything runs fine where it otherwise doesn't. However it seems that this option doesn't operate as advertised in the man-page.

It says that the files won't be hardlinked on the mirror but that the information would still be preserved in the metadata. However the files are neither linked nor is the link information recorded in the metadata. Please fix the code or the man-page, at your option.

Christian Hattemer <krille>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by owsla (Posted a comment)
  • -unavailable- added by krille (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 14 Jun 2008 05:04:05 PM UTCowslaStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1