create config file with 0600 [and remove \n from print!!!!!
This commit is contained in:
parent
5570639beb
commit
6e29a8b524
|
@ -47,8 +47,8 @@ class OptionsParser:
|
|||
fd = open(self.__filename)
|
||||
except:
|
||||
if os.path.exists(self.__filename):
|
||||
#it is file about file
|
||||
print _('error: cannot open %s for reading\n') % self.__filename
|
||||
#it is file about file FIXME: bad comment
|
||||
print _('error: cannot open %s for reading') % self.__filename
|
||||
return
|
||||
|
||||
for line in fd.readlines():
|
||||
|
@ -74,10 +74,11 @@ class OptionsParser:
|
|||
try:
|
||||
fd = open(self.__tempfile, 'w')
|
||||
except:
|
||||
#we cannot write file in a directory
|
||||
err_str = _('Unable to write file in %s\n') % base_dir
|
||||
#chances are we cannot write file in a directory
|
||||
err_str = _('Unable to write file in %s') % base_dir
|
||||
print err_str
|
||||
return err_str
|
||||
os.chmod(self.__filename, 0600)
|
||||
try:
|
||||
gajim.config.foreach(self.write_line, fd)
|
||||
except IOError, e:
|
||||
|
|
Loading…
Reference in New Issue