chmod bad permisioned dirs
This commit is contained in:
parent
4da5581f03
commit
9cabb5e830
|
@ -20,6 +20,8 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import stat
|
||||||
|
|
||||||
import common.gajim
|
import common.gajim
|
||||||
from common import i18n
|
from common import i18n
|
||||||
_ = i18n._
|
_ = i18n._
|
||||||
|
@ -42,13 +44,21 @@ class Logger:
|
||||||
print _('Gajim will now exit')
|
print _('Gajim will now exit')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
elif os.path.isdir(dot_gajim):
|
elif os.path.isdir(dot_gajim):
|
||||||
if os.path.isfile(LOGPATH):
|
s = os.stat(dot_gajim)
|
||||||
|
if s.st_mode & stat.S_IROTH: # others have read permission!
|
||||||
|
os.chmod(fname, 0700) # rwx------
|
||||||
|
|
||||||
|
if not os.path.exists(LOGPATH):
|
||||||
|
print _('creating %s directory') % LOGPATH
|
||||||
|
os.mkdir(LOGPATH, 0700)
|
||||||
|
elif os.path.isfile(LOGPATH):
|
||||||
print _('%s is file but it should be a directory') % LOGPATH
|
print _('%s is file but it should be a directory') % LOGPATH
|
||||||
print _('Gajim will now exit')
|
print _('Gajim will now exit')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
elif not os.path.exists(LOGPATH):
|
elif os.path.isdir(LOGPATH):
|
||||||
print _('creating %s directory') % LOGPATH
|
s = os.stat(LOGPATH)
|
||||||
os.mkdir(LOGPATH, 0700)
|
if s.st_mode & stat.S_IROTH: # others have read permission!
|
||||||
|
os.chmod(LOGPATH, 0700) # rwx------
|
||||||
else: # dot_gajim doesn't exist
|
else: # dot_gajim doesn't exist
|
||||||
if dot_gajim: # is '' on win9x so avoid that
|
if dot_gajim: # is '' on win9x so avoid that
|
||||||
print _('creating %s directory') % dot_gajim
|
print _('creating %s directory') % dot_gajim
|
||||||
|
|
Loading…
Reference in New Issue