GNOME Bugzilla – Bug 643116
Better support for application/vnc content type configurations
Last modified: 2021-05-26 09:24:51 UTC
Created attachment 181747 [details] .vnc file (filetype application/vnc) I have a system where my windows clients have a single page where they can connect to all our hosts via links that send application/vnc files. Can you support those? The files look like the attached.
Supporting those files should be relatively straightforward, as they appear to be .ini files (parseable with GKeyFile, with certain caveats). Setting milestone to 3.4, but this could be in 3.2 depending on progress with other features.
On closer investigation, Vinagre partially supports .vnc files already (the ‘host’, ‘port’, ‘username’ and ‘password’ fields are supported), but only if the key and group names are lower case. The parser in Vinagre should be changed to read and write the RealVNC-formatted options (which begin with an uppercase letter), and also support the extended options available in RealVNC .vnc files, described on the RealVNC website: http://www.realvnc.com/products/free/4.1/winvncviewer.html#ColorEncoding I tried the file that you provided, after converting the key and group names to lower-case, and it worked when opened in Vinagre and when passed as a command-line argument. You could use this as a workaround until the parsing is fixed.
(In reply to comment #2) > > I tried the file that you provided, after converting the key and group names to > lower-case, and it worked when opened in Vinagre and when passed as a > command-line argument. You could use this as a workaround until the parsing is > fixed. Regarding this workaround, one possible solution is to convert the key and group names to lower-case before the parser gets to read or write them. This way, it is not important in what format they are sent, they will always be acceptable. If there are some restrictions on the names, there can always be a check before the conversion.
(In reply to comment #3) > Regarding this workaround, one possible solution is to convert the key and > group names to lower-case before the parser gets to read or write them. This > way, it is not important in what format they are sent, they will always be > acceptable. Sounds like a good solution. GKeyFile can already read and write the file contents to memory, and can also query all the group and key names from the file, so it should be possible to do the conversion in memory quite simply. I think that a patch to convert the parser to use the RealVNC names by default (actually CamelCase, I made a mistake above and wrote lower-case) should be the first step, as it should be trivial, and makes files exported frm Vinagre compatible with RealVNC (and potentially other viewers). Then, another patch can be written to do the case conversion. A patch to add the extra fields from RealVNC can be added later. > If there are some restrictions on the names, there can always be a check before > the conversion. GKeyFiles are always encoded in UTF-8 (although this may not be the case for the RealVNC equivalent), so as long as the GLib Unicode Manipulation utilities are used, there should be no problems: http://developer.gnome.org/glib/stable/glib-Unicode-Manipulation.html
Created attachment 200134 [details] [review] Proposed patch
Review of attachment 200134 [details] [review]: Looks good in general, you just need to update the translatable strings as well. ::: plugins/vnc/vinagre-vnc-plugin.c @@ -151,2 +151,2 @@ { /* Translators: Do not translate "connection". It's the name of a group in the .vnc (.ini like) file. */ Update this comment and the string below. @@ -158,2 +158,2 @@ { /* Translators: Do not translate "host". It's the name of a key in the .vnc (.ini like) file. */ Update this comment and the string below.
Created attachment 200138 [details] [review] Group name change This patch changes the group names from GKeyFile from lowercase to CamelCase
Created attachment 200143 [details] [review] Additional changes to group names
Comment on attachment 200143 [details] [review] Additional changes to group names Pushed to master as commit bf967770391ae5d70ef4aabf883f1c84e1f699bf, thanks! The next task is doing the conversion from the lowercase names to the CamelCase ones, to keep the parser compatible.
In addition to the previous changes, i would suggest to read DES-encrypted passwords from .vnc files instead of clear passwords, as TightVNC und UltraVNC clients do.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of Vinagre, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new enhancement request ticket at https://gitlab.gnome.org/GNOME/vinagre/-/issues/ Thank you for your understanding and your help.