modify rsync: read files from a tar archive

Adrian 'Dagurashibanipal' von Bidder avbidder at fortytwo.ch
Sun Oct 17 20:19:15 GMT 2004


Yodel!


I'm trying to modify rsync so that it can read the source files from a tar 
archive instead of a file system.  I want to use this so I can fetch whole 
filesystems from a fileserver with (i) a more efficient storage of the 
filesystem images on the server and above all (ii) the process fetching the 
filesystem image doesn't need any privileges on the fileserver (even if 
some of the files are 0700 for root etc.), suid-root binaries on the 
fileserver won't be lying around where they shouldn't etc. etc. - 
obviously, things like systemimager and cfengine could use this feature.

Mode of use: something like
rsync --tar /filesystem/image/file.tar target/file/system

this would not copy file.tar but would act like file.tar was unpacked in the 
source directory.


As places to modify, I identified the send_file_list function (and, going 
from there, send_uid_list) and the send_files functions.


I plan to look at the implementation of the --files-from option, at least 
for the implementation of send_file_list: just fetch the list of files from 
that tar file instead of a file.  libtar would be used to access the tar 
file.


Perhaps somebody has tried to do this before?  Any pitfalls obvious to those 
knowing the rsync code?  Any pointers to documentation that is a 'must 
read' if I want to hack on rsync? AFAICT it should be entirely possible to 
implement this without protocol change.


So far, on my Debian testing/unstable mixed system, using rsync 2.6.3 as 
base, I've noticed a few trivial things about the build system:
 - there are several warnings about implicit desclaration of strlcpy
 - flist.c:763,1026,1042: warning: comparison between signed and unsigned
 - 'make proto' seems to have issues on my system - it starts to include 
whole files and/or functions instead of just prototypes. 

I haven't investigated these at all - might be a problem with the local 
awk/sed/autoconf/... versions.  Data available on request, of course.



So long. I'll keep you informed when I have some results.


regards
-- vbi



-- 
<zarkov> "NT 5.0.  All the bugs and ten times the code size!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 388 bytes
Desc: not available
Url : http://lists.samba.org/archive/rsync/attachments/20041017/6221e61f/attachment.bin


More information about the rsync mailing list