</listitem>
</varlistentry>
<varlistentry>
+ <term>--authonly</term>
+ <listitem>
+ <para>
+ Only authenticates. This is useful to test your credentials (username and password). Returns status code 0 if the client can connect, 1 otherwise. Requires a username, password and connection host at the command line.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>--no-fastpath</term>
<listitem>
<para>
if (arg_parse_result < 0)
{
if (arg_parse_result == FREERDP_ARGS_PARSE_FAILURE)
- printf("failed to parse arguments.\n");
+ fprintf(stderr, "%s:%d: failed to parse arguments.\n", __FILE__, __LINE__);
exit(XF_EXIT_PARSE_ARGUMENTS);
}
freerdp_channels_pre_connect(xfi->_context->channels, instance);
+
+ if (settings->authentication_only) {
+ /* Check --authonly has a username and password. */
+ if (settings->username == NULL ) {
+ fprintf(stderr, "--authonly, but no -u username. Please provide one.\n");
+ exit(1);
+ }
+ if (settings->password == NULL ) {
+ fprintf(stderr, "--authonly, but no -p password. Please provide one.\n");
+ exit(1);
+ }
+ fprintf(stderr, "%s:%d: Authenication only. Don't connect to X.\n", __FILE__, __LINE__);
+ // Avoid XWindows initialization and configuration below.
+ return true;
+ }
+
xfi->display = XOpenDisplay(NULL);
if (xfi->display == NULL)
xf_free(((xfContext*) instance->context)->xfi);
return XF_EXIT_CONN_FAILED;
}
+ /* Connection succeeded. --authonly ? */
+ if (instance->settings->authentication_only) {
+ freerdp_disconnect(instance);
+ exit(0);
+ }
xfi = ((xfContext*) instance->context)->xfi;
channels = instance->context->channels;
ALIGN64 char* tsg_username; /* 66 */
ALIGN64 char* tsg_password; /* 67 */
ALIGN64 boolean local; /* 68 */
- ALIGN64 uint64 paddingC[80 - 69]; /* 69 */
+ ALIGN64 boolean authentication_only; /* 69 */
+ ALIGN64 uint64 paddingC[80 - 70]; /* 70 */
/* User Interface Parameters */
ALIGN64 boolean sw_gdi; /* 80 */
if(!connectErrorCode){
connectErrorCode = PREECONNECTERROR;
}
- printf("freerdp_pre_connect failed\n");
+ fprintf(stderr, "%s:%d: freerdp_pre_connect failed\n", __FILE__, __LINE__);
return false;
}
status = rdp_client_connect(rdp);
+ // --authonly tests the connection without a UI
+ if (instance->settings->authentication_only) {
+ fprintf(stderr, "%s:%d: Authentication only, exit status %d\n", __FILE__, __LINE__, !status);
+ return true;
+ }
if (status)
{
settings->encryption_level = ENCRYPTION_LEVEL_NONE;
settings->authentication = true;
+ settings->authentication_only = false;
settings->received_caps = xzalloc(32);
settings->order_support = xzalloc(32);
" --app: RemoteApp connection. This implies -g workarea\n"
" --ext: load an extension\n"
" --no-auth: disable authentication\n"
+ " --authonly: authentication only, no UI\n"
" --no-fastpath: disable fast-path\n"
" --no-motion: don't send mouse motion events\n"
" --gdi: graphics rendering (hw, sw)\n"
{
settings->authentication = false;
}
+ else if (strcmp("--authonly", argv[index]) == 0)
+ {
+ settings->authentication_only = true;
+ }
else if (strcmp("--ignore-certificate", argv[index]) == 0)
{
settings->ignore_certificate = true;