Skip to content

Commit 70a8af1

Browse files
authored
Merge pull request #1875 from TOMATO-ONE/devel
neutrinordp: Log the IP address, port, and user name of the NeutrioRDP Proxy connection (#1875)
2 parents a4c7ee0 + c6fcb16 commit 70a8af1

File tree

3 files changed

+54
-10
lines changed

3 files changed

+54
-10
lines changed

neutrinordp/xrdp-neutrinordp.c

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,30 @@ lxrdp_connect(struct mod *mod)
182182
}
183183

184184
#endif
185-
LOG(LOG_LEVEL_ERROR, "freerdp_connect Failed to "
186-
"destination :%s:%d",
185+
LOG(LOG_LEVEL_ERROR, "NeutrinoRDP proxy connection: status [Failed],"
186+
" RDP client [%s:%s], RDP server [%s:%d], RDP server username [%s],"
187+
" xrdp pamusername [%s], xrdp process id [%d]",
188+
mod->client_info.client_addr,
189+
mod->client_info.client_port,
187190
mod->inst->settings->hostname,
188-
mod->inst->settings->port);
191+
mod->inst->settings->port,
192+
mod->inst->settings->username,
193+
mod->pamusername,
194+
g_getpid());
189195
return 1;
190196
}
191197
else
192198
{
193-
LOG(LOG_LEVEL_INFO, "freerdp_connect returned Success to "
194-
"destination :%s:%d",
199+
LOG(LOG_LEVEL_INFO, "NeutrinoRDP proxy connection: status [Success],"
200+
" RDP client [%s:%s], RDP server [%s:%d], RDP server username [%s],"
201+
" xrdp pamusername [%s], xrdp process id [%d]",
202+
mod->client_info.client_addr,
203+
mod->client_info.client_port,
195204
mod->inst->settings->hostname,
196-
mod->inst->settings->port);
205+
mod->inst->settings->port,
206+
mod->inst->settings->username,
207+
mod->pamusername,
208+
g_getpid());
197209
}
198210

199211
return 0;
@@ -433,6 +445,16 @@ lxrdp_end(struct mod *mod)
433445
}
434446

435447
LOG_DEVEL(LOG_LEVEL_DEBUG, "lxrdp_end:");
448+
LOG(LOG_LEVEL_INFO, "NeutrinoRDP proxy connection: status [Disconnect],"
449+
" RDP client [%s:%s], RDP server [%s:%d], RDP server username [%s],"
450+
" xrdp pamusername [%s], xrdp process id [%d]",
451+
mod->client_info.client_addr,
452+
mod->client_info.client_port,
453+
mod->inst->settings->hostname,
454+
mod->inst->settings->port,
455+
mod->inst->settings->username,
456+
mod->pamusername,
457+
g_getpid());
436458
return 0;
437459
}
438460

@@ -504,9 +526,12 @@ lxrdp_set_param(struct mod *mod, const char *name, const char *value)
504526
{
505527
settings->desktop_resize = g_text2bool(value);
506528
}
507-
else if (g_strcmp(name, "pamusername") == 0 ||
508-
g_strcmp(name, "pampassword") == 0 ||
509-
g_strcmp(name, "pammsessionmng") == 0)
529+
else if (g_strcmp(name, "pamusername") == 0)
530+
{
531+
g_strncpy(mod->pamusername, value, 255);
532+
}
533+
else if (g_strcmp(name, "pampassword") == 0 ||
534+
g_strcmp(name, "pamsessionmng") == 0)
510535
{
511536
/* Valid (but unused) parameters not logged */
512537
}

neutrinordp/xrdp-neutrinordp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,5 @@ struct mod
216216
struct bitmap_item bitmap_cache[4][4096];
217217
struct brush_item brush_cache[64];
218218
struct pointer_item pointer_cache[32];
219-
219+
char pamusername[255];
220220
};

xrdp/xrdp.ini.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ grey=dedede
111111
ls_top_window_bg_color=009cb5
112112

113113
; width and height of login screen
114+
;
115+
; The default height allows for about 5 fields to be comfortably displayed
116+
; above the buttons at the bottom. To display more fields, make <ls_height>
117+
; larger, and also increase <ls_btn_ok_y_pos> and <ls_btn_cancel_y_pos>
118+
; below
119+
;
114120
ls_width=350
115121
ls_height=430
116122

@@ -216,6 +222,9 @@ port=-1
216222
; display number of the session
217223
#chansrvport=DISPLAY(0)
218224

225+
; Generic VNC Proxy
226+
; Tailor this to specific hosts and VNC instances by specifying an ip
227+
; and port and setting a suitable name.
219228
[vnc-any]
220229
name=vnc-any
221230
lib=libvnc.@lib_extension@
@@ -228,13 +237,23 @@ password=ask
228237
#pamsessionmng=127.0.0.1
229238
#delay_ms=2000
230239

240+
; Generic RDP proxy using NeutrinoRDP
241+
; Tailor this to specific hosts by specifying an ip and port and setting
242+
; a suitable name.
231243
[neutrinordp-any]
232244
name=neutrinordp-any
245+
; To use this section, you should build xrdp with configure option
246+
; --enable-neutrinordp.
233247
lib=libxrdpneutrinordp.@lib_extension@
234248
ip=ask
235249
port=ask3389
236250
username=ask
237251
password=ask
252+
; Uncomment the following lines to enable PAM authentication for proxy
253+
; connections.
254+
#pamusername=ask
255+
#pampassword=ask
256+
#pamsessionmng=127.0.0.1
238257
; Currently NeutrinoRDP doesn't support dynamic resizing. Uncomment
239258
; this line if you're using a client which does.
240259
#enable_dynamic_resizing=false

0 commit comments

Comments
 (0)