Compare commits

...

No commits in common. 'c9' and 'c10-beta' have entirely different histories.
c9 ... c10-beta

2
.gitignore vendored

@ -1 +1 @@
SOURCES/rabbitmq-c-0.11.0-a64c08c.tar.gz
SOURCES/rabbitmq-c-0.14.0-124722b.tar.gz

@ -1 +1 @@
e7821abf0fac22b7e6505f01943e64b16d9de2ab SOURCES/rabbitmq-c-0.11.0-a64c08c.tar.gz
0750fe988794a1a149eaa35de6d621a7e9d06fd5 SOURCES/rabbitmq-c-0.14.0-124722b.tar.gz

@ -1,125 +0,0 @@
commit 463054383fbeef889b409a7f843df5365288e2a0
Author: Christian Kastner <ckk@kvr.at>
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");

@ -1,41 +0,0 @@
From a8c05cb16afbf852fc584f2c2d31d2f7f0e3a48d Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 1 Apr 2021 11:21:36 +0200
Subject: [PATCH] add option to install or not the static library
---
CMakeLists.txt | 1 +
librabbitmq/CMakeLists.txt | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9a29fdd..a7cf8f2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -245,6 +245,7 @@ endif()
option(BUILD_SHARED_LIBS "Build rabbitmq-c as a shared library" ON)
option(BUILD_STATIC_LIBS "Build rabbitmq-c as a static library" ON)
+option(INSTALL_STATIC_LIBS "Install rabbitmq-c static library" ON)
option(BUILD_EXAMPLES "Build Examples" ON)
option(BUILD_TOOLS "Build Tools (requires POPT Library)" ${POPT_FOUND})
diff --git a/librabbitmq/CMakeLists.txt b/librabbitmq/CMakeLists.txt
index d8dcd262..72b4a875 100644
--- a/librabbitmq/CMakeLists.txt
+++ b/librabbitmq/CMakeLists.txt
@@ -154,9 +154,11 @@ if (BUILD_STATIC_LIBS)
set_target_properties(rabbitmq-static PROPERTIES VERSION ${RMQ_VERSION} SOVERSION ${RMQ_SOVERSION} OUTPUT_NAME rabbitmq)
endif (WIN32)
- install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- )
+ if (INSTALL_STATIC_LIBS)
+ install(TARGETS rabbitmq-static EXPORT "${targets_export_name}"
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+ endif (INSTALL_STATIC_LIBS)
if (NOT DEFINED RMQ_LIBRARY_TARGET)
set(RMQ_LIBRARY_TARGET rabbitmq-static)

@ -1,25 +0,0 @@
From 2a9ae303f7fa7bc115ecb827c1c3c7c9f84558dd Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Thu, 1 Apr 2021 14:48:25 +0200
Subject: [PATCH] Fix #666 bad PACKAGE_VERSION
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9a29fd..74364cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -322,7 +322,7 @@ set(version_config "${CMAKE_CURRENT_BINARY_DIR}/rabbitmq-c-config-version.cmake"
write_basic_package_version_file(
"${version_config}"
- VERSION ${RMQ_VERSION}
+ VERSION ${VERSION}
COMPATIBILITY AnyNewerVersion)
configure_package_config_file(
--
2.30.2

@ -1,7 +1,7 @@
# Fedora spec file for librabbitmq
#
# Copyright (c) 2012-2021 Remi Collet
# License: CC-BY-SA
# Copyright (c) 2012-2023 Remi Collet
# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@ -9,7 +9,7 @@
%bcond_without tests
%global gh_commit a64c08c68aff34d49a2ac152f04988cd921084f9
%global gh_commit 124722b5045baa41a24ce2e2d7c52a47467e7ac0
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner alanxz
%global gh_project rabbitmq-c
@ -18,25 +18,18 @@
Name: %{libname}
Summary: Client library for AMQP
Version: 0.11.0
Release: 7%{?dist}
Version: 0.14.0
Release: 2%{?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
# don't install static library
Patch0: %{gh_project}-static.patch
# fix version for cmake module
Patch1: %{gh_project}-version.patch
# CVE-2023-35789
Patch2: rabbitmq-c-CVE-2023-35789.patch
BuildRequires: gcc
BuildRequires: cmake > 2.8
BuildRequires: openssl-devel
BuildRequires: cmake >= 3.12
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
@ -73,9 +66,6 @@ amqp-publish Publish a message on an AMQP server
%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
# Copy sources to be included in -devel docs.
cp -pr examples Examples
@ -87,11 +77,13 @@ sed -e '/test_basic/d' -i tests/CMakeLists.txt
%build
# static lib required for tests
%cmake \
-DBUILD_TOOLS:BOOL=ON \
-DBUILD_TOOLS_DOCS:BOOL=ON \
-DENABLE_SSL_ENGINE_API:BOOL=OFF \
%if %{with tests}
-DINSTALL_STATIC_LIBS:BOOL=OFF \
%else
-DBUILD_TESTS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_STATIC_LIBS:BOOL=OFF \
%endif
-S .
@ -114,9 +106,11 @@ make install DESTDIR="%{buildroot}"
%check
: check .pc is usable
grep @ %{buildroot}%{_libdir}/pkgconfig/librabbitmq.pc && exit 1
grep %{version} %{buildroot}%{_libdir}/pkgconfig/librabbitmq.pc || exit 1
: check cmake files are usable
grep static %{buildroot}%{_libdir}/cmake/rabbitmq-c/*.cmake && exit 1
%if %{with tests}
: upstream tests
%if 0%{?ctest:1}
@ -130,15 +124,17 @@ make test
%files
%license LICENSE-MIT
%{_libdir}/%{libname}.so.%{soname}*
%license LICENSE
%{_libdir}/%{libname}.so.%{soname}
%{_libdir}/%{libname}.so.%{version}
%files devel
%doc AUTHORS THANKS TODO *.md
%doc AUTHORS THANKS *.md
%doc Examples
%{_libdir}/%{libname}.so
%{_includedir}/amqp*
%{_includedir}/rabbitmq-c
%{_libdir}/pkgconfig/%{libname}.pc
%{_libdir}/cmake/rabbitmq-c
@ -149,24 +145,56 @@ make test
%changelog
* Fri Jun 23 2023 Than Ngo <than@redhat.com> - 0.11.0-7
- add missing gating.yaml
- fix rpminspect issue
Related: #2215766
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 0.14.0-2
- Bump release for June 2024 mass rebuild
* Wed Apr 03 2024 Than Ngo <than@redhat.com> - 0.14.0-1
- update to 0.14.0
- fix rpminspect rpmdeps
- fix gating-yaml-checks
Related: RHEL-31259
* Tue Apr 02 2024 Than Ngo <than@redhat.com> - 0.13.0-6
- Resolves: RHEL-31259, Conditionally enable SSL engine APIs
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu Jun 29 2023 Than Ngo <than@redhat.com> - 0.13.0-2
- fix security issue, CVE-2023-35789
* Mon Feb 6 2023 Remi Collet <remi@remirepo.net> - 0.13.0-1
- update to 0.13.0
- drop patches merged upstream
* Wed Feb 1 2023 Remi Collet <remi@remirepo.net> - 0.12.0-1
- update to 0.12.0
- add patch to not install the static library, from
https://github.com/alanxz/rabbitmq-c/pull/749
- add patch to fix version in pkgconfig file, from
https://github.com/alanxz/rabbitmq-c/pull/751
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Jun 23 2023 Than Ngo <than@redhat.com> - 0.11.0-6
- Resolves: #2215766, insecure credentials submission
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jun 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-4
- Rebuilt for RHEL 9 BETA for openssl 3.0
Related: rhbz#1971065
* Tue Sep 14 2021 Sahana Prasad <sahana@redhat.com> - 0.11.0-4
- Rebuilt with OpenSSL 3.0.0
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.11.0-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Thu Apr 1 2021 Remi Collet <remi@remirepo.net> - 0.11.0-2
- add patch to fix version in cmake file from

Loading…
Cancel
Save