From bfc2a55eaf79057bf2487cd3f258250312913e1a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mar 26 2024 07:24:06 +0000 Subject: update to 0.14.0 drop upstream patch --- diff --git a/.gitignore b/.gitignore index 28e43af..c67a568 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ clog /rabbitmq-c-0.11.0-a64c08c.tar.gz /rabbitmq-c-0.12.0-675afc2.tar.gz /rabbitmq-c-0.13.0-974d71a.tar.gz +/rabbitmq-c-0.14.0-124722b.tar.gz diff --git a/librabbitmq.spec b/librabbitmq.spec index b7c1bf2..292b127 100644 --- a/librabbitmq.spec +++ b/librabbitmq.spec @@ -1,6 +1,6 @@ # Fedora spec file for librabbitmq # -# Copyright (c) 2012-2023 Remi Collet +# Copyright (c) 2012-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -9,7 +9,7 @@ %bcond_without tests -%global gh_commit 974d71adceae6d742ae20a4c880d99c131f1460a +%global gh_commit 124722b5045baa41a24ce2e2d7c52a47467e7ac0 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner alanxz %global gh_project rabbitmq-c @@ -18,21 +18,19 @@ Name: %{libname} Summary: Client library for AMQP -Version: 0.13.0 -Release: 5%{?dist} +Version: 0.14.0 +Release: 1%{?dist} License: MIT URL: https://github.com/alanxz/rabbitmq-c Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz -# CVE-2023-35789, https://github.com/alanxz/rabbitmq-c/pull/781 -Patch0: rabbitmq-c-CVE-2023-35789.patch BuildRequires: gcc -BuildRequires: cmake > 3.12 +BuildRequires: cmake >= 3.22 BuildRequires: openssl-devel >= 1.1.1 # For tools -BuildRequires: popt-devel > 1.14 +BuildRequires: popt-devel >= 1.14 # For man page BuildRequires: xmlto BuildRequires: make @@ -69,7 +67,6 @@ amqp-publish Publish a message on an AMQP server %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch -P0 -p1 # Copy sources to be included in -devel docs. cp -pr examples Examples @@ -148,6 +145,10 @@ make test %changelog +* Tue Mar 26 2024 Remi Collet - 0.14.0-1 +- update to 0.14.0 +- drop upstream patch + * Thu Jan 25 2024 Fedora Release Engineering - 0.13.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/rabbitmq-c-CVE-2023-35789.patch b/rabbitmq-c-CVE-2023-35789.patch deleted file mode 100644 index 71f8ba9..0000000 --- a/rabbitmq-c-CVE-2023-35789.patch +++ /dev/null @@ -1,125 +0,0 @@ -commit 463054383fbeef889b409a7f843df5365288e2a0 -Author: Christian Kastner -Date: Tue Jun 13 14:21:52 2023 +0200 - - Add option to read username/password from file (#781) - - * Add option to read username/password from file - -diff --git a/tools/common.c b/tools/common.c -index 73b47e2..7efe557 100644 ---- a/tools/common.c -+++ b/tools/common.c -@@ -18,6 +18,11 @@ - #include "compat.h" - #endif - -+/* For when reading auth data from a file */ -+#define MAXAUTHTOKENLEN 128 -+#define USERNAMEPREFIX "username:" -+#define PASSWORDPREFIX "password:" -+ - void die(const char *fmt, ...) { - va_list ap; - va_start(ap, fmt); -@@ -125,6 +130,7 @@ static char *amqp_vhost; - static char *amqp_username; - static char *amqp_password; - static int amqp_heartbeat = 0; -+static char *amqp_authfile; - #ifdef WITH_SSL - static int amqp_ssl = 0; - static char *amqp_cacert = "/etc/ssl/certs/cacert.pem"; -@@ -147,6 +153,8 @@ struct poptOption connect_options[] = { - "the password to login with", "password"}, - {"heartbeat", 0, POPT_ARG_INT, &amqp_heartbeat, 0, - "heartbeat interval, set to 0 to disable", "heartbeat"}, -+ {"authfile", 0, POPT_ARG_STRING, &amqp_authfile, 0, -+ "path to file containing username/password for authentication", "file"}, - #ifdef WITH_SSL - {"ssl", 0, POPT_ARG_NONE, &amqp_ssl, 0, "connect over SSL/TLS", NULL}, - {"cacert", 0, POPT_ARG_STRING, &amqp_cacert, 0, -@@ -158,6 +166,50 @@ struct poptOption connect_options[] = { - #endif /* WITH_SSL */ - {NULL, '\0', 0, NULL, 0, NULL, NULL}}; - -+void read_authfile(const char *path) { -+ size_t n; -+ FILE *fp = NULL; -+ char token[MAXAUTHTOKENLEN]; -+ -+ if ((amqp_username = malloc(MAXAUTHTOKENLEN)) == NULL || -+ (amqp_password = malloc(MAXAUTHTOKENLEN)) == NULL) { -+ die("Out of memory"); -+ } else if ((fp = fopen(path, "r")) == NULL) { -+ die("Could not read auth data file %s", path); -+ } -+ -+ if (fgets(token, MAXAUTHTOKENLEN, fp) == NULL || -+ strncmp(token, USERNAMEPREFIX, strlen(USERNAMEPREFIX))) { -+ die("Malformed auth file (missing username)"); -+ } -+ strncpy(amqp_username, &token[strlen(USERNAMEPREFIX)], MAXAUTHTOKENLEN); -+ /* Missing newline means token was cut off */ -+ n = strlen(amqp_username); -+ if (amqp_username[n - 1] != '\n') { -+ die("Username too long"); -+ } else { -+ amqp_username[n - 1] = '\0'; -+ } -+ -+ if (fgets(token, MAXAUTHTOKENLEN, fp) == NULL || -+ strncmp(token, PASSWORDPREFIX, strlen(PASSWORDPREFIX))) { -+ die("Malformed auth file (missing password)"); -+ } -+ strncpy(amqp_password, &token[strlen(PASSWORDPREFIX)], MAXAUTHTOKENLEN); -+ /* Missing newline means token was cut off */ -+ n = strlen(amqp_password); -+ if (amqp_password[n - 1] != '\n') { -+ die("Password too long"); -+ } else { -+ amqp_password[n - 1] = '\0'; -+ } -+ -+ (void)fgetc(fp); -+ if (!feof(fp)) { -+ die("Malformed auth file (trailing data)"); -+ } -+} -+ - static void init_connection_info(struct amqp_connection_info *ci) { - ci->user = NULL; - ci->password = NULL; -@@ -237,6 +289,8 @@ static void init_connection_info(struct amqp_connection_info *ci) { - if (amqp_username) { - if (amqp_url) { - die("--username and --url options cannot be used at the same time"); -+ } else if (amqp_authfile) { -+ die("--username and --authfile options cannot be used at the same time"); - } - - ci->user = amqp_username; -@@ -245,11 +299,23 @@ static void init_connection_info(struct amqp_connection_info *ci) { - if (amqp_password) { - if (amqp_url) { - die("--password and --url options cannot be used at the same time"); -+ } else if (amqp_authfile) { -+ die("--password and --authfile options cannot be used at the same time"); - } - - ci->password = amqp_password; - } - -+ if (amqp_authfile) { -+ if (amqp_url) { -+ die("--authfile and --url options cannot be used at the same time"); -+ } -+ -+ read_authfile(amqp_authfile); -+ ci->user = amqp_username; -+ ci->password = amqp_password; -+ } -+ - if (amqp_vhost) { - if (amqp_url) { - die("--vhost and --url options cannot be used at the same time"); diff --git a/sources b/sources index d9fada3..a650cbf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rabbitmq-c-0.13.0-974d71a.tar.gz) = 58b3ca777a971ac451edb75afb2446d4bf7611134387db6dadcc95ff1f44257eb1812ff665f658544e03e14622ccc6aacc26d03d1b30a16470ccb1977275bf34 +SHA512 (rabbitmq-c-0.14.0-124722b.tar.gz) = 167f340002d96769e19b5ea7e567d397f6702b0c212cbcf771f2e8ea16531221046747f9d70315869f696587a9e0922d922362efcc45bb1401420e9558b63acc