From 0eb65f82a5c244d0a0444b7d49f3d4139f2f03a3 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Fri, 11 Jan 2008 18:40:35 +0000 Subject: Make the fix for #5586 work with security. --- diff --git a/Area.py b/Area.py index d1a25ee..e2ba9da 100644 --- a/Area.py +++ b/Area.py @@ -621,8 +621,9 @@ class Area(gtk.DrawingArea): @param self -- the Area object (GtkDrawingArea) """ clipBoard = gtk.Clipboard() - temp_dir = os.environ.get('SUGAR_ACTIVITY_ROOT', None) - if temp_dir is None: + if 'SUGAR_ACTIVITY_ROOT' in os.environ: + temp_dir = os.path.join(os.environ.get('SUGAR_ACTIVITY_ROOT'), 'instance') + else: temp_dir = '/tmp' f, tempPath = tempfile.mkstemp(suffix='.png', dir=temp_dir) @@ -633,6 +634,7 @@ class Area(gtk.DrawingArea): pixbuf_copy = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,True,8,size[0],size[1]) pixbuf_copy.get_from_drawable(self.pixmap_sel, gtk.gdk.colormap_get_system(),0,0,0,0,size[0],size[1]) pixbuf_copy.save(tempPath,'png') + os.chmod(tempPath, 0604) clipBoard.set_with_data( [('text/uri-list', 0, 0)], self._copyGetFunc, self._copyClearFunc, tempPath) else : diff --git a/NEWS b/NEWS index 765e8a2..4e4d40d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +* Make the fix for #5586 work with security. (tomeu) + 16 * #5586: Copy clippings as text/uri-list. (tomeu) -- cgit v0.9.1