import rubygem-pg-1.5.4-4.el10

c10-beta imports/c10-beta/rubygem-pg-1.5.4-4.el10
MSVSphere Packaging Team 3 months ago
commit b744ec86eb
Signed by: sys_gitsync
GPG Key ID: B2B0B9F29E528FE8

2
.gitignore vendored

@ -0,0 +1,2 @@
SOURCES/pg-1.5.4-spec.tar.gz
SOURCES/pg-1.5.4.gem

@ -0,0 +1,2 @@
9802fe4e66ed86f5881692181a48d48ec137eb93 SOURCES/pg-1.5.4-spec.tar.gz
b4ff1dfd1a5b2c269d402d1c21380074c25afa6a SOURCES/pg-1.5.4.gem

@ -0,0 +1,17 @@
diff --git a/ext/extconf.rb b/ext/extconf.rb
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -54,13 +54,6 @@ else
dlldir = libdir
end
- # Try to use runtime path linker option, even if RbConfig doesn't know about it.
- # The rpath option is usually set implicit by dir_config(), but so far not
- # on MacOS-X.
- if dlldir && RbConfig::CONFIG["RPATHFLAG"].to_s.empty?
- append_ldflags "-Wl,-rpath,#{dlldir.quote}"
- end
-
if /mswin/ =~ RUBY_PLATFORM
$libs = append_library($libs, 'ws2_32')
end

@ -0,0 +1,33 @@
From 110665fa55292027e835f9d6bdfb3ed608b0a6ca Mon Sep 17 00:00:00 2001
From: Jarek Prokop <jprokop@redhat.com>
Date: Fri, 20 Oct 2023 17:52:11 +0200
Subject: [PATCH] Explicitly retype timespec fields to int64_t to fix
compatibility with 32bit arches.
Timespec fields' time_t type is not guaranteed to be any particular integer.
Tests with binary timestamp conversion are failing on 32bit arches (e.g. intel x86)
until they are retyped into int64_t, which fixes the issue with encoding the Time instances.
Decoder doesn't need adjusting. It returns the correct time from the encoded binary representation.
Resolves: https://github.com/ged/ruby-pg/issues/545
---
ext/pg_binary_encoder.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ext/pg_binary_encoder.c b/ext/pg_binary_encoder.c
index e074a85..df45676 100644
--- a/ext/pg_binary_encoder.c
+++ b/ext/pg_binary_encoder.c
@@ -185,7 +185,7 @@ pg_bin_enc_timestamp(t_pg_coder *this, VALUE value, char *out, VALUE *intermedia
ts = rb_time_timespec(*intermediate);
/* PostgreSQL's timestamp is based on year 2000 and Ruby's time is based on 1970.
* Adjust the 30 years difference. */
- timestamp = (ts.tv_sec - 10957L * 24L * 3600L) * 1000000 + (ts.tv_nsec / 1000);
+ timestamp = ((int64_t)ts.tv_sec - 10957L * 24L * 3600L) * 1000000 + ((int64_t)ts.tv_nsec / 1000);
if( this->flags & PG_CODER_TIMESTAMP_DB_LOCAL ) {
/* send as local time */
--
2.42.0

@ -0,0 +1,75 @@
From fb3fba9eac65291b20f22eb956f02490d62de3ec Mon Sep 17 00:00:00 2001
From: Lars Kanis <kanis@comcard.de>
Date: Thu, 19 Oct 2023 18:32:31 +0200
Subject: [PATCH] Fix possible buffer overflows on 32 bit systems
Comparing pointers after adding lengths is dangerous, since the length can overflow the pointer, so that the comparison leads to wrong results.
Comparing lengths only fixes this issue.
This lead to segfault in the following spec on x86:
it "should raise an error at grabage COPY format" do
expect{ decoder.decode("123\t \0\\\t\\") }
.to raise_error(ArgumentError, /premature.*at position: 7$/)
end
---
ext/pg_copy_coder.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ext/pg_copy_coder.c b/ext/pg_copy_coder.c
index 16d5c15..f2fe029 100644
--- a/ext/pg_copy_coder.c
+++ b/ext/pg_copy_coder.c
@@ -795,26 +795,26 @@ pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tupl
cur_ptr = input_line;
line_end_ptr = input_line + len;
- if (cur_ptr + 11 <= line_end_ptr && memcmp(cur_ptr, BinarySignature, 11) == 0){
+ if (line_end_ptr - cur_ptr >= 11 && memcmp(cur_ptr, BinarySignature, 11) == 0){
/* binary COPY header signature detected -> just drop it */
int ext_bytes;
cur_ptr += 11;
/* read flags */
- if (cur_ptr + 4 > line_end_ptr) goto length_error;
+ if (line_end_ptr - cur_ptr < 4 ) goto length_error;
cur_ptr += 4;
/* read header extensions */
- if (cur_ptr + 4 > line_end_ptr) goto length_error;
+ if (line_end_ptr - cur_ptr < 4 ) goto length_error;
ext_bytes = read_nbo32(cur_ptr);
if (ext_bytes < 0) goto length_error;
cur_ptr += 4;
- if (cur_ptr + ext_bytes > line_end_ptr) goto length_error;
+ if (line_end_ptr - cur_ptr < ext_bytes ) goto length_error;
cur_ptr += ext_bytes;
}
/* read row header */
- if (cur_ptr + 2 > line_end_ptr) goto length_error;
+ if (line_end_ptr - cur_ptr < 2 ) goto length_error;
nfields = read_nbo16(cur_ptr);
cur_ptr += 2;
@@ -830,7 +830,7 @@ pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tupl
VALUE field_value;
/* read field size */
- if (cur_ptr + 4 > line_end_ptr) goto length_error;
+ if (line_end_ptr - cur_ptr < 4 ) goto length_error;
input_len = read_nbo32(cur_ptr);
cur_ptr += 4;
@@ -839,7 +839,7 @@ pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tupl
/* NULL indicator */
rb_ary_push(array, Qnil);
} else {
- if (cur_ptr + input_len > line_end_ptr) goto length_error;
+ if (line_end_ptr - cur_ptr < input_len ) goto length_error;
/* copy input data to field_str */
PG_RB_STR_ENSURE_CAPA( field_str, input_len, output_ptr, end_capa_ptr );
--
2.42.0

@ -0,0 +1,334 @@
# Generated from pg-0.11.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name pg
Name: rubygem-%{gem_name}
Version: 1.5.4
Release: 4%{?dist}
Summary: A Ruby interface to the PostgreSQL RDBMS
License: (BSD-2-Clause OR Ruby) AND PostgreSQL
URL: https://github.com/ged/ruby-pg
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone --no-checkout https://github.com/ged/ruby-pg.git
# git -C ruby-pg archive -v -o pg-1.5.4-spec.tar.gz v1.5.4 spec/
Source1: %{gem_name}-%{version}-spec.tar.gz
# Disable RPATH.
# https://github.com/ged/ruby-pg/issues/183
Patch0: rubygem-pg-1.3.0-remove-rpath.patch
# Fix integer arithmetic on timespec struct fields on 32bit systems.
# The time_t type that is the type of timespec struct fields is not guaranteed
# to be any particular size or type. Therefore we need to explicitly retype
# to avoid buffer {over,under}flow.
# See `man 3 timespec` and `man 3 time_t` for further reference.
# https://github.com/ged/ruby-pg/issues/545
# https://github.com/ged/ruby-pg/pull/547
Patch1: rubygem-pg-1.5.4-Explicitly-retype-timespec-fields-to-int64_t.patch
# Fix possible buffer overflows.
# Found when upstream was investigating the following issue:
# https://github.com/ged/ruby-pg/issues/545
# https://github.com/ged/ruby-pg/pull/548
Patch2: rubygem-pg-1.5.4-Fix-possible-buffer-overflows-on-32-bit-systems.patch
# ext/pg_text_decoder.c
Requires: rubygem(bigdecimal)
# lib/pg/text_{de,en}coder.rb
Requires: rubygem(json)
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
# Compiler is required for build of gem binary extension.
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
BuildRequires: gcc
BuildRequires: postgresql-server libpq-devel
BuildRequires: rubygem(bigdecimal)
BuildRequires: rubygem(rspec)
%description
This is the extension library to access a PostgreSQL database from Ruby.
This library works with PostgreSQL 9.3 and later.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
%patch 0 -p1
%patch 1 -p1
%patch 2 -p1
%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{gem_extdir_mri}
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
# Prevent dangling symlink in -debuginfo (rhbz#878863).
rm -rf %{buildroot}%{gem_instdir}/ext/
%check
pushd .%{gem_instdir}
ln -s %{_builddir}/spec .
# Set --verbose to show detail log by $VERBOSE.
# See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE
# Assign a random port to consider a case of multi builds in parallel in a host.
# https://github.com/ged/ruby-pg/pull/39
if ! PGPORT="$((54321 + ${RANDOM} % 1000))" ruby -S --verbose \
rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec; then
echo "==== [setup.log start ] ===="
cat tmp_test_specs/setup.log
echo "==== [setup.log end ] ===="
false
fi
popd
%files
%dir %{gem_instdir}
%{gem_extdir_mri}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/BSDL
%license %{gem_instdir}/LICENSE
%license %{gem_instdir}/POSTGRES
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/Contributors.rdoc
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/History.md
%doc %{gem_instdir}/Manifest.txt
%doc %{gem_instdir}/README-OS_X.rdoc
%doc %{gem_instdir}/README-Windows.rdoc
%lang(ja) %doc %{gem_instdir}/README.ja.md
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile*
%{gem_instdir}/rakelib/*
%{gem_instdir}/certs
%{gem_instdir}/misc
%{gem_instdir}/pg.gemspec
%{gem_instdir}/sample
# The translations are only related to README and the readme is already in
# japanese (AFAICT) when we build an RPM from the gem, so we shouldn't need
# this directory at all.
# https://github.com/ged/ruby-pg/pull/549
%exclude %{gem_instdir}/translation
%changelog
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.5.4-4
- Bump release for June 2024 mass rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jan 03 2024 Vít Ondruch <vondruch@redhat.com> - 1.5.4-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_3.3
* Mon Oct 23 2023 Jarek Prokop <jprokop@redhat.com> - 1.5.4-1
- Upgrade to pg 1.5.4.
Resolves: rhbz#2173399
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Jan 03 2023 Vít Ondruch <vondruch@redhat.com> - 1.4.5-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_3.2
* Thu Dec 15 2022 Vít Ondruch <vondruch@redhat.com> - 1.4.5-1
- Update to pg 1.4.5.
Resolves: rhbz#2099059
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Thu May 12 2022 Jarek Prokop <jprokop@redhat.com> - 1.3.5-1
- Update to pg 1.3.5.
Resolves: rhbz#1814862
* Thu Feb 17 2022 Pavel Valena <pvalena@redhat.com> - 1.3.2-1
- Update to pg 1.3.2.
Resolves: rhbz#1814862
* Fri Jan 28 2022 Vít Ondruch <vondruch@redhat.com> - 1.3.0-1
- Update to pg 1.3.0.
Resolves: rhbz#1814862
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Feb 08 2021 Pavel Raiskup <praiskup@redhat.com> - 1.2.3-5
- rebuild for libpq ABI fix rhbz#1908268
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jan 6 2021 Vít Ondruch <vondruch@redhat.com> - 1.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_3.0
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Mar 19 2020 Jun Aruga <jaruga@redhat.com> - 1.2.3-1
- Update to pg 1.2.3.
* Fri Mar 06 2020 Jun Aruga <jaruga@redhat.com> - 1.2.2-1
- Update to pg 1.2.2.
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jan 17 2020 Vít Ondruch <vondruch@redhat.com> - 1.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.7
* Mon Jan 06 2020 Jun Aruga <jaruga@redhat.com> - 1.2.1-1
- Update to pg 1.2.1.
* Thu Jan 02 2020 Jun Aruga <jaruga@redhat.com> - 1.2.0-1
- Update to pg 1.2.0.
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jan 17 2019 Vít Ondruch <vondruch@redhat.com> - 1.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.6
* Thu Jan 10 2019 Vít Ondruch <vondruch@redhat.com> - 1.1.4-1
- Update to pg 1.1.4.
* Wed Jan 09 2019 Vít Ondruch <vondruch@redhat.com> - 1.1.3-2
- Fix PostgreSQL 11 compatibility.
* Tue Sep 18 2018 Jun Aruga <jaruga@redhat.com> - 1.1.3-1
- Update to pg 1.1.3.
- Update to output log when tests fail.
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Feb 13 2018 Vít Ondruch <vondruch@redhat.com> - 1.0.0-1
- Update to pg 1.0.0.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 0.21.0-4
- Rebuilt for switch to libxcrypt
* Thu Jan 04 2018 Vít Ondruch <vondruch@redhat.com> - 0.21.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.5
* Fri Dec 08 2017 Jun Aruga <jaruga@redhat.com> - 0.21.0-2
- Fix failed tests for PostgreSQL-10.
* Thu Aug 17 2017 Vít Ondruch <vondruch@redhat.com> - 0.21.0-1
- Update to pg 0.21.0.
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon May 29 2017 Vít Ondruch <vondruch@redhat.com> - 0.20.0-1
- Update to pg 0.20.0.
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sun Jan 15 2017 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.18.4-3
- F-26: rebuild for ruby24
- Patch from the upstream for test failure with integer unification
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jan 06 2016 Vít Ondruch <vondruch@redhat.com> - 0.18.4-1
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
- Update to pg 0.18.4.
* Wed Aug 26 2015 Vít Ondruch <vondruch@redhat.com> - 0.18.2-1
- Update to pg 0.18.2.
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Jan 16 2015 Vít Ondruch <vondruch@redhat.com> - 0.18.1-1
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.2
- Update to pg 0.18.1.
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Tue Apr 15 2014 Vít Ondruch <vondruch@redhat.com> - 0.17.1-1
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1
- Update to pg 0.17.1.
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Thu Mar 07 2013 Vít Ondruch <vondruch@redhat.com> - 0.14.1-1
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
- Update to pg 0.14.1.
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Tue Feb 07 2012 Vít Ondruch <vondruch@redhat.com> - 0.12.2-2
- Obsolete ruby-postgress, which was retired.
* Tue Jan 24 2012 Vít Ondruch <vondruch@redhat.com> - 0.12.2-1
- Rebuilt for Ruby 1.9.3.
- Upgrade to pg 0.12.2.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Fri Jun 03 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-5
- Pass CFLAGS to extconf.rb.
* Fri Jun 03 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-4
- Binary extension moved into ruby_sitearch dir.
- -doc subpackage made architecture independent.
* Wed Jun 01 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-3
- Quoted upstream license clarification.
* Mon May 30 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-2
- Removed/fixed shebang in non-executables.
- Removed sources.
* Thu May 26 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-1
- Initial package
Loading…
Cancel
Save