diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-16 20:48:58 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-16 20:48:58 +0200 |
commit | 1486c0164b6ba2e20ce4513010c11c3a638f4b50 (patch) | |
tree | f508e27c52f2284b01bd41bf3d2fbf0bdc3a34e4 /pyLoadCore.py | |
parent | unrar fix (diff) | |
download | pyload-1486c0164b6ba2e20ce4513010c11c3a638f4b50.tar.xz |
permission settings
Diffstat (limited to 'pyLoadCore.py')
-rwxr-xr-x | pyLoadCore.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pyLoadCore.py b/pyLoadCore.py index 353737bce..12fcb3cff 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -192,6 +192,24 @@ 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 + group = getgrnam(self.config["permission"]["group"]) + os.setgid(group[2]) + except Exception, e: + print _("Failed changing group: %s") % e + self.check_file(self.config['log']['log_folder'], _("folder for logs"), True) if self.debug: |