# 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

    def add_user(self, username, password, homedir, perm='elr',
                 msg_login="Login successful.", msg_quit="Goodbye."):
        """Add a user to the virtual users table.

        AuthorizerError exceptions raised on error conditions such as
        invalid permissions, missing home directory or duplicate usernames.

        Optional perm argument is a string referencing the user's
        permissions explained below:

        Read permissions:
         - "e" = change directory (CWD command)
         - "l" = list files (LIST, NLST, STAT, MLSD, MLST, SIZE, MDTM commands)
         - "r" = retrieve file from the server (RETR command)

        Write permissions:
         - "a" = append data to an existing file (APPE command)
         - "d" = delete file or directory (DELE, RMD commands)
         - "f" = rename file or directory (RNFR, RNTO commands)
         - "m" = create directory (MKD command)
         - "w" = store a file to the server (STOR, STOU commands)
         - "M" = change file mode (SITE CHMOD command)
         - "T" = update file last modified time (MFMT command)

        Optional msg_login and msg_quit arguments can be specified to
        provide customized response strings when user log-in and quit.
        """
        if self.has_user(username):
            raise ValueError('user %r already exists' % username)

# 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


    def add_user(self, username, password, homedir, perm='elr',
                 msg_login="Login successful.", msg_quit="Goodbye."):
        """Add a user to the virtual users table.

        AuthorizerError exceptions raised on error conditions such as
        invalid permissions, missing home directory or duplicate usernames.

        Optional perm argument is a string referencing the user's
        permissions explained below:

        Read permissions:
         - "e" = change directory (CWD command)
         - "l" = list files (LIST, NLST, STAT, MLSD, MLST, SIZE, MDTM commands)
         - "r" = retrieve file from the server (RETR command)

        Write permissions:
         - "a" = append data to an existing file (APPE command)
         - "d" = delete file or directory (DELE, RMD commands)
         - "f" = rename file or directory (RNFR, RNTO commands)
         - "m" = create directory (MKD command)
         - "w" = store a file to the server (STOR, STOU commands)
         - "M" = change file mode (SITE CHMOD command)
         - "T" = update file last modified time (MFMT command)

        Optional msg_login and msg_quit arguments can be specified to
        provide customized response strings when user log-in and quit.
        """
        if self.has_user(username):
            raise ValueError('user %r already exists' % username)

        if not isinstance(homedir, unicode):