Any chance this patch will be applied ? I'm asking, because we currently have a real problem with using xrdp in a productive environment which has more than 100 concurrent users on a single server if this patch will not be applied (it will conflict with our other system-access possibility via FreeNX).
I'm happy to send an updated patch if you see problems with the code below or if you think anything should be changed in my patch. Best regards, Helge On 02/18/2010 10:23 PM, Helge Deller wrote: > sesman currently tries to find the first free TCP port starting at 6010 > (6000+10). > Under some circumstances this can conflict with real X servers. > > To avoid this problem, this patch removes the hard coded offset of "10" > in favour of a configuration option named "X11DisplayOffset" which > defaults to "10". > That way the current behaviour is kept, while it makes it configurable > for users who need to choose another default offset value. > > BTW, I modeled my patch like sshd(8) which has the same configuration option. > > It would be nice if you would apply this patch to the CVS tree. > > Thanks, > Helge > > > diff -up ./docs/man/sesman.ini.5.orig ./docs/man/sesman.ini.5 > --- ./docs/man/sesman.ini.5.orig 2010-02-18 22:07:35.000000000 +0100 > +++ ./docs/man/sesman.ini.5 2010-02-18 22:08:50.000000000 +0100 > @@ -104,6 +104,11 @@ The following parameters can be used in > .br > > .TP > +\fBX11DisplayOffset\fR=\fI<number>\fR > +Specifies the first X display number available for sesman(8). This prevents > sesman from interfering with real X11 servers. The default is 10. > +.br > + > +.TP > \fBMaxSessions\fR=\fI<number>\fR > Sets the maximum number of simultaneous session on terminal server. > .br > diff -up ./sesman/config.c.orig ./sesman/config.c > --- ./sesman/config.c.orig 2010-02-18 22:07:35.000000000 +0100 > +++ ./sesman/config.c 2010-02-18 22:08:49.000000000 +0100 > @@ -330,6 +330,7 @@ config_read_sessions(int file, struct co > list_clear(param_n); > > /* setting defaults */ > + se->x11_display_offset=10; > se->max_sessions=0; > se->max_idle_time=0; > se->max_disc_time=0; > @@ -339,6 +340,10 @@ config_read_sessions(int file, struct co > for (i = 0; i< param_n->count; i++) > { > buf = (char*)list_get_item(param_n, i); > + if (0 == g_strcasecmp(buf, SESMAN_CFG_X11DISPLAYOFFSET)) > + { > + se->x11_display_offset = g_atoi((char*)list_get_item(param_v, i)); > + } > if (0 == g_strcasecmp(buf, SESMAN_CFG_SESS_MAX)) > { > se->max_sessions = g_atoi((char*)list_get_item(param_v, i)); > @@ -359,6 +364,7 @@ config_read_sessions(int file, struct co > > /* printing security config */ > g_printf("session configuration:\r\n"); > + g_printf("\tX11DisplayOffset: %i\r\n", se->x11_display_offset); > g_printf("\tMaxSessions: %i\r\n", se->max_sessions); > g_printf("\tKillDisconnected: %i\r\n", se->kill_disconnected); > g_printf("\tIdleTimeLimit: %i\r\n", se->max_idle_time); > diff -up ./sesman/config.h.orig ./sesman/config.h > --- ./sesman/config.h.orig 2010-02-18 22:07:35.000000000 +0100 > +++ ./sesman/config.h 2010-02-18 22:08:49.000000000 +0100 > @@ -38,6 +38,7 @@ > #define SESMAN_CFG_PORT "ListenPort" > #define SESMAN_CFG_ENABLE_USERWM "EnableUserWindowManager" > #define SESMAN_CFG_USERWM "UserWindowManager" > +#define SESMAN_CFG_X11DISPLAYOFFSET "X11DisplayOffset" > #define SESMAN_CFG_MAX_SESSION "MaxSessions" > #define SESMAN_CFG_AUTH_FILE_PATH "AuthFilePath" > > @@ -103,6 +104,11 @@ struct config_security > struct config_sessions > { > /** > + * @var x11_display_offset > + * @brief X11 TCP port offset. default value: 10 > + */ > + int x11_display_offset; > + /** > * @var max_sessions > * @brief maximum number of allowed sessions. 0 for unlimited > */ > diff -up ./sesman/sesman.ini.orig ./sesman/sesman.ini > --- ./sesman/sesman.ini.orig 2010-02-18 22:07:35.000000000 +0100 > +++ ./sesman/sesman.ini 2010-02-18 22:08:49.000000000 +0100 > @@ -12,6 +12,7 @@ TerminalServerUsers=tsusers > TerminalServerAdmins=tsadmins > > [Sessions] > +X11DisplayOffset=10 > MaxSessions=10 > KillDisconnected=0 > IdleTimeLimit=0 > diff -up ./sesman/session.c.orig ./sesman/session.c > --- ./sesman/session.c.orig 2010-02-18 22:07:35.000000000 +0100 > +++ ./sesman/session.c 2010-02-18 22:08:50.000000000 +0100 > @@ -238,9 +238,9 @@ session_get_aval_display_from_chain(void > { > int display; > > - display = 10; > + display = g_cfg->sess.x11_display_offset; > lock_chain_acquire(); > - while ((display - 10)<= g_cfg->sess.max_sessions) > + while ((display - g_cfg->sess.x11_display_offset)<= > g_cfg->sess.max_sessions) > { > if (!session_is_display_in_chain(display)) > { > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ xrdp-devel mailing list xrdp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xrdp-devel