Skip to content

Commit

Permalink
Add ability to skip login window
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanDarknes committed Oct 24, 2023
1 parent ee32878 commit 61f9da2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/man/xrdp.ini.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ If \fIsession_name\fP is empty, the \fBLOGIN DOMAIN\fR from the client
with be used to select the section. If no domain name is supplied, the
first suitable section will be used for automatic login.

.TP
\fBskiploginwindow\fP=\fI[true|false]\fP
If set to \fB1\fP, \fBtrue\fP, \fByes\fP or \fBon\fP it will skip the login window and uses the session specified in autorun or the first one in the \fBxrdp.ini\fR. It is required that all login-related fields are set, and no field in the is set to \fIask\fR in the session.
If not specified, defaults to \fBfalse\fP.

.TP
\fBbitmap_cache\fR=\fI[true|false]\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables bitmap caching in \fBxrdp\fR(8).
Expand Down
1 change: 1 addition & 0 deletions xrdp/xrdp.ini.in
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ ssl_protocols=TLSv1.2, TLSv1.3
; If empty and no domain name is given, the first suitable section in
; this file will be used.
autorun=
#skiploginwindow=true

allow_channels=true
allow_multimon=true
Expand Down
6 changes: 6 additions & 0 deletions xrdp/xrdp_login_wnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,11 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
g_strncpy(globals->autorun, v, 255);
}

else if (g_strncmp(n, "skiploginwindow", 64) == 0)
{
globals->skiploginwindow = g_text2bool(v);
}

else if (g_strncmp(n, "hidelogwindow", 64) == 0)
{
globals->hidelogwindow = g_text2bool(v);
Expand Down Expand Up @@ -1472,6 +1477,7 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
LOG(LOG_LEVEL_DEBUG, "background: %d", globals->background);

LOG(LOG_LEVEL_DEBUG, "autorun: %s", globals->autorun);
LOG(LOG_LEVEL_DEBUG, "skiploginwindow: %d", globals->skiploginwindow);
LOG(LOG_LEVEL_DEBUG, "hidelogwindow: %d", globals->hidelogwindow);
LOG(LOG_LEVEL_DEBUG, "require_credentials: %d", globals->require_credentials);
LOG(LOG_LEVEL_DEBUG, "bulk_compression: %d", globals->bulk_compression);
Expand Down
2 changes: 2 additions & 0 deletions xrdp/xrdp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ struct xrdp_wm
struct xrdp_mm *mm;
struct xrdp_font *default_font;
struct xrdp_keymap keymap;
int skip_login_window;
int hide_log_window;
int fatal_error_in_log_window;
struct xrdp_bitmap *target_surface; /* either screen or os surface */
Expand Down Expand Up @@ -756,6 +757,7 @@ struct xrdp_cfg_globals
int tcp_send_buffer_bytes;
int tcp_recv_buffer_bytes;
char autorun[256];
int skiploginwindow;
int hidelogwindow;
int require_credentials;
int bulk_compression;
Expand Down
7 changes: 6 additions & 1 deletion xrdp/xrdp_wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,11 @@ xrdp_wm_load_static_colors_plus(struct xrdp_wm *self, char *autorun_name)
g_strncpy(autorun_name, val, 255);
}
}
else if (g_strcasecmp(val, "skiploginwindow") == 0)
{
val = (char *)list_get_item(values, index);
self->skip_login_window = g_text2bool(val);
}
else if (g_strcasecmp(val, "hidelogwindow") == 0)
{
val = (char *)list_get_item(values, index);
Expand Down Expand Up @@ -636,7 +641,7 @@ xrdp_wm_init(struct xrdp_wm *self)
xrdp_wm_load_static_pointers(self);
self->screen->bg_color = self->xrdp_config->cfg_globals.ls_top_window_bg_color;

if (self->session->client_info->rdp_autologin)
if (self->session->client_info->rdp_autologin || self->skip_login_window)
{
/*
* NOTE: this should eventually be accessed from self->xrdp_config
Expand Down

0 comments on commit 61f9da2

Please sign in to comment.