duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Duplicity crashes on locked files (windows)


From: Kenneth Loafman
Subject: Re: [Duplicity-talk] Duplicity crashes on locked files (windows)
Date: Wed, 08 Apr 2009 12:29:38 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

Georg Lutz wrote:
>> I'll agree with that.  Do they block all OSS sites, or just some?
>>
> 
> They don't block especially OSS sites. They block sites where "software
> can be downloaded". And because downloaded software can cause harm it is
> evil to do so. Interestingly sourceforge.net is not blocked, so its not
> very consistent...
> 
> At one of my former working places internet ("WWW" in manager speak) was
> cut off completely as default setting and one have to argue why he would
> need internet access at all. This was the company wide IT policy. For 1 MB
> traffic my departement had to pay 0,5 EUR to the IT departement. The same
> guys also completely blocked zip files in emails for "security reasons"
> but let through powerpoint presentations. As you can imagine it was not
> funny to work there... Compared to that the current situation is like in
> paradise...

Been there, done that.  One of the places I was at was paying my base
rate plus a couple of extras (Windows, at their site), but the security
there was so strict I had to ask permission for everything, even when
the job I was tasked with had to access everything.  I figure I made at
least 30 percent more on that job just because of security delays.

>> I'm going to have to dig into this a bit further.  It looks like Windows
>> will let you open the file, but then not access it, not good.  I'll have
>> to apply the same checks further into the process.  I'll open a bug
>> report on this.  For now, just --exclude=**.pst and back it up to a
>> different file extension before duplicity.
>>
> 
> I just reproduced it and attached a logfile which comes out of processmon,
> a tool like strace on windows, formerly developed by sysinternals (now
> M$). I attached both - CVS text file and the native PML format.
> 
> It seems like you explained - one can open the file but not access it. BTW
> the crash can also be reproduced with opened Excel or OOWrite files.

This patch seems to work for me with OOWrite files.  Care to give it a
try with Outlook files?

...Ken

Index: duplicity/selection.py
===================================================================
RCS file: /sources/duplicity/duplicity/duplicity/selection.py,v
retrieving revision 1.20
diff -u -r1.20 selection.py
--- duplicity/selection.py      2 Apr 2009 14:47:15 -0000       1.20
+++ duplicity/selection.py      8 Apr 2009 17:23:04 -0000
@@ -33,9 +33,9 @@
 import stat
 
 from duplicity.path import *
-
 from duplicity import log
 from duplicity import globals
+from duplicity import diffdir
 
 class SelectError(Exception):
     """Some error dealing with the Select class"""
@@ -119,7 +119,7 @@
                 else:
                     log.Warn(_("Error initializing file %s/%s") % (path.name, 
filename))
             except OSError:
-                log.Warn(_("Error accessing possibly locked file %s/%s") % 
(path.name, filename));
+                log.Warn(_("Error accessing possibly locked file %s/%s") % 
(path.name, filename))
             return None
 
         def diryield(path):
@@ -135,7 +135,14 @@
             for filename in robust.listpath(path):
                 new_path = robust.check_common_error(
                     error_handler, Path.append, (path, filename))
-                if new_path:
+                # make sure file is read accessible
+                if (new_path and not new_path.type in ["sym"]
+                    and not os.access(new_path.name, os.R_OK)):
+                    log.Warn(_("Error accessing possibly locked file %s") % 
new_path.name)
+                    if diffdir.stats:
+                        diffdir.stats.Errors +=1
+                    new_path = None
+                elif new_path:
                     s = self.Select(new_path)
                     if s == 1:
                         yield (new_path, 0)

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]