| 1 | When providing the VNCServer command as 'Xvnc -SecurityTypes None',
|
| 2 | the formatted command line used would look like:
|
| 3 |
|
| 4 | Xvnc -SecurityTypes None :1 -auth /var/run/lightdm/root/:1
|
| 5 |
|
| 6 | which is invalid (the display number must appear first).
|
| 7 |
|
| 8 | Submitted upstream at: https://github.com/canonical/lightdm/pull/265
|
| 9 |
|
| 10 | src/x-server-local.c | 14 +++++++++++++-
|
| 11 | 1 file changed, 13 insertions(+), 1 deletion(-)
|
| 12 |
|
| 13 | diff --git a/src/x-server-local.c b/src/x-server-local.c
|
| 14 | index 7c4ab870..6c540d18 100644
|
| 15 | |
| 16 | |
| 17 | @@ -463,14 +463,20 @@ x_server_local_start (DisplayServer *display_server)
|
| 18 | l_debug (display_server, "Logging to %s", log_file);
|
| 19 |
|
| 20 | g_autofree gchar *absolute_command = get_absolute_command (priv->command);
|
| 21 | + g_auto(GStrv) tokens = g_strsplit (absolute_command, " ", 2);
|
| 22 | + const gchar* binary = tokens[0];
|
| 23 | + const gchar *extra_options = tokens[1];
|
| 24 | +
|
| 25 | if (!absolute_command)
|
| 26 | {
|
| 27 | l_debug (display_server, "Can't launch X server %s, not found in path", priv->command);
|
| 28 | stopped_cb (priv->x_server_process, X_SERVER_LOCAL (server));
|
| 29 | return FALSE;
|
| 30 | }
|
| 31 | - g_autoptr(GString) command = g_string_new (absolute_command);
|
| 32 | + g_autoptr(GString) command = g_string_new (binary);
|
| 33 |
|
| 34 | + /* The display argument must be given first when the X server used
|
| 35 | + * is Xvnc. */
|
| 36 | g_string_append_printf (command, " :%d", priv->display_number);
|
| 37 |
|
| 38 | if (priv->config_file)
|
| 39 | @@ -513,6 +519,12 @@ x_server_local_start (DisplayServer *display_server)
|
| 40 | if (X_SERVER_LOCAL_GET_CLASS (server)->add_args)
|
| 41 | X_SERVER_LOCAL_GET_CLASS (server)->add_args (server, command);
|
| 42 |
|
| 43 | + /* Any extra user options provided via the VNCServer 'command'
|
| 44 | + * config option are appended last, so the user can override any
|
| 45 | + * of the above. */
|
| 46 | + if (extra_options)
|
| 47 | + g_string_append_printf (command, " %s", extra_options);
|
| 48 | +
|
| 49 | process_set_command (priv->x_server_process, command->str);
|
| 50 |
|
| 51 | l_debug (display_server, "Launching X Server");
|
| 52 | --
|
| 53 | 2.36.1
|
| 54 |
|