summaryrefslogtreecommitdiffstats
path: root/pyLoadCore.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-20 21:44:06 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-09-20 21:44:06 +0200
commit8ca9c203877dfe8e61a441037da28d02fd61fd24 (patch)
tree131b92d143315c2de2d9bb962f2b3e8469ecfef4 /pyLoadCore.py
parentfixed... (diff)
downloadpyload-8ca9c203877dfe8e61a441037da28d02fd61fd24.tar.xz
setuid fix
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-xpyLoadCore.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py
index e4bfbbb36..e0322975e 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -193,16 +193,8 @@ class Core(object):
self.debug = self.doDebug or self.config['general']['debug_mode']
- if self.config["permission"]["change_user"]:
- if os.name != "nt":
- try:
- from pwd import getpwnam
- user = getpwnam(self.config["permission"]["user"])
- os.setuid(user[2])
- except Exception, e:
- print _("Failed changing user: %s") % e
-
if self.config["permission"]["change_group"]:
+
if os.name != "nt":
try:
from grp import getgrnam
@@ -211,6 +203,15 @@ class Core(object):
except Exception, e:
print _("Failed changing group: %s") % e
+ if self.config["permission"]["change_user"]:
+ if os.name != "nt":
+ try:
+ from pwd import getpwnam
+ user = getpwnam(self.config["permission"]["user"])
+ os.setuid(user[2])
+ except Exception, e:
+ print _("Failed changing user: %s") % e
+
self.check_file(self.config['log']['log_folder'], _("folder for logs"), True)
if self.debug:
@@ -251,7 +252,7 @@ class Core(object):
self.server_methods = ServerMethods(self)
self.scheduler = Scheduler(self)
-
+
#hell yeah, so many important managers :D
self.files = FileHandler(self)
self.pluginManager = PluginManager(self)
@@ -306,10 +307,10 @@ class Core(object):
f.close()
f = open(link_file, "wb")
f.close()
-
+
#self.scheduler.start()
self.scheduler.addJob(0, self.accountManager.cacheAccountInfos)
-
+
while True:
sleep(2)
if self.do_restart: