Skip to content

Commit

Permalink
Enhancement: Deny local check if XRDP_SESSION is set (#230)
Browse files Browse the repository at this point in the history
This adds a check for XRDP_SESSION being set, if yes and deny_local is active: deny

Funfact: XRDP properly setup utmp to tell about the session being remote :D So this is basically just a short-circuit / extra check to be sure.
  • Loading branch information
mcdope authored Jul 5, 2024
1 parent 09aeaec commit 8e09692
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ int pusb_local_login(t_pusb_options *opts, const char *user, const char *service
pid_t tmux_pid = 0;
int local_request = 0;

char *xrdpSession = getenv("XRDP_SESSION");
if (xrdpSession != NULL) {
log_error("XRDP session detected, denying.\n", xrdpSession);
return (0);
}

while (pid != 0)
{
pusb_get_process_name(pid, name);
Expand Down

0 comments on commit 8e09692

Please sign in to comment.