diff options
author | Will Rogers | 2020-09-09 13:49:50 +0000 |
---|---|---|
committer | Will Rogers | 2020-09-09 13:49:50 +0000 |
commit | 35c6554087a521ad6896f5c62d213572c5aed85d (patch) | |
tree | e85956ad7b3505e17631147e34317adb3b8ea236 | |
parent | 7d59f520f65cf8c8f5f3ad4b040ca4a99bc4b4b2 (diff) | |
download | rt.equinox.framework-35c6554087a521ad6896f5c62d213572c5aed85d.tar.gz rt.equinox.framework-35c6554087a521ad6896f5c62d213572c5aed85d.tar.xz rt.equinox.framework-35c6554087a521ad6896f5c62d213572c5aed85d.zip |
Bug 566133 - ensure valid characters in GDBus names.
Change-Id: I5a24500bfc38390c26a6e7ca74dc475870ddbbad
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c index b9856e1b0..4211eaf45 100644 --- a/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c +++ b/features/org.eclipse.equinox.executable.feature/library/gtk/eclipseGtk.c @@ -110,6 +110,18 @@ gboolean gdbus_initProxy () { const gint serviceNameLength = strlen(GDBUS_SERVICE) + strlen(getOfficialName()) + 2; gchar *serviceName = (gchar *) malloc(serviceNameLength * sizeof(gchar)); snprintf(serviceName, serviceNameLength, "%s.%s", GDBUS_SERVICE, getOfficialName()); + // Replace any characters that are not valid in a GDBus name with a hyphen. + int i; + for (i = 0; i < serviceNameLength - 1; i++) { + gchar c = serviceName[i]; + if (!((c >= '0' && c <= '9') || + (c >= 'A' && c <= 'Z') || + (c >= 'a' && c <= 'z') || + (c == '_') ||(c == '-') || (c == '.') + )) { + serviceName[i] = '-'; + } + } // Function 'g_type_init()' is not needed anymore as of glib 2.36 as gtype system is initialized earlier. It is marked as deprecated. // It is here because at the time of writing, eclipse supports glib 2.28. |