@require_root<EOL>def add_user(username, password):
assert _is_valid_username(username),"<STR_LIT>" % username<EOL>assert username not in passwd_reader.load_users(),"<STR_LIT>" % username<EOL>assert password, "<STR_LIT>"<EOL>home_dir = settings.DATA_PATH + username<EOL>sh.ftpasswd(<EOL>passwd=True,                    <EOL>name=username,<EOL>home=home_dir,                  <EOL>shell="<STR_LIT>",<EOL>uid=settings.PROFTPD_USERS_GID, <EOL>gid=settings.PROFTPD_USERS_GID,<EOL>stdin=True,                 <EOL>file=settings.LOGIN_FILE,<EOL>_in=password<EOL>)<EOL>if not os.path.exists(home_dir):<EOL><INDENT>os.makedirs(home_dir, <NUM_LIT>)<EOL><DEDENT>passwd_reader.set_permissions(home_dir, gid=settings.PROFTPD_USERS_GID)<EOL>passwd_reader.set_permissions(settings.LOGIN_FILE, mode=<NUM_LIT>)<EOL>create_lock_file(home_dir + "<STR_LIT:/>" + settings.LOCK_FILENAME)<EOL>reload_configuration()<EOL>
Adds record to passwd-like file for ProFTPD, creates home directory and
sets permissions for important files.

Args:
    username (str): User's name.
    password (str): User's password.