# Path: pyftpdlib/_compat.py
# PY3 = sys.version_info[0] == 3
# 
# Path: pyftpdlib/_compat.py
# PY3 = sys.version_info[0] == 3
# _SENTINEL = object()
#     def u(s):
#     def b(s):
#     def u(s):
#     def b(s):
#     def callable(obj):
#     def _instance_checking_exception(base_exception=Exception):
#         def wrapped(instance_checker):
#                 def __init__(self, *args, **kwargs):
#                     def __instancecheck__(cls, inst):
#                     def __subclasscheck__(cls, classinfo):
#     def FileNotFoundError(inst):
#     def FileExistsError(inst):
#     def super(type_=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
#             class TemporaryClass(base_exception):
#                 class __metaclass__(type):
# 
# Path: pyftpdlib/_compat.py
# PY3 = sys.version_info[0] == 3
# _SENTINEL = object()
#     def u(s):
#     def b(s):
#     def u(s):
#     def b(s):
#     def callable(obj):
#     def _instance_checking_exception(base_exception=Exception):
#         def wrapped(instance_checker):
#                 def __init__(self, *args, **kwargs):
#                     def __instancecheck__(cls, inst):
#                     def __subclasscheck__(cls, classinfo):
#     def FileNotFoundError(inst):
#     def FileExistsError(inst):
#     def super(type_=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
#             class TemporaryClass(base_exception):
#                 class __metaclass__(type):


import errno
import os
import sys
import warnings
    import crypt
    import pwd
    import spwd
    import pywintypes
    import win32api
    import win32con
    import win32net
    import win32security
        import _winreg as winreg
        import winreg
from ._compat import PY3
from ._compat import getcwdu
from ._compat import unicode
            home = self.get_home_dir(self.anonymous_user)
            if not os.path.isdir(home):
                raise AuthorizerError('no valid home set for user %s'
                                      % self.anonymous_user)

    def override_user(self, username, password=None, homedir=None, perm=None,
                      msg_login=None, msg_quit=None):
        """Overrides the options specified in the class constructor
        for a specific user.
        """
        if (not password and not homedir and not perm and not msg_login and not
                msg_quit):
            raise AuthorizerError(
                "at least one keyword argument must be specified")
        if self.allowed_users and username not in self.allowed_users:
            raise AuthorizerError('%s is not an allowed user' % username)
        if self.rejected_users and username in self.rejected_users:
            raise AuthorizerError('%s is not an allowed user' % username)
        if username == "anonymous" and password:
            raise AuthorizerError("can't assign password to anonymous user")
        if not self.has_user(username):
            raise AuthorizerError('no such user %s' % username)
        if homedir is not None and not isinstance(homedir, unicode):
            homedir = homedir.decode('utf8')

        if username in self._dummy_authorizer.user_table:
            # re-set parameters
            del self._dummy_authorizer.user_table[username]
        self._dummy_authorizer.add_user(username,
                                        password or "",

# Path: pyftpdlib/_compat.py
# PY3 = sys.version_info[0] == 3
# 
# Path: pyftpdlib/_compat.py
# PY3 = sys.version_info[0] == 3
# _SENTINEL = object()
#     def u(s):
#     def b(s):
#     def u(s):
#     def b(s):
#     def callable(obj):
#     def _instance_checking_exception(base_exception=Exception):
#         def wrapped(instance_checker):
#                 def __init__(self, *args, **kwargs):
#                     def __instancecheck__(cls, inst):
#                     def __subclasscheck__(cls, classinfo):
#     def FileNotFoundError(inst):
#     def FileExistsError(inst):
#     def super(type_=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
#             class TemporaryClass(base_exception):
#                 class __metaclass__(type):
# 
# Path: pyftpdlib/_compat.py
# PY3 = sys.version_info[0] == 3
# _SENTINEL = object()
#     def u(s):
#     def b(s):
#     def u(s):
#     def b(s):
#     def callable(obj):
#     def _instance_checking_exception(base_exception=Exception):
#         def wrapped(instance_checker):
#                 def __init__(self, *args, **kwargs):
#                     def __instancecheck__(cls, inst):
#                     def __subclasscheck__(cls, classinfo):
#     def FileNotFoundError(inst):
#     def FileExistsError(inst):
#     def super(type_=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
#             class TemporaryClass(base_exception):
#                 class __metaclass__(type):


# Path: pyftpdlib/authorizers.py
import errno
import os
import sys
import warnings
    import crypt
    import pwd
    import spwd
    import pywintypes
    import win32api
    import win32con
    import win32net
    import win32security
        import _winreg as winreg
        import winreg
from ._compat import PY3
from ._compat import getcwdu
from ._compat import unicode

            home = self.get_home_dir(self.anonymous_user)
            if not os.path.isdir(home):
                raise AuthorizerError('no valid home set for user %s'
                                      % self.anonymous_user)

    def override_user(self, username, password=None, homedir=None, perm=None,
                      msg_login=None, msg_quit=None):
        """Overrides the options specified in the class constructor
        for a specific user.
        """
        if (not password and not homedir and not perm and not msg_login and not
                msg_quit):
            raise AuthorizerError(
                "at least one keyword argument must be specified")
        if self.allowed_users and username not in self.allowed_users:
            raise AuthorizerError('%s is not an allowed user' % username)
        if self.rejected_users and username in self.rejected_users:
            raise AuthorizerError('%s is not an allowed user' % username)
        if username == "anonymous" and password:
            raise AuthorizerError("can't assign password to anonymous user")
        if not self.has_user(username):
            raise AuthorizerError('no such user %s' % username)
        if homedir is not None and not isinstance(homedir, unicode):
            homedir = homedir.decode('utf8')

        if username in self._dummy_authorizer.user_table:
            # re-set parameters
            del self._dummy_authorizer.user_table[username]
        self._dummy_authorizer.add_user(username,
                                        password or "",

                                        homedir or getcwdu(),