diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-25 13:30:38 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-25 13:30:38 +0200 |
commit | 9a3aaaad1f569ca78bf4fcac8d107ed778f8639b (patch) | |
tree | 5a72aca46d448dc4c8306484d475a4e15b3b9aa6 /module/plugins | |
parent | removed prints (diff) | |
download | pyload-9a3aaaad1f569ca78bf4fcac8d107ed778f8639b.tar.xz |
dir chown
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/Plugin.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index e7914c287..a12dfa686 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -267,6 +267,15 @@ class Plugin(object): if not exists(location): makedirs(location, int(self.core.config["permission"]["folder"],8)) + if self.core.config["permission"]["change_dl"] and os.name != "nt": + try: + uid = getpwnam(self.config["permission"]["user"])[2] + gid = getgrnam(self.config["permission"]["group"])[2] + + chown(location, uid, gid) + except Exception,e: + self.log.warning(_("Setting User and Group failed: %s") % str(e)) + name = self.pyfile.name.encode(sys.getfilesystemencoding(), "replace") newname = self.req.download(url, name, location, get, post, ref, cookies) |