diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore index 28e43af..89f6d2c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ 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 +/rabbitmq-c-0.15.0-84b81cd.tar.gz diff --git a/librabbitmq.spec b/librabbitmq.spec index 138d52c..deafdfa 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 84b81cd97a1b5515d3d4b304796680da24c666d8 %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 +Version: 0.15.0 Release: 3%{?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 @@ -54,7 +52,7 @@ for %{name}. %package tools Summary: Example tools built using the librabbitmq package -Requires: %{name}%{?_isa} = %{version} +Requires: %{name}%{?_isa} = %{version}-%{release} %description tools This package contains example tools built using %{name}. @@ -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,29 @@ make test %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 0.15.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Mon Jan 20 2025 Fedora Release Engineering - 0.15.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Thu Nov 21 2024 Remi Collet - 0.15.0-1 +- update to 0.15.0 + +* Thu Jul 18 2024 Fedora Release Engineering - 0.14.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Mar 26 2024 Remi Collet - 0.14.0-2 +- update to 0.14.0 +- drop upstream patch +- fix rpminspect rpmdeps + +* Thu Jan 25 2024 Fedora Release Engineering - 0.13.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 0.13.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Thu Jul 20 2023 Fedora Release Engineering - 0.13.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_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..0b05ed6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rabbitmq-c-0.13.0-974d71a.tar.gz) = 58b3ca777a971ac451edb75afb2446d4bf7611134387db6dadcc95ff1f44257eb1812ff665f658544e03e14622ccc6aacc26d03d1b30a16470ccb1977275bf34 +SHA512 (rabbitmq-c-0.15.0-84b81cd.tar.gz) = a3a1e4ac5f9126a905de7f15b0580a3562c626891aa634dd72e96264da1b87107f82ba6b865ba178d228e025c4a1df370c648d30a13d1422710b74b7ba38cbea diff --git a/tests/Sanity/Sanity-test-for-librabbitmq/main.fmf b/tests/Sanity/Sanity-test-for-librabbitmq/main.fmf new file mode 100644 index 0000000..a7116fe --- /dev/null +++ b/tests/Sanity/Sanity-test-for-librabbitmq/main.fmf @@ -0,0 +1,14 @@ +summary: tests basic functionality +description: '' +contact: Than Ngo +component: + - librabbitmq +test: ./runtest.sh +framework: beakerlib +recommend: + - librabbitmq + - librabbitmq-devel + - objdump +duration: 5m +extra-summary: /CoreOS/librabbitmq/Sanity/Sanity-test-for-librabbitmq +extra-task: /CoreOS/librabbitmq/Sanity/Sanity-test-for-librabbitmq diff --git a/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh b/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh index 76ed9f6..43816cb 100755 --- a/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh +++ b/tests/Sanity/Sanity-test-for-librabbitmq/runtest.sh @@ -29,7 +29,6 @@ PACKAGES="librabbitmq librabbitmq-devel" # source the test script helpers -. /usr/bin/rhts-environment.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1 rlJournalStart @@ -47,7 +46,7 @@ rlJournalStart rlRun "objdump -T $o" 0 "validate the shared objects" done rlRun "head /usr/share/doc/librabbitmq-devel/README.md" 0 "correct form for doc file" - rlRun "head /usr/share/licenses/librabbitmq/LICENSE-MIT" 0 "correct form for doc file" + rlRun "head /usr/share/licenses/librabbitmq/LICENSE" 0 "correct form for doc file" rlPhaseEnd rlPhaseStartCleanup diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 96c2b94..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# Run tests in all contexts -- hosts: localhost - tags: - - classic - roles: - - role: standard-test-beakerlib - tests: - - Sanity - required_packages: - - librabbitmq