From 2aa152c55eea07c6fb3515e6a7f1c81f6baf04a8 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Mon, 15 Sep 2025 12:15:36 +0000 Subject: [PATCH] import CS libqmi-1.34.0-1.el9 --- .gitignore | 2 +- .libqmi.metadata | 2 +- ...ert-the-service-type-index-fits-into.patch | 28 +++ ...se-the-file-handle-even-if-it-s-zero.patch | 28 +++ ...cli-avoid-leaking-the-input-messages.patch | 162 ++++++++++++++++++ .../0004-qmicli-dms-do-not-leak-split.patch | 52 ++++++ ...automatic-pointers-for-split-strings.patch | 156 +++++++++++++++++ ...icli-dms-do-not-leak-result-on-error.patch | 26 +++ .../0007-qmicli-nas-avoid-leaking-mnc.patch | 24 +++ ...icli-pdc-avoid-leaking-file_contents.patch | 25 +++ ...micli-ims-fix-a-silly-argument-mixup.patch | 37 ++++ ...764338d3127924cfefaa9cf1b0cc4f90a189.patch | 34 ++++ SPECS/libqmi.spec | 28 ++- 13 files changed, 596 insertions(+), 8 deletions(-) create mode 100644 SOURCES/0001-test-fixture-assert-the-service-type-index-fits-into.patch create mode 100644 SOURCES/0002-swi-update-close-the-file-handle-even-if-it-s-zero.patch create mode 100644 SOURCES/0003-qmicli-avoid-leaking-the-input-messages.patch create mode 100644 SOURCES/0004-qmicli-dms-do-not-leak-split.patch create mode 100644 SOURCES/0005-qmicli-dms-use-automatic-pointers-for-split-strings.patch create mode 100644 SOURCES/0006-qmicli-dms-do-not-leak-result-on-error.patch create mode 100644 SOURCES/0007-qmicli-nas-avoid-leaking-mnc.patch create mode 100644 SOURCES/0008-qmicli-pdc-avoid-leaking-file_contents.patch create mode 100644 SOURCES/0009-qmicli-ims-fix-a-silly-argument-mixup.patch create mode 100644 SOURCES/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch diff --git a/.gitignore b/.gitignore index ec7384a..6688f33 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/libqmi-1.32.2.tar.bz2 +SOURCES/libqmi-1.34.0.tar.bz2 diff --git a/.libqmi.metadata b/.libqmi.metadata index 2669598..e17c6f9 100644 --- a/.libqmi.metadata +++ b/.libqmi.metadata @@ -1 +1 @@ -3bc82111a621e684dd61f26ea0cc7cc54cf09c9f SOURCES/libqmi-1.32.2.tar.bz2 +e334503461000fccf5788f45c6ac0050b3ff2bad SOURCES/libqmi-1.34.0.tar.bz2 diff --git a/SOURCES/0001-test-fixture-assert-the-service-type-index-fits-into.patch b/SOURCES/0001-test-fixture-assert-the-service-type-index-fits-into.patch new file mode 100644 index 0000000..4037719 --- /dev/null +++ b/SOURCES/0001-test-fixture-assert-the-service-type-index-fits-into.patch @@ -0,0 +1,28 @@ +From a87202030adf1fc1c1082a20e778ca7eaf46bcca Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:02:20 +0200 +Subject: [PATCH 1/9] test-fixture: assert the service type index fits into + service_info[] + +Largest QmiService is QMI_SERVICE_SSC=0x190 (400 dec) whereas +service_info[] has 255 elements. This made a static analyzer +frown. Make it happy again! +--- + src/libqmi-glib/test/test-fixture.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/libqmi-glib/test/test-fixture.c b/src/libqmi-glib/test/test-fixture.c +index cfbc2b49..32049c67 100644 +--- a/src/libqmi-glib/test/test-fixture.c ++++ b/src/libqmi-glib/test/test-fixture.c +@@ -51,6 +51,7 @@ device_allocate_client_ready (QmiDevice *device, + + service = qmi_client_get_service (client); + g_assert (service > QMI_SERVICE_CTL); ++ g_assert ((unsigned)service < G_N_ELEMENTS (fixture->service_info)); + fixture->service_info[service].client = client; + fixture->service_info[service].transaction_id = 0x0001; + test_fixture_loop_stop (fixture); +-- +2.45.2 + diff --git a/SOURCES/0002-swi-update-close-the-file-handle-even-if-it-s-zero.patch b/SOURCES/0002-swi-update-close-the-file-handle-even-if-it-s-zero.patch new file mode 100644 index 0000000..b59973f --- /dev/null +++ b/SOURCES/0002-swi-update-close-the-file-handle-even-if-it-s-zero.patch @@ -0,0 +1,28 @@ +From 489dde670fd2b5e6721876279dce03f3a4002d44 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:46:56 +0200 +Subject: [PATCH 2/9] swi-update: close the file handle even if it's zero + +Technically, zero is a perfectly fine file descriptor for open() to +return in case the parent process feels frivolous and chooses to +close stdin. +--- + utils/swi-update.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/utils/swi-update.c b/utils/swi-update.c +index 609c5baa..61cd71c9 100644 +--- a/utils/swi-update.c ++++ b/utils/swi-update.c +@@ -867,7 +867,7 @@ static int download_image(int serfd, char *buf, const char *image) + fprintf(stderr, "\n"); + + out: +- if (imgfd > 0) ++ if (imgfd >= 0) + close(imgfd); + return ret; + } +-- +2.45.2 + diff --git a/SOURCES/0003-qmicli-avoid-leaking-the-input-messages.patch b/SOURCES/0003-qmicli-avoid-leaking-the-input-messages.patch new file mode 100644 index 0000000..5aaa1ea --- /dev/null +++ b/SOURCES/0003-qmicli-avoid-leaking-the-input-messages.patch @@ -0,0 +1,162 @@ +From 6de3d5c2481b219271ee747739995266d5f76ba0 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:06:47 +0200 +Subject: [PATCH 3/9] qmicli: avoid leaking the input messages + +In various places in we follow this pattern: + + input = qmi_message_uim_power_on_sim_input_new (); + if (bad arguments) { + complain(); + return; // leak input + } + issue_message(input); + +Let's, instead, always do the argument sanity checks before allocating +the message, to avoid leaking the message. +--- + src/qmicli/qmicli-uim.c | 8 ++++---- + src/qmicli/qmicli-wds.c | 31 +++++++++++++++++++++---------- + 2 files changed, 25 insertions(+), 14 deletions(-) + +diff --git a/src/qmicli/qmicli-uim.c b/src/qmicli/qmicli-uim.c +index e344a682..2238c55b 100644 +--- a/src/qmicli/qmicli-uim.c ++++ b/src/qmicli/qmicli-uim.c +@@ -849,13 +849,13 @@ power_on_sim_input_create (const gchar *slot_str) + guint slot; + GError *error = NULL; + +- input = qmi_message_uim_power_on_sim_input_new (); +- + if (!qmicli_read_uint_from_string (slot_str, &slot) || (slot > G_MAXUINT8)) { + g_printerr ("error: invalid slot number\n"); + return NULL; + } + ++ input = qmi_message_uim_power_on_sim_input_new (); ++ + if (!qmi_message_uim_power_on_sim_input_set_slot (input, slot, &error)) { + g_printerr ("error: could not create SIM power on input: %s\n", error->message); + g_error_free (error); +@@ -907,13 +907,13 @@ power_off_sim_input_create (const gchar *slot_str) + guint slot; + GError *error = NULL; + +- input = qmi_message_uim_power_off_sim_input_new (); +- + if (!qmicli_read_uint_from_string (slot_str, &slot) || (slot > G_MAXUINT8)) { + g_printerr ("error: invalid slot number\n"); + return NULL; + } + ++ input = qmi_message_uim_power_off_sim_input_new (); ++ + if (!qmi_message_uim_power_off_sim_input_set_slot (input, slot, &error)) { + g_printerr ("error: could not create SIM power off input: %s\n", error->message); + g_error_free (error); +diff --git a/src/qmicli/qmicli-wds.c b/src/qmicli/qmicli-wds.c +index 66a9d7cd..0bae3b40 100644 +--- a/src/qmicli/qmicli-wds.c ++++ b/src/qmicli/qmicli-wds.c +@@ -3197,14 +3197,14 @@ qmicli_wds_run (QmiDevice *device, + #if defined HAVE_QMI_MESSAGE_WDS_SET_IP_FAMILY + if (set_ip_family_str) { + QmiMessageWdsSetIpFamilyInput *input; ++ QmiWdsIpFamily preference; + +- input = qmi_message_wds_set_ip_family_input_new (); + switch (atoi (set_ip_family_str)) { + case 4: +- qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV4, NULL); ++ preference = QMI_WDS_IP_FAMILY_IPV4; + break; + case 6: +- qmi_message_wds_set_ip_family_input_set_preference (input, QMI_WDS_IP_FAMILY_IPV6, NULL); ++ preference = QMI_WDS_IP_FAMILY_IPV6; + break; + default: + g_printerr ("error: unknown IP type '%s' (not 4 or 6)\n", +@@ -3212,6 +3212,10 @@ qmicli_wds_run (QmiDevice *device, + operation_shutdown (FALSE); + return; + } ++ ++ input = qmi_message_wds_set_ip_family_input_new (); ++ qmi_message_wds_set_ip_family_input_set_preference (input, preference, NULL); ++ + g_debug ("Asynchronously set IP family..."); + qmi_client_wds_set_ip_family (client, + input, +@@ -3441,7 +3445,6 @@ qmicli_wds_run (QmiDevice *device, + guint profile_index; + + split = g_strsplit (delete_profile_str, ",", -1); +- input = qmi_message_wds_delete_profile_input_new (); + + if (g_strv_length (split) != 2) { + g_printerr ("error: expected 2 arguments for delete profile command\n"); +@@ -3471,6 +3474,8 @@ qmicli_wds_run (QmiDevice *device, + return; + } + ++ input = qmi_message_wds_delete_profile_input_new (); ++ + qmi_message_wds_delete_profile_input_set_profile_identifier (input, profile_type, (guint8)profile_index, NULL); + + g_strfreev (split); +@@ -3490,12 +3495,12 @@ qmicli_wds_run (QmiDevice *device, + #if defined HAVE_QMI_MESSAGE_WDS_GET_PROFILE_LIST && defined HAVE_QMI_MESSAGE_WDS_GET_PROFILE_SETTINGS + if (get_profile_list_str) { + QmiMessageWdsGetProfileListInput *input; ++ QmiWdsProfileType profile_type; + +- input = qmi_message_wds_get_profile_list_input_new (); + if (g_str_equal (get_profile_list_str, "3gpp")) +- qmi_message_wds_get_profile_list_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP, NULL); ++ profile_type = QMI_WDS_PROFILE_TYPE_3GPP; + else if (g_str_equal (get_profile_list_str, "3gpp2")) +- qmi_message_wds_get_profile_list_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP2, NULL); ++ profile_type = QMI_WDS_PROFILE_TYPE_3GPP2; + else { + g_printerr ("error: invalid profile type '%s'. Expected '3gpp' or '3gpp2'.'\n", + get_profile_list_str); +@@ -3503,6 +3508,9 @@ qmicli_wds_run (QmiDevice *device, + return; + } + ++ input = qmi_message_wds_get_profile_list_input_new (); ++ qmi_message_wds_get_profile_list_input_set_profile_type (input, profile_type, NULL); ++ + g_debug ("Asynchronously get profile list..."); + qmi_client_wds_get_profile_list (ctx->client, + input, +@@ -3574,12 +3582,12 @@ qmicli_wds_run (QmiDevice *device, + #if defined HAVE_QMI_MESSAGE_WDS_GET_DEFAULT_SETTINGS + if (get_default_settings_str) { + QmiMessageWdsGetDefaultSettingsInput *input; ++ QmiWdsProfileType profile_type; + +- input = qmi_message_wds_get_default_settings_input_new (); + if (g_str_equal (get_default_settings_str, "3gpp")) +- qmi_message_wds_get_default_settings_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP, NULL); ++ profile_type = QMI_WDS_PROFILE_TYPE_3GPP; + else if (g_str_equal (get_default_settings_str, "3gpp2")) +- qmi_message_wds_get_default_settings_input_set_profile_type (input, QMI_WDS_PROFILE_TYPE_3GPP2, NULL); ++ profile_type = QMI_WDS_PROFILE_TYPE_3GPP2; + else { + g_printerr ("error: invalid default type '%s'. Expected '3gpp' or '3gpp2'.'\n", + get_default_settings_str); +@@ -3587,6 +3595,9 @@ qmicli_wds_run (QmiDevice *device, + return; + } + ++ input = qmi_message_wds_get_default_settings_input_new (); ++ qmi_message_wds_get_default_settings_input_set_profile_type (input, profile_type, NULL); ++ + g_debug ("Asynchronously get default settings..."); + qmi_client_wds_get_default_settings (ctx->client, + input, +-- +2.45.2 + diff --git a/SOURCES/0004-qmicli-dms-do-not-leak-split.patch b/SOURCES/0004-qmicli-dms-do-not-leak-split.patch new file mode 100644 index 0000000..838d229 --- /dev/null +++ b/SOURCES/0004-qmicli-dms-do-not-leak-split.patch @@ -0,0 +1,52 @@ +From 71e28cdb5e203715f5b75ee2930faa0416579b3d Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:33:46 +0200 +Subject: [PATCH 4/9] qmicli-dms: do not leak split[] + +In various places we fail to free up whatever g_strsplit() returned in +error handling paths. Let's use automatic pointers in those cases. +--- + src/qmicli/qmicli-dms.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c +index 8108f0a6..1bea9ad4 100644 +--- a/src/qmicli/qmicli-dms.c ++++ b/src/qmicli/qmicli-dms.c +@@ -2070,14 +2070,13 @@ static QmiMessageDmsActivateManualInput * + activate_manual_input_create (const gchar *str) + { + QmiMessageDmsActivateManualInput *input; +- gchar **split; ++ g_auto(GStrv) split = NULL; + GError *error = NULL; + gulong split_1_int; + + split = g_strsplit (str, ",", -1); + if (g_strv_length (split) != 4) { + g_printerr ("error: incorrect number of arguments given\n"); +- g_strfreev (split); + return NULL; + } + +@@ -2103,7 +2102,6 @@ activate_manual_input_create (const gchar *str) + input = NULL; + } + +- g_strfreev(split); + return input; + } + +@@ -3184,8 +3182,8 @@ get_stored_image (QmiClientDms *client, + gpointer user_data) + { + GetStoredImageContext *operation_ctx; ++ g_auto(GStrv) split = NULL; + GTask *task; +- gchar **split; + guint i = 0; + gint modem_index = -1; + gint pri_index = -1; +-- +2.45.2 + diff --git a/SOURCES/0005-qmicli-dms-use-automatic-pointers-for-split-strings.patch b/SOURCES/0005-qmicli-dms-use-automatic-pointers-for-split-strings.patch new file mode 100644 index 0000000..f1e4a6d --- /dev/null +++ b/SOURCES/0005-qmicli-dms-use-automatic-pointers-for-split-strings.patch @@ -0,0 +1,156 @@ +From b5a9b693d04d2236b24455249408432a02b89484 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:40:57 +0200 +Subject: [PATCH 5/9] qmicli-dms: use automatic pointers for split strings + +Do it for consistence's sake but also because it's apparently an easy +thing to mess up. + +No change in behavior, purely a cosmetic change. +--- + src/qmicli/qmicli-dms.c | 24 ++++++++---------------- + 1 file changed, 8 insertions(+), 16 deletions(-) + +diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c +index 1bea9ad4..d001656f 100644 +--- a/src/qmicli/qmicli-dms.c ++++ b/src/qmicli/qmicli-dms.c +@@ -941,7 +941,7 @@ static QmiMessageDmsUimSetPinProtectionInput * + uim_set_pin_protection_input_create (const gchar *str) + { + QmiMessageDmsUimSetPinProtectionInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + QmiDmsUimPinId pin_id; + gboolean enable_disable; + gchar *current_pin; +@@ -970,7 +970,6 @@ uim_set_pin_protection_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +@@ -1030,7 +1029,7 @@ static QmiMessageDmsUimVerifyPinInput * + uim_verify_pin_input_create (const gchar *str) + { + QmiMessageDmsUimVerifyPinInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + QmiDmsUimPinId pin_id; + gchar *current_pin; + +@@ -1056,7 +1055,6 @@ uim_verify_pin_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +@@ -1116,7 +1114,7 @@ static QmiMessageDmsUimUnblockPinInput * + uim_unblock_pin_input_create (const gchar *str) + { + QmiMessageDmsUimUnblockPinInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + QmiDmsUimPinId pin_id; + gchar *puk; + gchar *new_pin; +@@ -1145,7 +1143,6 @@ uim_unblock_pin_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +@@ -1205,7 +1202,7 @@ static QmiMessageDmsUimChangePinInput * + uim_change_pin_input_create (const gchar *str) + { + QmiMessageDmsUimChangePinInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + QmiDmsUimPinId pin_id; + gchar *old_pin; + gchar *new_pin; +@@ -1234,7 +1231,6 @@ uim_change_pin_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +@@ -1567,7 +1563,7 @@ static QmiMessageDmsUimSetCkProtectionInput * + uim_set_ck_protection_input_create (const gchar *str) + { + QmiMessageDmsUimSetCkProtectionInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + QmiDmsUimFacility facility; + gboolean enable_disable; + gchar *key; +@@ -1602,7 +1598,6 @@ uim_set_ck_protection_input_create (const gchar *str) + } + } + } +- g_strfreev (split); + + return input; + } +@@ -1658,7 +1653,7 @@ static QmiMessageDmsUimUnblockCkInput * + uim_unblock_ck_input_create (const gchar *str) + { + QmiMessageDmsUimUnblockCkInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + QmiDmsUimFacility facility; + gchar *key; + +@@ -1684,7 +1679,6 @@ uim_unblock_ck_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +@@ -2234,7 +2228,7 @@ static QmiMessageDmsSetUserLockStateInput * + set_user_lock_state_input_create (const gchar *str) + { + QmiMessageDmsSetUserLockStateInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + gboolean enable_disable; + gchar *code; + +@@ -2261,7 +2255,6 @@ set_user_lock_state_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +@@ -2304,7 +2297,7 @@ static QmiMessageDmsSetUserLockCodeInput * + set_user_lock_code_input_create (const gchar *str) + { + QmiMessageDmsSetUserLockCodeInput *input = NULL; +- gchar **split; ++ g_auto(GStrv) split = NULL; + gchar *old_code; + gchar *new_code; + +@@ -2330,7 +2323,6 @@ set_user_lock_code_input_create (const gchar *str) + input = NULL; + } + } +- g_strfreev (split); + + return input; + } +-- +2.45.2 + diff --git a/SOURCES/0006-qmicli-dms-do-not-leak-result-on-error.patch b/SOURCES/0006-qmicli-dms-do-not-leak-result-on-error.patch new file mode 100644 index 0000000..7b8ed68 --- /dev/null +++ b/SOURCES/0006-qmicli-dms-do-not-leak-result-on-error.patch @@ -0,0 +1,26 @@ +From b723ac5dbf5d055a614fdb8e2b755c086e47c086 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:56:12 +0200 +Subject: [PATCH 6/9] qmicli-dms: do not leak result on error + +The result is not properly disposed in error handling path, resulting +in a potential leak. +--- + src/qmicli/qmicli-dms.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c +index d001656f..afba1e19 100644 +--- a/src/qmicli/qmicli-dms.c ++++ b/src/qmicli/qmicli-dms.c +@@ -3136,6 +3136,7 @@ get_stored_image_list_stored_images_ready (QmiClientDms *client, + qmi_message_dms_list_stored_images_output_unref (output); + g_object_unref (task); + operation_shutdown (FALSE); ++ get_stored_image_result_free (result); + return; + } + +-- +2.45.2 + diff --git a/SOURCES/0007-qmicli-nas-avoid-leaking-mnc.patch b/SOURCES/0007-qmicli-nas-avoid-leaking-mnc.patch new file mode 100644 index 0000000..41f1755 --- /dev/null +++ b/SOURCES/0007-qmicli-nas-avoid-leaking-mnc.patch @@ -0,0 +1,24 @@ +From b68d1760f81377dcf807e969a78671f19af38993 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:25:45 +0200 +Subject: [PATCH 7/9] qmicli-nas: avoid leaking mnc + +--- + src/qmicli/qmicli-nas.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qmicli/qmicli-nas.c b/src/qmicli/qmicli-nas.c +index c51a5b02..7f69bfb9 100644 +--- a/src/qmicli/qmicli-nas.c ++++ b/src/qmicli/qmicli-nas.c +@@ -3837,6 +3837,7 @@ get_operator_name_ready (QmiClientNas *client, + element->lac1, + element->lac2, + element->plmn_name_record_identifier); ++ g_free(mnc); + } + } + +-- +2.45.2 + diff --git a/SOURCES/0008-qmicli-pdc-avoid-leaking-file_contents.patch b/SOURCES/0008-qmicli-pdc-avoid-leaking-file_contents.patch new file mode 100644 index 0000000..5d82c96 --- /dev/null +++ b/SOURCES/0008-qmicli-pdc-avoid-leaking-file_contents.patch @@ -0,0 +1,25 @@ +From e7651c90e8d081371486deabd44db2b796a546f1 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:45:34 +0200 +Subject: [PATCH 8/9] qmicli-pdc: avoid leaking file_contents[] + +Release it when not needed any more. +--- + src/qmicli/qmicli-pdc.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/qmicli/qmicli-pdc.c b/src/qmicli/qmicli-pdc.c +index 8139ef4b..4e7a19c4 100644 +--- a/src/qmicli/qmicli-pdc.c ++++ b/src/qmicli/qmicli-pdc.c +@@ -1127,6 +1127,7 @@ load_config_file_from_string (const gchar *str) + hash_size = g_checksum_type_get_length (G_CHECKSUM_SHA1); + checksum = g_checksum_new (G_CHECKSUM_SHA1); + g_checksum_update (checksum, file_contents, file_size); ++ g_free (file_contents); + + data = g_slice_new (LoadConfigFileData); + data->mapped_file = g_mapped_file_ref (mapped_file); +-- +2.45.2 + diff --git a/SOURCES/0009-qmicli-ims-fix-a-silly-argument-mixup.patch b/SOURCES/0009-qmicli-ims-fix-a-silly-argument-mixup.patch new file mode 100644 index 0000000..790429f --- /dev/null +++ b/SOURCES/0009-qmicli-ims-fix-a-silly-argument-mixup.patch @@ -0,0 +1,37 @@ +From dadd1683067e13199a535cca71b5e3bc4029f056 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 23 May 2024 10:51:14 +0200 +Subject: [PATCH 9/9] qmicli-ims: fix a silly argument mixup + +Possibly a cut'n'paste oversight or something. +--- + src/qmicli/qmicli-ims.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/qmicli/qmicli-ims.c b/src/qmicli/qmicli-ims.c +index 880aeec7..b690597a 100644 +--- a/src/qmicli/qmicli-ims.c ++++ b/src/qmicli/qmicli-ims.c +@@ -195,16 +195,16 @@ get_services_enabled_ready (QmiClientIms *client, + g_print ("[%s] IMS services:\n", qmi_device_get_path_display (ctx->device)); + + if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_voice_service_enabled (output, &service_voice_enabled, NULL)) +- g_print ("\t IMS registration enabled: %s\n", service_ims_registration_enabled? "yes" : "no"); ++ g_print ("\t Voice service enabled: %s\n", service_voice_enabled? "yes" : "no"); + + if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_video_telephony_service_enabled (output, &service_vt_enabled, NULL)) +- g_print ("\t Voice service enabled: %s\n", service_voice_enabled? "yes" : "no"); ++ g_print ("\tVideo Telephony service enabled: %s\n", service_vt_enabled? "yes" : "no"); + + if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_voice_wifi_service_enabled (output, &service_voice_wifi_enabled, NULL)) + g_print ("\t Voice WiFi service enabled: %s\n", service_voice_wifi_enabled? "yes" : "no"); + + if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_registration_service_enabled (output, &service_ims_registration_enabled, NULL)) +- g_print ("\tVideo Telephony service enabled: %s\n", service_vt_enabled? "yes" : "no"); ++ g_print ("\t IMS registration enabled: %s\n", service_ims_registration_enabled? "yes" : "no"); + + if (qmi_message_ims_get_ims_services_enabled_setting_output_get_ims_ut_service_enabled (output, &service_ut_enabled, NULL)) + g_print ("\t UE to TAS service enabled: %s\n", service_ut_enabled? "yes" : "no"); +-- +2.45.2 + diff --git a/SOURCES/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch b/SOURCES/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch new file mode 100644 index 0000000..4f25105 --- /dev/null +++ b/SOURCES/6662764338d3127924cfefaa9cf1b0cc4f90a189.patch @@ -0,0 +1,34 @@ +From 6662764338d3127924cfefaa9cf1b0cc4f90a189 Mon Sep 17 00:00:00 2001 +From: Arnaud Ferraris +Date: Sat, 21 Oct 2023 11:43:09 +0200 +Subject: [PATCH] libqmi-glib,message: fix 16-bit service on big endian + architectures + +The latest release introduces handling of 16-bit service indications. +However, only the raw message data is returned from +`qmi_message_get_service()`, leading to incorrect values on big-endian +architectures. As a consequence, `libqmi` ultimately fails to build as +the corresponding test errors out in this case. + +This patch ensures the service indication is correct on all kinds of +architectures. +--- + src/libqmi-glib/qmi-message.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libqmi-glib/qmi-message.c b/src/libqmi-glib/qmi-message.c +index 3e31b4b4..1918a456 100644 +--- a/src/libqmi-glib/qmi-message.c ++++ b/src/libqmi-glib/qmi-message.c +@@ -226,7 +226,7 @@ qmi_message_get_service (QmiMessage *self) + if (MESSAGE_IS_QMUX (self)) + return (QmiService)((struct full_message *)(self->data))->header.qmux.service; + +- return (QmiService)((struct full_message *)(self->data))->header.qrtr.service; ++ return (QmiService)GUINT16_FROM_LE (((struct full_message *)(self->data))->header.qrtr.service); + } + + guint8 +-- +GitLab + diff --git a/SPECS/libqmi.spec b/SPECS/libqmi.spec index 18ebc36..dddd950 100644 --- a/SPECS/libqmi.spec +++ b/SPECS/libqmi.spec @@ -1,11 +1,25 @@ Name: libqmi -Version: 1.32.2 +Version: 1.34.0 Release: 1%{?dist} Summary: Support library to use the Qualcomm MSM Interface (QMI) protocol -License: LGPLv2+ +License: LGPL-2.1-or-later URL: http://freedesktop.org/software/libqmi Source: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/archive/%{version}/%{name}-%{version}.tar.bz2 +# upstream patch for big endian issue +# https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/commit/6662764338d3127924cfefaa9cf1b0cc4f90a189 +Patch0: 6662764338d3127924cfefaa9cf1b0cc4f90a189.patch +# All of these are applied upstream, patches can be dropped with rebase to 1.36 +Patch1: 0001-test-fixture-assert-the-service-type-index-fits-into.patch +Patch2: 0002-swi-update-close-the-file-handle-even-if-it-s-zero.patch +Patch3: 0003-qmicli-avoid-leaking-the-input-messages.patch +Patch4: 0004-qmicli-dms-do-not-leak-split.patch +Patch5: 0005-qmicli-dms-use-automatic-pointers-for-split-strings.patch +Patch6: 0006-qmicli-dms-do-not-leak-result-on-error.patch +Patch7: 0007-qmicli-nas-avoid-leaking-mnc.patch +Patch8: 0008-qmicli-pdc-avoid-leaking-file_contents.patch +Patch9: 0009-qmicli-ims-fix-a-silly-argument-mixup.patch + BuildRequires: meson >= 0.53 BuildRequires: gcc BuildRequires: glib2-devel >= 2.56 @@ -36,7 +50,7 @@ applications using QMI functionality from applications that use glib. %package utils Summary: Utilities to use the QMI protocol from the command line Requires: %{name}%{?_isa} = %{version}-%{release} -License: GPLv2+ +License: GPL-2.0-or-later %description utils This package contains the utilities that make it easier to use QMI functionality @@ -58,9 +72,8 @@ from the command line. %install %meson_install find %{buildroot}%{_datadir}/gtk-doc |xargs touch --reference meson.build -find %{buildroot} -type f -name "*.la" -delete -mkdir -p %{buildroot}%{_datadir}/bash-completion -cp -a src/qmicli/qmicli %{buildroot}%{_datadir}/bash-completion +mkdir -p %{buildroot}%{_datadir}/bash-completion/completions +cp -a src/qmicli/qmicli %{buildroot}%{_datadir}/bash-completion/completions/ %check @@ -96,6 +109,9 @@ cp -a src/qmicli/qmicli %{buildroot}%{_datadir}/bash-completion %changelog +* Thu Mar 06 2025 Lubomir Rintel - 1.34.0-1 +- Update to 1.34.0 + * Tue Nov 22 2022 Lubomir Rintel - 1.32.2-1 - Update to 1.32.2