[Spice-devel] [spice-xpi 1/4] Move secure channel fixup to secure channel setter

David Jaša djasa at redhat.com
Tue Apr 3 09:12:47 PDT 2012


Hi Christophe,

Christophe Fergeau píše v Út 03. 04. 2012 v 16:38 +0200:
> The secure channel names need to be fixed for compatibility with
> older spice versions. However, it's better to do it directly when
> m_secure_channels is set rather than waiting until its first use
> ---
>  SpiceXPI/src/plugin/plugin.cpp |   29 ++++++++++++++---------------
>  1 file changed, 14 insertions(+), 15 deletions(-)
> 
> diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
> index e3e6e80..04d272b 100644
> --- a/SpiceXPI/src/plugin/plugin.cpp
> +++ b/SpiceXPI/src/plugin/plugin.cpp
> @@ -329,6 +329,20 @@ char *nsPluginInstance::GetSSLChannels() const
>  void nsPluginInstance::SetSSLChannels(const char *aSSLChannels)
>  {
>      m_ssl_channels = aSSLChannels;
> +
> +    /*
> +     * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
> +     * RHEL5 uses 'smain' and 'sinpusts
> +     * RHEL6 uses 'main'  and 'inputs'
> +     */

The s- idio^W^W^W^Wlegacy goes much further, see the ovirt-engine
sources what you can expect:
http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob;f=backend/manager/tools/engine-config/src/main/resources/engine-config.properties#l109

David

> +    std::size_t found = 0;
> +    while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
> +        m_ssl_channels.replace(found, 5, "main");
> +
> +    found = 0;
> +    while ((found = m_ssl_channels.find("sinputs", found)) != std::string::npos)
> +        m_ssl_channels.replace(found, 7, "inputs");
> +    /* HACK */
>  }
>  
>  //* attribute string TrustStore; */
> @@ -695,21 +709,6 @@ void nsPluginInstance::Connect()
>          SendBool(CONTROLLER_ENABLE_USB, m_usb_redir);
>          SendBool(CONTROLLER_ENABLE_USB_AUTOSHARE, m_usb_auto_share);
>          SendStr(CONTROLLER_USB_FILTER, m_usb_filter.c_str());
> -
> -        /*
> -         * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
> -         * RHEL5 uses 'smain' and 'sinpusts
> -         * RHEL6 uses 'main'  and 'inputs'
> -         */
> -        std::size_t found = 0;
> -        while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
> -            m_ssl_channels.replace(found, 5, "main");
> -
> -        found = 0;
> -        while ((found = m_ssl_channels.find("sinputs", found)) != std::string::npos)
> -            m_ssl_channels.replace(found, 7, "inputs");
> -        /* HACK */
> -
>          SendStr(CONTROLLER_SECURE_CHANNELS, m_ssl_channels.c_str());
>          SendStr(CONTROLLER_CA_FILE, m_trust_store_file.c_str());
>          SendStr(CONTROLLER_HOST_SUBJECT, m_host_subject.c_str());

-- 

David Jaša, RHCE

SPICE QE based in Brno
GPG Key:     22C33E24 
Fingerprint: 513A 060B D1B4 2A72 7F0D 0278 B125 CD00 22C3 3E24





More information about the Spice-devel mailing list