Disable check for user and group options on Windows

This commit is contained in:
Calum Lind 2012-02-24 15:29:58 +00:00
parent 1696fd1103
commit b47dc73d30
1 changed files with 11 additions and 10 deletions

View File

@ -221,16 +221,17 @@ this should be an IP address", metavar="IFACE",
# Write pid file before chuid
write_pidfile()
if options.user:
if not options.user.isdigit():
import pwd
options.user = pwd.getpwnam(options.user)[2]
os.setuid(options.user)
if options.group:
if not options.group.isdigit():
import grp
options.group = grp.getgrnam(options.group)[2]
os.setuid(options.group)
if not deluge.common.windows_check():
if options.user:
if not options.user.isdigit():
import pwd
options.user = pwd.getpwnam(options.user)[2]
os.setuid(options.user)
if options.group:
if not options.group.isdigit():
import grp
options.group = grp.getgrnam(options.group)[2]
os.setuid(options.group)
open_logfile()