Hello community,
here is the log from the commit of package tsclient
checked in at Thu Oct 23 22:45:17 CEST 2008.
--------
--- tsclient/tsclient.changes 2008-10-16 20:15:18.000000000 +0200
+++ /d/STABLE/tsclient/tsclient.changes 2008-10-23 19:43:38.258955000 +0200
@@ -1,0 +2,7 @@
+Thu Oct 23 19:42:38 CEST 2008 - crivera@suse.de
+
+- Fix a segfault when removing ICA connections.
+- Add ICA connections to the main window after wfcmgr
+ exits. This fixes bnc#431410.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ tsclient.spec ++++++
--- /var/tmp/diff_new_pack.X16585/_old 2008-10-23 22:44:58.000000000 +0200
+++ /var/tmp/diff_new_pack.X16585/_new 2008-10-23 22:44:58.000000000 +0200
@@ -29,7 +29,7 @@
Group: Productivity/Networking/Remote Desktop
AutoReqProv: on
Version: 2.0.2
-Release: 1
+Release: 2
Summary: Terminal Server Client is a frontend for rdesktop
Source: %{name}-%{version}.tar.bz2
# NOMAD support - hfiguiere@suse.de
@@ -122,6 +122,10 @@
%{_includedir}/*
%changelog
+* Thu Oct 23 2008 crivera@suse.de
+- Fix a segfault when removing ICA connections.
+- Add ICA connections to the main window after wfcmgr
+ exits. This fixes bnc#431410.
* Thu Oct 16 2008 crivera@suse.de
- Fix an issue with Windows Terminal Services. This fixes
bnc#429705.
++++++ tsclient-2.0.2.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tsclient-2.0.2/src/plugins/default/tsc-default.c new/tsclient-2.0.2/src/plugins/default/tsc-default.c
--- old/tsclient-2.0.2/src/plugins/default/tsc-default.c 2008-10-10 20:52:37.000000000 +0200
+++ new/tsclient-2.0.2/src/plugins/default/tsc-default.c 2008-10-22 01:09:10.000000000 +0200
@@ -17,6 +17,7 @@
TSCIcaProvider *provider;
provider = tsc_ica_provider_new ();
+ g_signal_connect (manager, "removed", G_CALLBACK (tsc_ica_provider_appsrv_removed), NULL);
tsc_manager_register_provider (manager, TSC_PROVIDER (provider));
tsc_ica_provider_load_connections (provider, manager);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.c new/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.c
--- old/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.c 2008-10-10 20:52:37.000000000 +0200
+++ new/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.c 2008-10-22 01:08:21.000000000 +0200
@@ -3,6 +3,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -13,25 +14,75 @@
#define APPSRV_GROUP_NAME "ApplicationServers"
+static TSCManager *tsc_manager;
+
+typedef struct {
+ GPid pid;
+ TSCConnection *connection;
+ TSCProvider *provider;
+} ICATimeoutData;
+
+static GList *find_app_descriptions (void);
+
static TSCConnection *
tsc_ica_provider_create_connection (TSCProvider *provider)
{
return TSC_CONNECTION (g_object_new (TSC_TYPE_ICA_CONNECTION, NULL));
}
+static gboolean
+tsc_ica_provider_watch_connections (gpointer user_data)
+{
+ ICATimeoutData *data = user_data;
+ GList *apps = NULL, *l = NULL;
+
+ if (!kill (data->pid, 0))
+ return TRUE;
+
+ if (!tsc_manager) {
+ g_printerr ("Manager is not set for ICA provider\n");
+ return FALSE;
+ }
+
+ apps = find_app_descriptions ();
+ if (!apps) {
+ g_printerr ("There are no app descriptions\n");
+ return FALSE;
+ }
+
+ for (l = apps; l; l = l->next) {
+ if (!tsc_manager_lookup_connection (tsc_manager, l->data)) {
+ if (!strcmp (tsc_connection_get_name (data->connection), l->data)) {
+ tsc_manager_add_connection (tsc_manager, data->connection);
+ } else {
+ TSCIcaConnection *connection = tsc_ica_connection_new ((const char *) l->data);
+ TSC_CONNECTION (connection)->provider = TSC_PROVIDER (data->provider);
+ tsc_manager_add_connection (tsc_manager, TSC_CONNECTION (connection));
+ }
+ }
+ }
+
+ g_list_foreach (apps, (GFunc) g_free, NULL);
+ g_list_free (apps);
+ g_free (data);
+ return FALSE;
+}
+
static TSCEditDialog *
tsc_ica_provider_create_edit_dialog (TSCProvider *provider,
TSCConnection *connection)
{
char *argv[] = { WFCMGR_PATH , NULL};
GError *error = NULL;
+ ICATimeoutData *td = NULL;
+ GPid pid;
if (!g_file_test (WFCMGR_PATH, G_FILE_TEST_EXISTS)) {
tsc_util_show_error ("Error", "Can't find wfcmgr");
return NULL;
}
- if (!g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, &error)) {
+ if (!g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, &pid, &error)) {
if (error) {
tsc_util_show_error ("Error", error->message);
g_error_free (error);
@@ -40,6 +91,12 @@
}
}
+ td = g_new0 (ICATimeoutData, 1);
+ td->pid = pid;
+ td->connection = connection;
+ td->provider = provider;
+ g_timeout_add (3000, tsc_ica_provider_watch_connections, td);
+
return NULL;
}
@@ -168,11 +225,60 @@
}
void
+tsc_ica_provider_appsrv_removed (TSCManager *manager, TSCConnection *con, gpointer user_data)
+{
+ GKeyFile *kf = NULL;
+ const gchar *cname;
+ gchar *appsrv_path = NULL, *data = NULL;
+ gsize data_len;
+ GError *err = NULL;
+ int i;
+
+ if (!TSC_IS_ICA_CONNECTION (con)) {
+ return;
+ }
+
+ kf = open_appsrv ();
+ cname = tsc_connection_get_name (con);
+
+ if (!kf || !g_key_file_remove_key (kf, APPSRV_GROUP_NAME, cname, NULL)) {
+ g_printerr ("Failed to remove key %s\n", cname);
+ goto done;
+ }
+
+ if (!g_key_file_remove_group (kf, cname, NULL)) {
+ g_printerr ("Failed to remove group %s\n", cname);
+ goto done;
+ }
+
+ appsrv_path = g_build_filename (g_get_home_dir (), ".ICAClient", "appsrv.ini", NULL);
+ data = g_key_file_to_data (kf, &data_len, NULL);
+
+ /* replace the '#' comments with ';' so wfcmgr doesn't barf */
+ for (i = 0; i < data_len; i++) {
+ if (data[i] == '#' && (i == 0 || data[i - 1] == '\n')) {
+ data[i] = ';';
+ }
+ }
+
+ if (!g_file_set_contents (appsrv_path, data, data_len, &err)) {
+ g_printerr ("Failed to save appsrv.ini: %s\n", err->message);
+ g_error_free (err);
+ }
+
+done:
+ g_free (appsrv_path);
+ g_free (data);
+ g_key_file_free (kf);
+}
+
+void
tsc_ica_provider_load_connections (TSCIcaProvider *provider, TSCManager *manager)
{
GList *apps, *l;
TSCIcaConnection *connection;
-
+
+ tsc_manager = manager;
apps = find_app_descriptions ();
if (!apps) {
return;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.h new/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.h
--- old/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.h 2008-10-10 20:52:37.000000000 +0200
+++ new/tsclient-2.0.2/src/plugins/default/tsc-ica-provider.h 2008-10-22 01:07:21.000000000 +0200
@@ -14,7 +14,6 @@
#define TSC_IS_ICA_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TSC_TYPE_ICA_PROVIDER))
#define TSC_ICA_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TSC_TYPE_ICA_PROVIDER, TSCIcaProviderClass))
-
typedef struct _TSCIcaProvider {
TSCProvider parent;
} TSCIcaProvider;
@@ -26,5 +25,5 @@
GType tsc_ica_provider_get_type (void);
TSCIcaProvider *tsc_ica_provider_new (void);
void tsc_ica_provider_load_connections (TSCIcaProvider *provider, TSCManager *manager);
-
+void tsc_ica_provider_appsrv_removed (TSCManager *manager, TSCConnection *con, gpointer user_data);
#endif
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tsclient-2.0.2/src/tsc-connection.c new/tsclient-2.0.2/src/tsc-connection.c
--- old/tsclient-2.0.2/src/tsc-connection.c 2008-10-10 20:52:40.000000000 +0200
+++ new/tsclient-2.0.2/src/tsc-connection.c 2008-10-21 20:19:51.000000000 +0200
@@ -479,15 +479,24 @@
void
tsc_connection_write_favorite (TSCConnection *connection, gboolean add)
{
- int i;
- GBookmarkFile *bf = g_bookmark_file_new ();
const gchar * const *data_dirs = g_get_system_data_dirs ();
const gchar *home_dir = g_get_home_dir ();
- gchar *dir, *mime_type = "application/x-tsclient";
- gchar *uri = g_strconcat("file://~", tsc_connection_get_filename (connection) + strlen (home_dir), NULL);
- gchar *local_places = g_build_filename (g_get_user_data_dir (), "gnome-main-menu", "places.xbel", NULL);
+ const gchar *cname;
+ gchar *uri, *local_places, *dir, *mime_type = "application/x-tsclient";
TSCProvider *provider = tsc_connection_get_provider (connection);
+ GBookmarkFile *bf;
+ int i;
+ cname = tsc_connection_get_filename (connection);
+ if (!cname) {
+ g_printerr ("Filename is not set for %s\n", tsc_connection_get_name (connection));
+ return;
+ }
+
+ bf = g_bookmark_file_new ();
+ uri = g_strconcat ("file://~", cname + strlen (home_dir), NULL);
+ local_places = g_build_filename (g_get_user_data_dir (), "gnome-main-menu", "places.xbel", NULL);
+
if (g_file_test (local_places, G_FILE_TEST_EXISTS)) {
g_bookmark_file_load_from_file (bf, local_places, NULL);
} else {
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org