diff --git a/glances/server.py b/glances/server.py index a4c5e88f..b6a907d5 100644 --- a/glances/server.py +++ b/glances/server.py @@ -67,7 +67,8 @@ class GlancesXMLRPCHandler(SimpleXMLRPCRequestHandler, object): if username in self.server.user_dict: from glances.password import GlancesPassword - pwd = GlancesPassword() + pwd = GlancesPassword(username=username, + config=self.config) return pwd.check_password(self.server.user_dict[username], password) else: return False @@ -93,10 +94,14 @@ class GlancesXMLRPCServer(SimpleXMLRPCServer, object): finished = False - def __init__(self, bind_address, bind_port=61209, requestHandler=GlancesXMLRPCHandler): + def __init__(self, bind_address, + bind_port=61209, + requestHandler=GlancesXMLRPCHandler, + config=None): self.bind_address = bind_address self.bind_port = bind_port + self.config = config try: self.address_family = socket.getaddrinfo(bind_address, bind_port)[0][0] except socket.error as e: @@ -191,7 +196,10 @@ class GlancesServer(object): # Init the XML RPC server try: - self.server = GlancesXMLRPCServer(args.bind_address, args.port, requestHandler) + self.server = GlancesXMLRPCServer(args.bind_address, + args.port, + requestHandler, + config=config) except Exception as e: logger.critical("Cannot start Glances server: {}".format(e)) sys.exit(2)