Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an enable_auto_login flag to xrdp.ini #3305

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions xrdp/xrdp_login_wnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <config_ac.h>
#endif

#include <stdio.h>

#include "base64.h"
#include "xrdp.h"
#include "log.h"
Expand Down Expand Up @@ -1063,11 +1065,14 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
int fd;
int i;

LOG(LOG_LEVEL_INFO, "got to config function");

if (!config)
{
return -1;
}

LOG(LOG_LEVEL_INFO, "and continuing");
globals = &config->cfg_globals;

/* set default values in case we can't get them from xrdp.ini file */
Expand Down Expand Up @@ -1135,6 +1140,8 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
n = (char *) list_get_item(names, i);
v = (char *) list_get_item(values, i);

LOG(LOG_LEVEL_INFO, "config: %s -> %s", n, v);

/*
* parse globals section
*/
Expand Down Expand Up @@ -1264,6 +1271,12 @@ load_xrdp_config(struct xrdp_config *config, const char *xrdp_ini, int bpp)
g_strncpy(globals->autorun, v, 255);
}

else if (g_strncmp(n, "enable_auto_login", 64) == 0)
{
LOG(LOG_LEVEL_INFO, "enable auto login: %s", v);
globals->enable_auto_login = g_text2bool(v);
}

else if (g_strncmp(n, "hidelogwindow", 64) == 0)
{
globals->hidelogwindow = g_text2bool(v);
Expand Down
1 change: 1 addition & 0 deletions xrdp/xrdp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ struct xrdp_cfg_globals
int tcp_send_buffer_bytes;
int tcp_recv_buffer_bytes;
char autorun[256];
int enable_auto_login;
int hidelogwindow;
int require_credentials;
int bulk_compression;
Expand Down
2 changes: 1 addition & 1 deletion xrdp/xrdp_wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,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->xrdp_config->cfg_globals.enable_auto_login || self->session->client_info->rdp_autologin)
{
/*
* NOTE: this should eventually be accessed from self->xrdp_config
Expand Down