@@ -114,6 +114,7 @@ initialize_server_options(ServerOptions *options)
114114 options -> print_lastlog = -1 ;
115115 options -> x11_forwarding = -1 ;
116116 options -> x11_display_offset = -1 ;
117+ options -> x11_max_displays = -1 ;
117118 options -> x11_use_localhost = -1 ;
118119 options -> permit_tty = -1 ;
119120 options -> permit_user_rc = -1 ;
@@ -342,6 +343,8 @@ fill_default_server_options(ServerOptions *options)
342343 options -> x11_forwarding = 0 ;
343344 if (options -> x11_display_offset == -1 )
344345 options -> x11_display_offset = 10 ;
346+ if (options -> x11_max_displays == -1 )
347+ options -> x11_max_displays = DEFAULT_MAX_DISPLAYS ;
345348 if (options -> x11_use_localhost == -1 )
346349 options -> x11_use_localhost = 1 ;
347350 if (options -> xauth_location == NULL )
@@ -555,7 +558,7 @@ typedef enum {
555558 sKerberosGetAFSToken , sPasswordAuthentication ,
556559 sKbdInteractiveAuthentication , sListenAddress , sAddressFamily ,
557560 sPrintMotd , sPrintLastLog , sIgnoreRhosts ,
558- sX11Forwarding , sX11DisplayOffset , sX11UseLocalhost ,
561+ sX11Forwarding , sX11DisplayOffset , sX11MaxDisplays , sX11UseLocalhost ,
559562 sPermitTTY , sStrictModes , sEmptyPasswd , sTCPKeepAlive ,
560563 sPermitUserEnvironment , sAllowTcpForwarding , sCompression ,
561564 sRekeyLimit , sAllowUsers , sDenyUsers , sAllowGroups , sDenyGroups ,
@@ -678,6 +681,7 @@ static struct {
678681 { "ignoreuserknownhosts" , sIgnoreUserKnownHosts , SSHCFG_GLOBAL },
679682 { "x11forwarding" , sX11Forwarding , SSHCFG_ALL },
680683 { "x11displayoffset" , sX11DisplayOffset , SSHCFG_ALL },
684+ { "x11maxdisplays" , sX11MaxDisplays , SSHCFG_ALL },
681685 { "x11uselocalhost" , sX11UseLocalhost , SSHCFG_ALL },
682686 { "xauthlocation" , sXAuthLocation , SSHCFG_GLOBAL },
683687 { "strictmodes" , sStrictModes , SSHCFG_GLOBAL },
@@ -1696,6 +1700,10 @@ process_server_config_line_depth(ServerOptions *options, char *line,
16961700 * intptr = value ;
16971701 break ;
16981702
1703+ case sX11MaxDisplays :
1704+ intptr = & options -> x11_max_displays ;
1705+ goto parse_int ;
1706+
16991707 case sX11UseLocalhost :
17001708 intptr = & options -> x11_use_localhost ;
17011709 goto parse_flag ;
@@ -2964,6 +2972,7 @@ copy_set_server_options(ServerOptions *dst, ServerOptions *src, int preauth)
29642972 M_CP_INTOPT (fwd_opts .streamlocal_bind_unlink );
29652973 M_CP_INTOPT (x11_display_offset );
29662974 M_CP_INTOPT (x11_forwarding );
2975+ M_CP_INTOPT (x11_max_displays );
29672976 M_CP_INTOPT (x11_use_localhost );
29682977 M_CP_INTOPT (permit_tty );
29692978 M_CP_INTOPT (permit_user_rc );
@@ -3257,6 +3266,7 @@ dump_config(ServerOptions *o)
32573266#endif
32583267 dump_cfg_int (sLoginGraceTime , o -> login_grace_time );
32593268 dump_cfg_int (sX11DisplayOffset , o -> x11_display_offset );
3269+ dump_cfg_int (sX11MaxDisplays , o -> x11_max_displays );
32603270 dump_cfg_int (sMaxAuthTries , o -> max_authtries );
32613271 dump_cfg_int (sMaxSessions , o -> max_sessions );
32623272 dump_cfg_int (sClientAliveInterval , o -> client_alive_interval );
0 commit comments