mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +00:00
[#2818] [WebUI] Fix AttributeError starting WebUI on windows
This commit is contained in:
parent
c821cdd9c7
commit
c274d5114c
@ -84,16 +84,17 @@ class Web(UI):
|
||||
if self.options.pidfile:
|
||||
open(self.options.pidfile, "wb").write("%d\n" % os.getpid())
|
||||
|
||||
if self.options.group:
|
||||
if not self.options.group.isdigit():
|
||||
import grp
|
||||
self.options.group = grp.getgrnam(self.options.group)[2]
|
||||
os.setuid(self.options.group)
|
||||
if self.options.user:
|
||||
if not self.options.user.isdigit():
|
||||
import pwd
|
||||
self.options.user = pwd.getpwnam(self.options.user)[2]
|
||||
os.setuid(self.options.user)
|
||||
if not windows_check():
|
||||
if self.options.group:
|
||||
if not self.options.group.isdigit():
|
||||
import grp
|
||||
self.options.group = grp.getgrnam(self.options.group)[2]
|
||||
os.setuid(self.options.group)
|
||||
if self.options.user:
|
||||
if not self.options.user.isdigit():
|
||||
import pwd
|
||||
self.options.user = pwd.getpwnam(self.options.user)[2]
|
||||
os.setuid(self.options.user)
|
||||
|
||||
from deluge.ui.web import server
|
||||
self.__server = server.DelugeWeb(options=self.options)
|
||||
|
Loading…
x
Reference in New Issue
Block a user