aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog128
-rw-r--r--debian/compat1
-rw-r--r--debian/control27
-rw-r--r--debian/copyright28
-rw-r--r--debian/patches/01_clear_servers.patch36
-rw-r--r--debian/patches/02_server-name.patch19
-rw-r--r--debian/patches/03_x2go+rls.patch429
-rw-r--r--debian/patches/glib-deprecated.diff43
-rw-r--r--debian/patches/series4
-rwxr-xr-xdebian/rules5
-rw-r--r--debian/source/format1
-rw-r--r--debian/watch2
12 files changed, 723 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..376ba57
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,128 @@
+remote-login-service (1.0.0-0ubuntu3+x2go1~0ubuntu14.04.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Add SERVER_NAME env var support.
+ * Add X2Go support to RLS.
+ * Provide via ppa:x2go/ppa and ppa:x2go/stable on Launchpad.
+
+ -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Sun, 02 Nov 2014 19:05:58 +0100
+
+remote-login-service (1.0.0-0ubuntu3) raring; urgency=low
+
+ * Don't use deprecated g_type_init() with recent glib2.0.
+
+ -- Matthias Klose <doko@ubuntu.com> Tue, 26 Feb 2013 10:40:57 +0100
+
+remote-login-service (1.0.0-0ubuntu2) raring; urgency=low
+
+ * SECURITY UPDATE: credentials disclosure via second login (LP: #1070896)
+ - debian/patches/01_clear_servers.patch: Clear servers on second login
+ in src/uccs-server.c, add test to tests/dbus-interface.c.
+ - CVE-2012-0959
+
+ -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Mon, 05 Nov 2012 14:05:14 -0500
+
+remote-login-service (1.0.0-0ubuntu1) quantal; urgency=low
+
+ * New upstream release.
+ * Support caching the recently used server
+ * debian/control: Add build dep on libgcrypt11-dev
+
+ -- Ted Gould <ted@ubuntu.com> Thu, 20 Sep 2012 23:55:05 -0500
+
+remote-login-service (0.7.0-0ubuntu1) quantal; urgency=low
+
+ * New upstream release.
+ - Fix NM service detection and fallback
+ - Fix build on unoptimized build servers
+ - Fix issues with multiple logins (LP: #1050810)
+ - Support stored data in UCCS (LP: #1045836)
+ - Check to insure TCCA is installed before using (LP: #1047939)
+ - Ensure that the server is available before showing (LP: #1047940)
+ - Make the UCCS server names translatable (LP: #1049694)
+ - Fix error message that wasn't that bad (LP: #1041338)
+ - Place the server marked as default first (LP: #1045838)
+ * debian/control:
+ - Adding a build dep on libnm-glib
+ - Adding a build dep on libsoup2.4-dev
+ * Dropping debian/patches as all upstream
+
+ -- Ted Gould <ted@ubuntu.com> Thu, 13 Sep 2012 11:16:17 -0500
+
+remote-login-service (0.5.0-0ubuntu2) quantal; urgency=low
+
+ * debian/patches/exit-gracefully-on-name-lost.patch:
+ - Fix possible crash on exit. Patch from trunk. LP: #1041338
+
+ -- Michael Terry <mterry@ubuntu.com> Tue, 11 Sep 2012 14:03:07 -0400
+
+remote-login-service (0.5.0-0ubuntu1) quantal; urgency=low
+
+ * New upstream release.
+ * Fix protocol names
+ * Align naming with LightDM services
+ * Handle recursive searches for domain name caches
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 29 Aug 2012 11:38:02 -0500
+
+remote-login-service (0.4.0-0ubuntu1) quantal; urgency=low
+
+ * New upstream release.
+ * slmock to Python3
+ * Return a boolean from GetServersForLogin
+ * Fix thin-client-config-agent path
+ * debian/control:
+ - Build-Dep on python3, not python
+ - Recommend thin-client-config-agent
+
+ -- Michael Terry <mterry@ubuntu.com> Tue, 21 Aug 2012 17:43:12 -0400
+
+remote-login-service (0.3.0-0ubuntu1) quantal; urgency=low
+
+ [ Ted Gould ]
+ * New upstream release.
+ * Async command line calling
+ * Test suite fix
+ * Remove security issues with helper-script (dropped)
+ * Crash fix (LP: #1037832)
+ * debian/rules: Remove block on tests
+
+ [ Michael Terry ]
+ * debian/control:
+ - Add Vcs-Bzr link
+ - Add some new build dependencies for tests (dbus-test-runner, python)
+ * Drop patch for pkglibexecdir, not needed anymore
+ * Drop dh-autoreconf, since we don't patch autotools files now
+
+ -- Michael Terry <mterry@ubuntu.com> Mon, 20 Aug 2012 12:42:09 -0400
+
+remote-login-service (0.2.0-0ubuntu1) quantal; urgency=low
+
+ * Package for Ubuntu (LP: #1037231)
+ * Switch to dh9 and drop cdbs
+ * Add watch file
+ * Cleanup control and copyright files
+ * Add patch to use pkglibexecdir instead of libexecdir
+
+ -- Michael Terry <mterry@ubuntu.com> Wed, 15 Aug 2012 15:00:35 -0400
+
+remote-login-service (0.2.0-0ubuntu1~ppa2) quantal; urgency=low
+
+ * debian/control: Adding dh-autoreconf as a build depend
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 15 Aug 2012 13:06:38 -0500
+
+remote-login-service (0.2.0-0ubuntu1~ppa1) quantal; urgency=low
+
+ * New upstream release.
+ * Support calling the UCCS service tool
+ * Tests to deal with JSON output
+ * debian/control: Adding build dependencies on dbustest and json-glib
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 15 Aug 2012 11:38:31 -0500
+
+remote-login-service (0.0.1-0ubuntu1~ppa1) quantal; urgency=low
+
+ * New upstream release.
+
+ -- Ted Gould <ted@ubuntu.com> Mon, 30 Jul 2012 16:57:37 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..4c451bd
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,27 @@
+Source: remote-login-service
+Section: misc
+Priority: extra
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+Build-Depends: dbus-test-runner,
+ debhelper (>= 9),
+ intltool (>= 0.35.0),
+ libdbus-1-dev,
+ libdbustest1-dev,
+ libgcrypt11-dev,
+ libglib2.0-dev (>= 2.29.19),
+ libjson-glib-dev,
+ libnm-glib-dev,
+ libsoup2.4-dev,
+ python3,
+Standards-Version: 3.9.3
+Homepage: http://launchpad.net/remote-login-service/
+Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/remote-login-service/trunk
+
+Package: remote-login-service
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends},
+Recommends: thin-client-config-agent
+Description: Service to track the remote servers to use
+ A small service to take the various sources for the remote
+ services and bring them into a simple DBus list.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..8fb575a
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,28 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: remote-login-service
+Source: http://launchpad.net/remote-login-service
+
+Files: *
+Copyright: 2012, Canonical Ltd.
+License: GPL-3
+
+Files: debian/*
+Copyright: 2012, Canonical Ltd.
+License: GPL-3
+
+License: GPL-3
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 3 of the License.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
diff --git a/debian/patches/01_clear_servers.patch b/debian/patches/01_clear_servers.patch
new file mode 100644
index 0000000..187113d
--- /dev/null
+++ b/debian/patches/01_clear_servers.patch
@@ -0,0 +1,36 @@
+Description: fix credentials disclosure via second login
+Origin: upstream, http://bazaar.launchpad.net/~remote-login-service-team/remote-login-service/trunk/revision/77
+Bug: https://bugs.launchpad.net/ubuntu/quantal/+source/remote-login-service/+bug/1070896
+
+=== modified file 'src/uccs-server.c'
+--- old/src/uccs-server.c 2012-09-17 07:49:30 +0000
++++ new/src/uccs-server.c 2012-10-24 14:35:36 +0000
+@@ -466,6 +466,10 @@
+ static gboolean
+ parse_rds_array (UccsServer * server, JsonArray * array)
+ {
++ // Got a new set of servers, delete the old one
++ g_list_free_full(server->subservers, g_object_unref);
++ server->subservers = NULL;
++
+ int i;
+ for (i = 0; i < json_array_get_length(array); i++) {
+ JsonNode * node = json_array_get_element(array, i);
+
+=== modified file 'tests/dbus-interface.c'
+--- old/tests/dbus-interface.c 2012-09-17 07:49:30 +0000
++++ new/tests/dbus-interface.c 2012-10-24 14:35:36 +0000
+@@ -184,9 +184,12 @@
+
+ GVariant * array = g_variant_get_child_value(retval, 2);
+ int i;
++ // Check all servers should be in the result are in the result
+ for (i = 0; slmockdata->servers[i].name != NULL; i++) {
+ g_assert(find_server(array, &slmockdata->servers[i]));
+ }
++ // Check there is no more servers in the result than we expected
++ g_assert(i == g_variant_n_children(array));
+ g_variant_unref(array);
+
+ g_variant_unref(retval);
+
diff --git a/debian/patches/02_server-name.patch b/debian/patches/02_server-name.patch
new file mode 100644
index 0000000..50c9a91
--- /dev/null
+++ b/debian/patches/02_server-name.patch
@@ -0,0 +1,19 @@
+--- a/src/uccs-server.c
++++ b/src/uccs-server.c
+@@ -20,6 +20,7 @@
+ #include "config.h"
+ #endif
+
++#include <glib.h>
+ #include <glib/gi18n.h>
+
+ #include <json-glib/json-glib.h>
+@@ -734,6 +735,8 @@
+ argv[1] = server->username;
+ argv[2] = NULL;
+
++ g_setenv("SERVER_ROOT", server->parent.uri, TRUE);
++
+ g_spawn_async_with_pipes(NULL, /* pwd */
+ (gchar **)argv,
+ NULL, /* env */
diff --git a/debian/patches/03_x2go+rls.patch b/debian/patches/03_x2go+rls.patch
new file mode 100644
index 0000000..d4563f7
--- /dev/null
+++ b/debian/patches/03_x2go+rls.patch
@@ -0,0 +1,429 @@
+--- a/src/com.canonical.RemoteLogin.xml
++++ b/src/com.canonical.RemoteLogin.xml
+@@ -2,19 +2,21 @@
+ <node name="/">
+ <interface name="com.canonical.RemoteLogin">
+ <!-- SERVER LIST DOCS - it's in a few places :-)
+- s: server type: "ica", "freerdp", "uccs"
++ s: server type: "ica", "freerdp", "x2go", "uccs"
+ s: server name
+ s: server uri
+ b: last used server
+ a(sbva{sv}): properties for the server
+- s: type: "username", "password", "domain", "email"
++ s: type: "username", "password", "domain", "email", "sessiontype"
+ b: required
+ v: default value
+- a{sv}: properties for the value, currently only used for domains
+- that have a list of possible domains
++ a{sv}: properties for the value
++ for value 'domain': a list of possible domains (ica, freerdp)
+ "domains": a(s)
+- and domains that are read only
++ for value 'domain': a list of domains that are read only
+ "read-only": b
++ for value 'sessiontype': TODO -> a subset of session profile parameters...
++ "nothing-yet": s
+ a(si): applications pinned for the server
+ s: ID of the application (desktop file)
+ i: position the application is pinned in
+--- a/src/server.c
++++ b/src/server.c
+@@ -25,6 +25,7 @@
+ #include "citrix-server.h"
+ #include "rdp-server.h"
+ #include "uccs-server.h"
++#include "x2go-server.h"
+
+ static void server_class_init (ServerClass *klass);
+ static void server_init (Server *self);
+@@ -162,6 +163,9 @@
+ else if (g_strcmp0(proto, "freerdp") == 0 || g_strcmp0(proto, "rdp") == 0 || g_strcmp0(proto, "RDP") == 0 || g_strcmp0(proto, "FreeRDP") == 0) {
+ newserver = rdp_server_new_from_json(object);
+ }
++ else if (g_strcmp0(proto, "x2go") == 0 || g_strcmp0(proto, "X2go") == 0 || g_strcmp0(proto, "X2Go") == 0 || g_strcmp0(proto, "X2GO") == 0 || g_strcmp0(proto, "x2GO") == 0 || g_strcmp0(proto, "x2gO") == 0) {
++ newserver = x2go_server_new_from_json(object);
++ }
+
+ return newserver;
+ }
+@@ -184,6 +188,8 @@
+ g_variant_builder_add_value(&tuple, g_variant_new_string("freerdp"));
+ } else if (IS_UCCS_SERVER(server)) {
+ g_variant_builder_add_value(&tuple, g_variant_new_string("uccs"));
++ } else if (IS_X2GO_SERVER(server)) {
++ g_variant_builder_add_value(&tuple, g_variant_new_string("x2go"));
+ } else {
+ g_assert_not_reached();
+ }
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -3,5 +3,6 @@
+ src/remote-login.c
+ src/rdp-server.c
+ src/citrix-server.c
++src/x2go-server.c
+ src/main.c
+ src/uccs-server.c
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -36,6 +36,8 @@
+ citrix-server.h \
+ rdp-server.c \
+ rdp-server.h \
++ x2go-server.c \
++ x2go-server.h \
+ uccs-server.c \
+ uccs-server.h \
+ defines.h \
+--- a/src/defines.h
++++ b/src/defines.h
+@@ -34,6 +34,7 @@
+ #define CONFIG_SERVER_TYPE "Type"
+ #define CONFIG_SERVER_TYPE_RDP "RDP"
+ #define CONFIG_SERVER_TYPE_ICA "ICA"
++#define CONFIG_SERVER_TYPE_X2GO "X2GO"
+ #define CONFIG_SERVER_TYPE_UCCS "UCCS"
+
+ #define JSON_PROTOCOL "Protocol"
+@@ -43,5 +44,7 @@
+ #define JSON_PASSWORD "Password"
+ #define JSON_DOMAIN_REQ "DomainRequired"
+ #define JSON_DOMAIN "WindowsDomain"
++#define JSON_SESSIONTYPE "SessionType"
++#define JSON_SESSIONTYPE_REQ "SessionTypeRequired"
+
+ #endif /* __DEFINES_H__ */
+--- a/src/main.c
++++ b/src/main.c
+@@ -33,6 +33,7 @@
+ #include "rdp-server.h"
+ #include "citrix-server.h"
+ #include "uccs-server.h"
++#include "x2go-server.h"
+ #include "crypt.h"
+
+ gint server_list_to_array (GVariantBuilder * builder, GList * items);
+--- /dev/null
++++ b/src/x2go-server.c
+@@ -0,0 +1,227 @@
++/*
++ * Copyright © 2012 Canonical Ltd.
++ * Copyright © 2013 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
++ *
++ * This program is free software: you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 3, as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranties of
++ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
++ * PURPOSE. See the GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program. If not, see <http://www.gnu.org/licenses/>.
++ *
++ * Author: Ted Gould <ted@canonical.com>
++ * Modified for X2Go: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
++ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <sys/mman.h>
++
++#include <glib/gi18n.h>
++
++#include <string.h>
++
++#include "x2go-server.h"
++#include "defines.h"
++
++static void x2go_server_class_init (X2GoServerClass *klass);
++static void x2go_server_init (X2GoServer *self);
++static void x2go_server_dispose (GObject *object);
++static void x2go_server_finalize (GObject *object);
++static GVariant * get_properties (Server * server);
++
++G_DEFINE_TYPE (X2GoServer, x2go_server, SERVER_TYPE);
++
++static void
++x2go_server_class_init (X2GoServerClass *klass)
++{
++ GObjectClass *object_class = G_OBJECT_CLASS (klass);
++
++ object_class->dispose = x2go_server_dispose;
++ object_class->finalize = x2go_server_finalize;
++
++ ServerClass * server_class = SERVER_CLASS(klass);
++
++ server_class->get_properties = get_properties;
++
++ return;
++}
++
++static void
++x2go_server_init (X2GoServer *self)
++{
++ self->username = NULL;
++ self->password = NULL;
++ self->sessiontype = NULL;
++ self->sessiontype_required = FALSE;
++
++ return;
++}
++
++static void
++x2go_server_dispose (GObject *object)
++{
++
++ G_OBJECT_CLASS (x2go_server_parent_class)->dispose (object);
++ return;
++}
++
++/* Unlocks the memory before freeing */
++static void
++password_clear (gpointer data)
++{
++ char * pass = (char *)data;
++ munlock(pass, strlen(pass));
++ g_free(pass);
++ return;
++}
++
++static void
++x2go_server_finalize (GObject *object)
++{
++ X2GoServer * server = X2GO_SERVER(object);
++
++ g_clear_pointer(&server->username, g_free);
++ g_clear_pointer(&server->password, password_clear);
++ g_clear_pointer(&server->sessiontype, g_free);
++
++ G_OBJECT_CLASS (x2go_server_parent_class)->finalize (object);
++ return;
++}
++
++static GVariant *
++get_properties (Server * server)
++{
++ X2GoServer * rserver = X2GO_SERVER(server);
++
++ GVariantBuilder propbuilder;
++ g_variant_builder_init(&propbuilder, G_VARIANT_TYPE_ARRAY);
++
++ GVariantBuilder namebuilder;
++ g_variant_builder_init(&namebuilder, G_VARIANT_TYPE_TUPLE);
++ g_variant_builder_add_value(&namebuilder, g_variant_new_string("username"));
++ g_variant_builder_add_value(&namebuilder, g_variant_new_boolean(TRUE));
++ if (rserver->username == NULL) {
++ g_variant_builder_add_value(&namebuilder, g_variant_new_variant(g_variant_new_string("")));
++ } else {
++ g_variant_builder_add_value(&namebuilder, g_variant_new_variant(g_variant_new_string(rserver->username)));
++ }
++ g_variant_builder_add_value(&namebuilder, g_variant_parse(G_VARIANT_TYPE_VARDICT, "{}", NULL, NULL, NULL));
++ g_variant_builder_add_value(&propbuilder, g_variant_builder_end(&namebuilder));
++
++ GVariantBuilder passbuilder;
++ g_variant_builder_init(&passbuilder, G_VARIANT_TYPE_TUPLE);
++ g_variant_builder_add_value(&passbuilder, g_variant_new_string("password"));
++ g_variant_builder_add_value(&passbuilder, g_variant_new_boolean(TRUE));
++ if (rserver->password == NULL) {
++ g_variant_builder_add_value(&passbuilder, g_variant_new_variant(g_variant_new_string("")));
++ } else {
++ g_variant_builder_add_value(&passbuilder, g_variant_new_variant(g_variant_new_string(rserver->password)));
++ }
++ g_variant_builder_add_value(&passbuilder, g_variant_parse(G_VARIANT_TYPE_VARDICT, "{}", NULL, NULL, NULL));
++ g_variant_builder_add_value(&propbuilder, g_variant_builder_end(&passbuilder));
++
++ GVariantBuilder sessiontypebuilder;
++ g_variant_builder_init(&sessiontypebuilder, G_VARIANT_TYPE_TUPLE);
++ g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_string("x2gosession"));
++ g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_boolean(rserver->sessiontype_required));
++ if (rserver->sessiontype == NULL) {
++ g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_variant(g_variant_new_string("")));
++ } else {
++ g_variant_builder_add_value(&sessiontypebuilder, g_variant_new_variant(g_variant_new_string(rserver->sessiontype)));
++ }
++ g_variant_builder_add_value(&sessiontypebuilder, g_variant_parse(G_VARIANT_TYPE_VARDICT, "{}", NULL, NULL, NULL));
++ g_variant_builder_add_value(&propbuilder, g_variant_builder_end(&sessiontypebuilder));
++
++ return g_variant_builder_end(&propbuilder);
++}
++
++Server *
++x2go_server_new_from_keyfile (GKeyFile * keyfile, const gchar * groupname)
++{
++ g_return_val_if_fail(keyfile != NULL, NULL); /* NOTE: No way to check if that's really a keyfile :-( */
++ g_return_val_if_fail(groupname != NULL, NULL);
++
++ if (!g_key_file_has_group(keyfile, groupname)) {
++ g_warning("Server specified but group '%s' was not found", groupname);
++ return NULL;
++ }
++
++ X2GoServer * server = g_object_new(X2GO_SERVER_TYPE, NULL);
++
++ if (g_key_file_has_key(keyfile, groupname, CONFIG_SERVER_NAME, NULL)) {
++ gchar * keyname = g_key_file_get_string(keyfile, groupname, CONFIG_SERVER_NAME, NULL);
++ server->parent.name = g_strdup(_(keyname));
++ g_free(keyname);
++ }
++
++ if (g_key_file_has_key(keyfile, groupname, CONFIG_SERVER_URI, NULL)) {
++ server->parent.uri = g_key_file_get_string(keyfile, groupname, CONFIG_SERVER_URI, NULL);
++ }
++
++ return SERVER(server);
++}
++
++/* Build the X2Go server from information in the JSON object */
++Server *
++x2go_server_new_from_json (JsonObject * object)
++{
++ X2GoServer * server = g_object_new(X2GO_SERVER_TYPE, NULL);
++
++ if (json_object_has_member(object, JSON_SERVER_NAME)) {
++ JsonNode * node = json_object_get_member(object, JSON_SERVER_NAME);
++ if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_STRING) {
++ const gchar * name = json_node_get_string(node);
++ server->parent.name = g_strdup(name);
++ }
++ }
++
++ if (json_object_has_member(object, JSON_URI)) {
++ JsonNode * node = json_object_get_member(object, JSON_URI);
++ if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_STRING) {
++ const gchar * uri = json_node_get_string(node);
++ server->parent.uri = g_strdup(uri);
++ }
++ }
++
++ if (json_object_has_member(object, JSON_USERNAME)) {
++ JsonNode * node = json_object_get_member(object, JSON_USERNAME);
++ if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_STRING) {
++ const gchar * username = json_node_get_string(node);
++ server->username = g_strdup(username);
++ }
++ }
++
++ if (json_object_has_member(object, JSON_PASSWORD)) {
++ JsonNode * node = json_object_get_member(object, JSON_PASSWORD);
++ if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_STRING) {
++ const gchar * password = json_node_get_string(node);
++ server->password = g_strdup(password);
++ mlock(server->password, strlen(server->password));
++ }
++ }
++
++ if (json_object_has_member(object, JSON_SESSIONTYPE)) {
++ JsonNode * node = json_object_get_member(object, JSON_SESSIONTYPE);
++ if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_STRING) {
++ const gchar * sessiontype = json_node_get_string(node);
++ server->sessiontype = g_strdup(sessiontype);
++ }
++ }
++
++ if (json_object_has_member(object, JSON_SESSIONTYPE_REQ)) {
++ JsonNode * node = json_object_get_member(object, JSON_SESSIONTYPE_REQ);
++ if (JSON_NODE_TYPE(node) == JSON_NODE_VALUE && json_node_get_value_type(node) == G_TYPE_BOOLEAN) {
++ server->sessiontype_required = json_node_get_boolean(node);
++ }
++ }
++
++ return SERVER(server);
++}
+--- /dev/null
++++ b/src/x2go-server.h
+@@ -0,0 +1,59 @@
++/*
++ * Copyright © 2012 Canonical Ltd.
++ * Copyright © 2013 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
++ *
++ * This program is free software: you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 3, as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranties of
++ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
++ * PURPOSE. See the GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License along
++ * with this program. If not, see <http://www.gnu.org/licenses/>.
++ *
++ * Author: Ted Gould <ted@canonical.com>
++ * Modified for X2Go: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
++ */
++
++#ifndef __X2GO_SERVER_H__
++#define __X2GO_SERVER_H__
++
++#include <glib-object.h>
++#include <json-glib/json-glib.h>
++#include "server.h"
++
++G_BEGIN_DECLS
++
++#define X2GO_SERVER_TYPE (x2go_server_get_type ())
++#define X2GO_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), X2GO_SERVER_TYPE, X2GoServer))
++#define X2GO_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), X2GO_SERVER_TYPE, X2GoServerClass))
++#define IS_X2GO_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), X2GO_SERVER_TYPE))
++#define IS_X2GO_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), X2GO_SERVER_TYPE))
++#define X2GO_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), X2GO_SERVER_TYPE, X2GoServerClass))
++
++typedef struct _X2GoServer X2GoServer;
++typedef struct _X2GoServerClass X2GoServerClass;
++
++struct _X2GoServerClass {
++ ServerClass parent_class;
++};
++
++struct _X2GoServer {
++ Server parent;
++
++ gchar * username;
++ gchar * password;
++ gchar * sessiontype;
++ gboolean sessiontype_required;
++};
++
++GType x2go_server_get_type (void);
++Server * x2go_server_new_from_keyfile (GKeyFile * keyfile, const gchar * name);
++Server * x2go_server_new_from_json (JsonObject * object);
++
++G_END_DECLS
++
++#endif
+--- a/tests/slmock
++++ b/tests/slmock
+@@ -78,6 +78,20 @@
+ ms.set_default(ts1.Name)
+ print(ms.toJson())
+
++def x2go(email):
++ ms = ManagementServer("http://x2go.intern", "X2GoSessionBroker")
++ ts1 = TerminalServer("10.0.2.11", "X2Go Server 1", "x2go", False,
++ "foo")
++ ts2 = TerminalServer("10.0.2.12", "X2Go Server 2", "x2go", False,
++ "bar")
++ ts3 = TerminalServer("10.0.2.13", "X2Go Server 3", "x2go", False,
++ "foobar")
++ ms.add_terminal_server(ts1)
++ ms.add_terminal_server(ts2)
++ ms.add_terminal_server(ts3)
++ ms.set_default(ts1.Name)
++ print(ms.toJson())
++
+ def print_error(text):
+ print("{ \"Error\": \"%s\" }" % text)
+
+@@ -201,6 +215,7 @@
+ "d" : defaults, #for easy testing of default ts
+ "e" : error,
+ "f" : freerdp,
++ "x" : x2go,
+ "g" : garbage,
+ "m" : missing_fields, #json missing some fields
+ "r" : random_string,
diff --git a/debian/patches/glib-deprecated.diff b/debian/patches/glib-deprecated.diff
new file mode 100644
index 0000000..c6e51e5
--- /dev/null
+++ b/debian/patches/glib-deprecated.diff
@@ -0,0 +1,43 @@
+Index: b/src/main.c
+===================================================================
+--- a/src/main.c
++++ b/src/main.c
+@@ -387,8 +387,10 @@
+ {
+ GError * error = NULL;
+
++#if !GLIB_CHECK_VERSION (2, 35, 1)
+ /* Init the GTypes */
+ g_type_init();
++#endif
+
+ /* Setup i18n */
+ setlocale (LC_ALL, "");
+Index: b/tests/dbus-interface.c
+===================================================================
+--- a/tests/dbus-interface.c
++++ b/tests/dbus-interface.c
+@@ -571,7 +571,9 @@
+ gint
+ main (gint argc, gchar * argv[])
+ {
++#if !GLIB_CHECK_VERSION (2, 35, 1)
+ g_type_init();
++#endif
+ g_test_init(&argc, &argv, NULL);
+
+ /* Test suites */
+Index: b/tests/server-test.c
+===================================================================
+--- a/tests/server-test.c
++++ b/tests/server-test.c
+@@ -270,7 +270,9 @@
+ gint
+ main (gint argc, gchar * argv[])
+ {
++#if !GLIB_CHECK_VERSION (2, 35, 1)
+ g_type_init();
++#endif
+ g_test_init(&argc, &argv, NULL);
+
+ /* Test suites */
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8fc1feb
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+01_clear_servers.patch
+glib-deprecated.diff
+02_server-name.patch
+03_x2go+rls.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..abde6ef
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,5 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
+
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..6adcdd7
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://launchpad.net/remote-login-service/+download .*/remote-login-service-(.+)\.tar\.gz