Gentoo Archives: gentoo-dev

From: Francesco R <vivo75@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] showing file diffs as root
Date: Mon, 31 May 2010 12:22:29
Message-Id: AANLkTileUGq2ODN_NFMw-iqhxvOXnSnYEGukzNYmjVAz@mail.gmail.com
In Reply to: [gentoo-dev] showing file diffs as root by Christopher Harvey
1 why not make a temporary copy of the files with appropriate permission,
2 send a message the application the user originally opened to diff the files,
3 then apply the user modified file and cleanup the $tmpdir?
4
5 This would leave the user the possibility to choose whatever application she
6 want to do the merge, which is a big plus.
7
8 2010/5/30 Christopher Harvey <chris@××××××××××××.com>
9
10 > -----BEGIN PGP SIGNED MESSAGE-----
11 > Hash: SHA1
12 >
13 > Hello gentoo-dev,
14 >
15 > I'm working on an app for GSoC that needs to show a diff of two files
16 > to the user. Right now I've just been calling meld from the python
17 > os.system call. I tried running my application as root to show diffs
18 > of system files that belong to root. I got this error:
19 >
20 > Traceback (most recent call last):
21 > File "/usr/bin/meld", line 90, in <module>
22 > meldapp.main()
23 > File "/usr/lib/meld/meldapp.py", line 982, in main
24 > app = MeldApp()
25 > File "/usr/lib/meld/meldapp.py", line 562, in __init__
26 > self.prefs = MeldPreferences()
27 > File "/usr/lib/meld/meldapp.py", line 435, in __init__
28 > super(MeldPreferences, self).__init__("/apps/meld", self.defaults)
29 > File "/usr/lib/meld/prefs.py", line 92, in __init__
30 > self._gconf.add_dir(rootkey, gconf.CLIENT_PRELOAD_NONE)
31 > glib.GError: Failed to contact configuration server; some possible
32 > causes are that you need to enable TCP/IP networking for ORBit, or you
33 > have stale NFS locks due to a system crash. See
34 > http://projects.gnome.org/gconf/ for information. (Details - 1:
35 > Failed to get connection to session: Did not receive a reply. Possible
36 > causes include: the remote application did not send a reply, the
37 > message bus security policy blocked the reply, the reply timeout
38 > expired, or the network connection was broken.)
39 >
40 > I haven't looked into why this is happening very much because calling
41 > os.system("meld file1 file2 &") in python is putting up so many red
42 > flags in my head it's not funny. If anybody could tell me the proper
43 > gentoo/linux/python way to present a root level diff to a user running
44 > a program through su or sudo I'd really appreciate the help.
45 >
46 > thanks,
47 > Chris
48 >
49 > - --
50 > My GnuPGP key at:
51 > www.basementcode.com/public_key.txt
52 > -----BEGIN PGP SIGNATURE-----
53 > Version: GnuPG v2.0.14 (GNU/Linux)
54 > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
55 >
56 > iQEcBAEBAgAGBQJMAn1RAAoJEDqfZIFeqFH7brQH/RqeUmCHuopa+SufkzNNT4Ys
57 > 7IJArQCik3vBLJLpeTM3gf3NL3KMWjyzlxxQ8L74KAhItPuA3cVUQKQrSnOCBiDa
58 > y6yfDttBbOptOtcUYn7WkXQDm+BYEdpviMfjtym5ZF2nlGOMzZMxknP4ywXnhLZN
59 > q2169haoG0p1g0D11q2H9B4Vk++PUil7VLgzOfAOcLQ9YpFDkXIdxy5FRaRkx8K4
60 > lcPfmzFha8OkdBpsXPJdhtY5pmzOEf+ziprDlyD7eCkE1xAkRNhjsNtEz9CTXeLh
61 > l46/tUCZTx+aX9ABW0m13Ache8jGN36+TvsRzRKfzqaMJ0z/wEOeESooPFYHnl0=
62 > =FxxJ
63 > -----END PGP SIGNATURE-----
64 >
65 >
66 >