/**************************************************************************//**
* Prints a brief summary of options and defaults
*/ staticvoid
usage(void)
{
g_printf("xrdp auth module tester v" PACKAGE_VERSION "\n");
g_printf("\n" "Calls functions in the compiled-in auth module, so that the\n" "module can be checked simply for functionality, memory leaks,\n" "etc.\n\n" "This is a DEVELOPER-ONLY tool\n");
g_printf("\nusage:\n");
g_printf("authtest [options] [username]\n\n");
g_printf("options:\n");
g_printf(" -p <password>\n" " -F <file-descriptor> Read password from this file descriptor\n" " -c <command> Start a session and run the\n" " specified non-interactive command\n" " in it\n");
g_printf("\nIf username is omitted, the current user is used, and.\n" "a UDS login is attempted\n" "If username is provided, password is needed.\n" " Password is prompted for if -p or -F are not specified\n");
}
/**************************************************************************//**
* Read a password from a file descriptor
*
* @param fd_str string representing file descriptor
* @param sp Authmod parameter structure for resulting password
* @return !=0for success
*/ staticint
read_password_from_fd(constchar *fd_str, struct authmod_params *amp)
{ int result = 0; int s = g_file_read(atoi(fd_str), amp->password, sizeof (amp->password) - 1); if (s < 0)
{
LOG(LOG_LEVEL_ERROR, "Can't read password from fd %s - %s",
fd_str, g_get_strerror());
amp->password[0] = '\0';
} else
{
amp->password[s] = '\0'; if (s > 0 && amp->password[s - 1] == '\n')
{
amp->password[s - 1] = '\0';
}
result = 1;
} return result;
}
/**************************************************************************//**
* Parses the program args
*
* @param argc Passed to main
* @param @argv Passed to main
* @param amp Authmod parameter structure for resulting values
* @return !=0for success
*/ staticint
parse_program_args(int argc, char *argv[], struct authmod_params *amp)
{ int params_ok = 1; int opt;
bool_t password_set = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.