diff options
author | Bastien Nocera <hadess@hadess.net> | 2016-06-23 15:26:14 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2016-06-23 15:29:29 +0200 |
commit | 4f9fd57c8a732db2180c0298e56b595bfaa47058 (patch) | |
tree | 66a84f7781dda14023fd2d4b53a978b0c31db34e | |
parent | 0827ce8851b0d613adeecab2b29542c50aae17e0 (diff) | |
download | geoclue-4f9fd57c8a732db2180c0298e56b595bfaa47058.tar.gz |
client-info: Reliable desktop ID for flatpak as well
Now that xdg-app has been renamed, we also need to check for the
"flatpak-" prefix for the cgroup.
https://bugs.freedesktop.org/show_bug.cgi?id=96655
-rw-r--r-- | src/gclue-client-info.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gclue-client-info.c b/src/gclue-client-info.c index f128736..1a47669 100644 --- a/src/gclue-client-info.c +++ b/src/gclue-client-info.c @@ -207,10 +207,13 @@ get_xdg_id (guint32 pid) continue; scope = g_path_get_basename (unit); - if (!g_str_has_prefix (scope, "xdg-app-") || + if ((!g_str_has_prefix (scope, "xdg-app-") && + !g_str_has_prefix (scope, "flatpak-")) || !g_str_has_suffix (scope, ".scope")) break; + /* strlen("flatpak-") == strlen("xdg-app-") + * so all is good here */ name = scope + strlen("xdg-app-"); dash = strchr (name, '-'); |