[gnome-software] Check the version in flatpakrepo files
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] Check the version in flatpakrepo files
- Date: Tue, 13 Dec 2016 13:41:31 +0000 (UTC)
commit 66cd2fce87592c23b561bf45433d415aefd34f27
Author: Richard Hughes <richard hughsie com>
Date: Tue Dec 13 13:41:20 2016 +0000
Check the version in flatpakrepo files
src/plugins/gs-flatpak.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index cc249d2..3465cf2 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -2431,6 +2431,18 @@ gs_flatpak_file_to_app_repo (GsFlatpak *self,
return FALSE;
}
+ /* check version */
+ if (g_key_file_has_key (kf, "Flatpak Repo", "Version", NULL)) {
+ guint64 ver = g_key_file_get_uint64 (kf, "Flatpak Repo", "Version", NULL);
+ if (ver != 1) {
+ g_set_error (error,
+ GS_PLUGIN_ERROR,
+ GS_PLUGIN_ERROR_NOT_SUPPORTED,
+ "unsupported version %" G_GUINT64_FORMAT, ver);
+ return FALSE;
+ }
+ }
+
/* user specified a URL */
if (g_str_has_prefix (repo_gpgkey, "http://") ||
g_str_has_prefix (repo_gpgkey, "https://")) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]