diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-20 21:44:06 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-20 21:44:06 +0200 |
commit | 8ca9c203877dfe8e61a441037da28d02fd61fd24 (patch) | |
tree | 131b92d143315c2de2d9bb962f2b3e8469ecfef4 /pyLoadCore.py | |
parent | fixed... (diff) | |
download | pyload-8ca9c203877dfe8e61a441037da28d02fd61fd24.tar.xz |
setuid fix
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 25 |
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: |