Re: [BULK] RE: [BackupPC-users] Unexpected end of tar archive

2006-03-13 Thread Craig Barratt
Justin Best writes:

 Thanks for your help, Craig! I appreciate it so very much.
 
 I've filed a bug report with Samba, as you suggested.
 https://bugzilla.samba.org/show_bug.cgi?id=3592 
 
 Out of curiosity, though, it seems that you still have an open bug that
 references the same problem. In bug 563
 https://bugzilla.samba.org/show_bug.cgi?id=563
 you mentioned smbclient tar extract still only writes a maximum 2GB file;
 not sure why. Am I right in assuming that this is the same issue?  

That's a bug in the other direction (restoring large files).
Your bug is padding large locked files when creating an
archive).

 In any event, I'm still unfamiliar with how I should go about fixing this in
 my case. I assume that I need to download the source and modify it and
 recompile smbclient... but I haven't a clue on how to make padsize an
 unsigned int, as you suggest. I'm afraid that I know some ASP and PHP, and
 that's about it. Any direction about where to start with this would be
 appreciated.

You should download the latest source for samba, and edit
samba-3.X.X/source/client/clitar.c so that this line:

static int padit(char *buf, int bufsize, int padsize)

instead reads:

static int padit(char *buf, int bufsize, SMB_BIG_UINT padsize)

Then you should be able to run configure and make, then use
the resulting smbclient executable.

I haven't tested this fix, but it should be correct. 

Craig


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/


Re: [BULK] RE: [BackupPC-users] Unexpected end of tar archive

2006-02-21 Thread Craig Barratt
Justin Best writes:

  When Outlook is running, the PST file is locked and the backup fails
 
 I've been going with the assumption that this error was due to the
 apostrophe in the PST file name, since I *thought* the error disappeared
 when I renamed Madalyn's Personal Folders.pst to Madalyns Personal
 Folders.pst. I've since discovered that I was wrong.
 
 See attached log file for details. The error occurs consistently when
 BackupPC tries to back up this particular PST file, and can't because the
 PST file is locked. I get a ton of weird garbage in the log immediately
 following the attempt to back up the PST file.
 
 How do I go about troubleshooting this? My next guess is that it's related
 to the large size of the PST file in question. ( 2GB)  

Yes.  It's a bug in smbclient.

The problem is that smbclient emits the tar header (including the
file's size) before it notices the file is locked and cannot be
read.  It's too late at that point to omit the file from the
tar archive.  So it fills the tar archive with dummy data.
BackupPC notices the error message and removes the file,
since it just contains 0x0 data.

Looking at samba 3.0.7 (an old version, but the latest I have
around), samba-3.0.7/source/client/clitar.c does this:

/* pad tar file with zero's if we couldn't get entire file */
if (nread  finfo.size) {
DEBUG(0, (Didn't get entire file. size=%.0f, nread=%d\n,
(double)finfo.size, (int)nread));
if (padit(data, sizeof(data), finfo.size - nread))
DEBUG(0,(Error writing tar file - %s\n, strerror(errno)));
}

and padit() is:

static int padit(char *buf, int bufsize, int padsize)

Notice the padsize is an int, so above 2GB (your file is just
over 2GB), it is negative!

For a start, if you make padsize an unsigned int then you
should be good to 4GB.  But the real fix is to make padsize's
type SMB_BIG_UINT, which should be 64 bits on most modern
machines.  You should also file a bug and patch with samba.

Craig


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642
___
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/