[meld] vcview: Make temporary version control files un-writable
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [meld] vcview: Make temporary version control files un-writable
- Date: Fri, 31 Dec 2010 23:56:50 +0000 (UTC)
commit 2a6085e37c07d9cfdf7adf7b1b371d76bceb7508
Author: Peter Tyser <ptyser gmail com>
Date:   Tue Aug 31 01:18:02 2010 -0500
    vcview: Make temporary version control files un-writable
    
    A version control diff is a diff of a local file vs the contents
    of a repository.  A user can't edit the repository directly, so they
    shouldn't be able to edit the temporary file representing the repository
    either.  This also prevents a user from accidentally modifying a
    temporary version control file in /tmp, saving it (thinking they were
    saving the "real", working copy), then having it be automatically
    removed when closing meld.
    
    Signed-off-by: Peter Tyser <ptyser gmail com>
 meld/vcview.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/meld/vcview.py b/meld/vcview.py
index e323cee..464c089 100644
--- a/meld/vcview.py
+++ b/meld/vcview.py
@@ -532,6 +532,7 @@ class VcView(melddoc.MeldDoc, gnomeglade.Component):
         patchcmd = self.vc.patch_command( tmpdir )
         if misc.write_pipe(patchcmd, patch, error=misc.NULL) == 0:
             for d in diffs:
+                os.chmod(d[0], 0444)
                 self.emit("create-diff", d)
             return True
         elif not silent:
[
Date Prev][Date Next]   [
Thread Prev][Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]