Fix previous commit
[debian/pino.git] / debian / patches / 001_sec-accounts-file.diff
1 Description:
2 Author: Julien Valroff <julien@kirya.net>
3 Bug: http://code.google.com/p/pino-twitter/issues/detail?id=48
4 Forwarded: yes
5
6 Index: pino/src/accounts.vala
7 ===================================================================
8 --- pino.orig/src/accounts.vala 2010-05-23 13:35:27.000000000 +0200
9 +++ pino/src/accounts.vala      2010-05-23 14:04:32.000000000 +0200
10 @@ -21,6 +21,7 @@
11  
12  using Xml;
13  using Gee;
14 +using GLib;
15  
16  namespace Auth {
17  
18 @@ -106,9 +107,14 @@
19                 var acc_file = File.new_for_path(acc_file_path);
20                 
21                 if(!acc_file.query_exists(null)) {
22 -                       //var pref_stream = pref_file.create(FileCreateFlags.NONE, null);
23 +                       var acc_stream = acc_file.create(FileCreateFlags.PRIVATE, null);
24                         is_new = true;
25                         return;
26 +               } else {
27 +                       // If accounts.xml already exists, make sure it is only readable by its owner
28 +                       // as it contains the credentials in clear text
29 +                       GLib.FileUtils.chmod(acc_file,0600);
30 +                       return;
31                 }
32                 
33                 //reading content