summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-07 22:11:27 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-07 22:11:27 +0100
commita67b1efd6ef96b9f942dfb521ede1d07eb1b0ed9 (patch)
tree1b8af90c4d2e6af2795c2f980f5206a4ea9e17d7
parentlittle fix (diff)
downloadpyload-a67b1efd6ef96b9f942dfb521ede1d07eb1b0ed9.tar.xz
closed #234
-rw-r--r--module/ConfigParser.py2
-rw-r--r--module/DatabaseBackend.py5
-rw-r--r--module/Utils.py7
-rw-r--r--module/plugins/AccountManager.py2
-rw-r--r--module/plugins/hooks/CaptchaTrader.py2
5 files changed, 16 insertions, 2 deletions
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index a8ecf6324..55db6b3e3 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -7,6 +7,7 @@ from os.path import join
from shutil import copy
from traceback import print_exc
+from utils import chmod
IGNORE = ("FreakshareNet", "SpeedManager")
#ignore this plugin configs
@@ -220,6 +221,7 @@ class ConfigParser:
def saveConfig(self, config, filename):
"""saves config to filename"""
with open(filename, "wb") as f:
+ chmod(filename, 0600)
f.write("version: %i \n" % CONF_VERSION)
for section in config.iterkeys():
f.write('\n%s - "%s":\n' % (section, config[section]["desc"]))
diff --git a/module/DatabaseBackend.py b/module/DatabaseBackend.py
index d74950855..1c40f270b 100644
--- a/module/DatabaseBackend.py
+++ b/module/DatabaseBackend.py
@@ -25,9 +25,10 @@ from os.path import exists
from shutil import move
from Queue import Queue
-
from traceback import print_exc
+from utils import chmod
+
try:
from pysqlite2 import dbapi2 as sqlite3
except:
@@ -112,6 +113,8 @@ class DatabaseBackend(Thread):
convert = self._checkVersion() #returns None or current version
self.conn = sqlite3.connect("files.db")
+ chmod("files.db", 0600)
+
self.c = self.conn.cursor() #compatibility
if convert is not None:
diff --git a/module/Utils.py b/module/Utils.py
index de07a9450..2d8a0423e 100644
--- a/module/Utils.py
+++ b/module/Utils.py
@@ -2,10 +2,17 @@
""" Store all usefull functions here """
+import os
import sys
import time
from os.path import join
+def chmod(*args):
+ try:
+ os.chmod(*args)
+ except:
+ pass
+
def save_join(*args):
""" joins a path, encoding aware """
paths = []
diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py
index d0955ecee..bd0871705 100644
--- a/module/plugins/AccountManager.py
+++ b/module/plugins/AccountManager.py
@@ -21,6 +21,7 @@ from os.path import exists
from shutil import copy
from module.PullEvents import AccountUpdateEvent
+from module.utils import chmod
ACC_VERSION = 1
@@ -127,6 +128,7 @@ class AccountManager():
f.write("\t@%s %s\n" % (option, " ".join(values)))
f.close()
+ chmod(f.name, 0600)
#----------------------------------------------------------------------
diff --git a/module/plugins/hooks/CaptchaTrader.py b/module/plugins/hooks/CaptchaTrader.py
index 77c30b7d7..f98b5fab0 100644
--- a/module/plugins/hooks/CaptchaTrader.py
+++ b/module/plugins/hooks/CaptchaTrader.py
@@ -123,7 +123,7 @@ class CaptchaTrader(Hook):
def captchaWrong(self, task):
if task.data.has_key("ticket"):
ticket = task.data["ticket"]
- self.respond(ticket, True)
+ self.respond(ticket, False)
def processCaptcha(self, task):
c = task.captchaFile