# 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
            """
            try:
                pwdstruct = pwd.getpwnam(username)
            except KeyError:
                raise AuthorizerError(self.msg_no_such_user)
            else:
                os.setegid(pwdstruct.pw_gid)
                os.seteuid(pwdstruct.pw_uid)

        def terminate_impersonation(self, username):
            """Revert process effective user/group IDs."""
            os.setegid(PROCESS_GID)
            os.seteuid(PROCESS_UID)

        @replace_anonymous
        def has_user(self, username):
            """Return True if user exists on the Unix system.
            If the user has been black listed via allowed_users or
            rejected_users options always return False.
            """
            return username in self._get_system_users()

        @replace_anonymous
        def get_home_dir(self, username):
            """Return user home directory."""
            try:
                home = pwd.getpwnam(username).pw_dir
            except KeyError:
                raise AuthorizerError(self.msg_no_such_user)
            else:

# 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

            """
            try:
                pwdstruct = pwd.getpwnam(username)
            except KeyError:
                raise AuthorizerError(self.msg_no_such_user)
            else:
                os.setegid(pwdstruct.pw_gid)
                os.seteuid(pwdstruct.pw_uid)

        def terminate_impersonation(self, username):
            """Revert process effective user/group IDs."""
            os.setegid(PROCESS_GID)
            os.seteuid(PROCESS_UID)

        @replace_anonymous
        def has_user(self, username):
            """Return True if user exists on the Unix system.
            If the user has been black listed via allowed_users or
            rejected_users options always return False.
            """
            return username in self._get_system_users()

        @replace_anonymous
        def get_home_dir(self, username):
            """Return user home directory."""
            try:
                home = pwd.getpwnam(username).pw_dir
            except KeyError:
                raise AuthorizerError(self.msg_no_such_user)
            else:

                if not PY3: