update to 1.4.2

This commit is contained in:
jxy_git 2022-03-03 15:22:49 +08:00
parent 92bb303c21
commit 82590f4af9
4 changed files with 12 additions and 119 deletions

View File

@ -1,108 +0,0 @@
diff -Nur a/ext/sqlite3/database.c b/ext/sqlite3/database.c
--- a/ext/sqlite3/database.c 2022-01-27 14:30:56.122375149 +0800
+++ b/ext/sqlite3/database.c 2022-01-27 14:30:45.214194939 +0800
@@ -57,7 +57,9 @@
rb_scan_args(argc, argv, "12", &file, &opts, &zvfs);
#if defined StringValueCStr
StringValuePtr(file);
+#if defined TAINTING_SUPPORT
rb_check_safe_obj(file);
+#endif
#else
Check_SafeStr(file);
#endif
@@ -307,7 +309,7 @@
return rb_float_new(sqlite3_value_double(val));
break;
case SQLITE_TEXT:
- return rb_tainted_str_new2((const char *)sqlite3_value_text(val));
+ return rb_str_new2((const char *)sqlite3_value_text(val));
break;
case SQLITE_BLOB: {
/* Sqlite warns calling sqlite3_value_bytes may invalidate pointer from sqlite3_value_blob,
@@ -317,7 +319,7 @@
*/
int len = sqlite3_value_bytes(val);
#ifdef HAVE_RUBY_ENCODING_H
- return rb_tainted_str_new((const char *)sqlite3_value_blob(val), len);
+ return rb_str_new((const char *)sqlite3_value_blob(val), len);
#else
/* When encoding is not available, make it class SQLite3::Blob. */
VALUE strargv[1];
diff -Nur a/ext/sqlite3/extconf.rb b/ext/sqlite3/extconf.rb
--- a/ext/sqlite3/extconf.rb 2022-01-27 14:30:56.122375149 +0800
+++ b/ext/sqlite3/extconf.rb 2022-01-27 14:29:34.125020499 +0800
@@ -33,6 +33,10 @@
$CFLAGS << ' -W3'
end
+if RUBY_VERSION < '2.7'
+ $CFLAGS << ' -DTAINTING_SUPPORT'
+end
+
def asplode missing
if RUBY_PLATFORM =~ /mingw|mswin/
abort "#{missing} is missing. Install SQLite3 from " +
diff -Nur a/ext/sqlite3/statement.c b/ext/sqlite3/statement.c
--- a/ext/sqlite3/statement.c 2022-01-27 14:30:56.126375215 +0800
+++ b/ext/sqlite3/statement.c 2022-01-27 14:29:34.125020499 +0800
@@ -148,7 +148,7 @@
break;
case SQLITE_TEXT:
{
- VALUE str = rb_tainted_str_new(
+ VALUE str = rb_str_new(
(const char *)sqlite3_column_text(stmt, i),
(long)sqlite3_column_bytes(stmt, i)
);
@@ -162,7 +162,7 @@
break;
case SQLITE_BLOB:
{
- VALUE str = rb_tainted_str_new(
+ VALUE str = rb_str_new(
(const char *)sqlite3_column_blob(stmt, i),
(long)sqlite3_column_bytes(stmt, i)
);
diff -Nur a/test/test_integration_resultset.rb b/test/test_integration_resultset.rb
--- a/test/test_integration_resultset.rb 2022-01-27 14:30:56.134375348 +0800
+++ b/test/test_integration_resultset.rb 2022-01-27 14:29:34.125020499 +0800
@@ -105,23 +105,6 @@
assert_equal hash[1], "foo"
end
- def test_tainted_results_as_hash
- @db.results_as_hash = true
- @result.reset( 1 )
- row = @result.next
- row.each do |_, v|
- assert(v.tainted?) if String === v
- end
- end
-
- def test_tainted_row_values
- @result.reset( 1 )
- row = @result.next
- row.each do |v|
- assert(v.tainted?) if String === v
- end
- end
-
def test_each
called = 0
@result.reset( 1, 2 )
diff -Nur a/test/test_statement.rb b/test/test_statement.rb
--- a/test/test_statement.rb 2022-01-27 14:30:56.138375414 +0800
+++ b/test/test_statement.rb 2022-01-27 14:29:34.125020499 +0800
@@ -190,11 +190,6 @@
assert_equal ['foo'], r
end
- def test_tainted
- r = @stmt.step
- assert r.first.tainted?
- end
-
def test_step_twice
assert_not_nil @stmt.step
assert !@stmt.done?

View File

@ -1,12 +1,11 @@
%global gem_name sqlite3 %global gem_name sqlite3
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 1.3.13 Version: 1.4.2
Release: 2 Release: 1
Summary: Allows Ruby scripts to interface with a SQLite3 database Summary: Allows Ruby scripts to interface with a SQLite3 database
License: BSD License: BSD
URL: https://github.com/sparklemotion/sqlite3-ruby URL: https://github.com/sparklemotion/sqlite3-ruby
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Patch0: Remove-deprecated-taint-followup.patch
BuildRequires: ruby(release) rubygems-devel ruby-devel sqlite-devel rubygem(minitest) >= 5.0.0 BuildRequires: ruby(release) rubygems-devel ruby-devel sqlite-devel rubygem(minitest) >= 5.0.0
BuildRequires: gcc BuildRequires: gcc
%description %description
@ -22,13 +21,10 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%prep %prep
gem unpack %{SOURCE0} %setup -q -n %{gem_name}-%{version}
%setup -q -D -T -n %{gem_name}-%{version}
%patch0 -p1
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build %build
gem build %{gem_name}.gemspec gem build ../%{gem_name}-%{version}.gemspec
%gem_install %gem_install
%install %install
@ -47,6 +43,7 @@ popd
%files %files
%dir %{gem_instdir} %dir %{gem_instdir}
%{gem_extdir_mri} %{gem_extdir_mri}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/LICENSE %license %{gem_instdir}/LICENSE
%{gem_libdir} %{gem_libdir}
%exclude %{gem_cache} %exclude %{gem_cache}
@ -58,15 +55,19 @@ popd
%doc %{gem_instdir}/CHANGELOG.rdoc %doc %{gem_instdir}/CHANGELOG.rdoc
%doc %{gem_instdir}/ChangeLog.cvs %doc %{gem_instdir}/ChangeLog.cvs
%doc %{gem_instdir}/Manifest.txt %doc %{gem_instdir}/Manifest.txt
%{gem_instdir}/Rakefile
%{gem_instdir}/Gemfile %{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.rdoc %doc %{gem_instdir}/README.rdoc
%doc %{gem_instdir}/faq/ %{gem_instdir}/Rakefile
%{gem_instdir}/appveyor.yml
%doc %{gem_instdir}/faq
%{gem_instdir}/rakelib
%{gem_instdir}/setup.rb %{gem_instdir}/setup.rb
%{gem_instdir}/tasks
%{gem_instdir}/test %{gem_instdir}/test
%changelog %changelog
* Thu Mar 03 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 1.4.2-1
- update to 1.4.2
* Thu Jan 27 2022 liyanan <liyanan32@huawei.com> - 1.3.13-2 * Thu Jan 27 2022 liyanan <liyanan32@huawei.com> - 1.3.13-2
- Remove deprecated taint followup - Remove deprecated taint followup

Binary file not shown.

BIN
sqlite3-1.4.2.gem Normal file

Binary file not shown.