diff --git a/ruby-shadow-2.5.0-cflags.patch b/ruby-shadow-2.5.0-cflags.patch deleted file mode 100644 index 7f74b84201ab56645ca9321bbfdee59d27f0f7b5..0000000000000000000000000000000000000000 --- a/ruby-shadow-2.5.0-cflags.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- extconf.rb~ 2017-10-05 20:21:59.480315863 +0200 -+++ extconf.rb 2017-10-05 20:23:55.077931560 +0200 -@@ -6,12 +6,7 @@ - - require 'mkmf' - require 'rbconfig' -- --$CFLAGS = case RUBY_VERSION -- when /^1\.9/; '-DRUBY19' -- when /^2\./; '-DRUBY19' -- else; '' -- end -+$CFLAGS = "#{$CFLAGS} -DRUBY19" - - implementation = case CONFIG['host_os'] - when /linux/i; 'shadow' diff --git a/ruby-shadow-2.5.0.gem b/ruby-shadow-2.5.0.gem deleted file mode 100644 index 9ec761df5ad428b645487ebf5cd0768d16c7b2b8..0000000000000000000000000000000000000000 Binary files a/ruby-shadow-2.5.0.gem and /dev/null differ diff --git a/ruby-shadow-2.5.1-cflags.patch b/ruby-shadow-2.5.1-cflags.patch new file mode 100644 index 0000000000000000000000000000000000000000..830334d6b2384e9819754f4082a45af2e1eae596 --- /dev/null +++ b/ruby-shadow-2.5.1-cflags.patch @@ -0,0 +1,11 @@ +--- ruby-shadow-2.5.1/extconf.rb.orig 2022-11-30 15:03:24.946310154 +0900 ++++ ruby-shadow-2.5.1/extconf.rb 2022-11-30 15:04:27.984276887 +0900 +@@ -7,7 +7,7 @@ + require 'mkmf' + require 'rbconfig' + +-$CFLAGS = case RUBY_VERSION ++$CFLAGS = "#{$CFLAGS} " + case RUBY_VERSION + when /^1\.9/; '-DRUBY19' + when /^2\./; '-DRUBY19' + when /^3\./; '-DRUBY19 -DRUBY30' diff --git a/ruby-shadow-2.5.1-extconf-ruby32-fix.patch b/ruby-shadow-2.5.1-extconf-ruby32-fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..5acb033a56009cbdde5bea13f92c6e190932409d --- /dev/null +++ b/ruby-shadow-2.5.1-extconf-ruby32-fix.patch @@ -0,0 +1,13 @@ +diff --git a/extconf.rb b/extconf.rb +index d17f926..55dcff5 100644 +--- a/extconf.rb ++++ b/extconf.rb +@@ -14,7 +14,7 @@ $CFLAGS = case RUBY_VERSION + else; '' + end + +-implementation = case CONFIG['host_os'] ++implementation = case RbConfig::CONFIG['host_os'] + when /linux/i; 'shadow' + when /sunos|solaris/i; 'shadow' + when /freebsd|mirbsd|netbsd|openbsd/i; 'pwd' diff --git a/ruby-shadow-2.5.1-taintedness-ruby32-removal.patch b/ruby-shadow-2.5.1-taintedness-ruby32-removal.patch new file mode 100644 index 0000000000000000000000000000000000000000..756356e97ba5e4ff6635bd5554b1215dfeaded38 --- /dev/null +++ b/ruby-shadow-2.5.1-taintedness-ruby32-removal.patch @@ -0,0 +1,61 @@ +diff --git a/extconf.rb b/extconf.rb +index d17f926..04f8f97 100644 +--- a/extconf.rb ++++ b/extconf.rb +@@ -10,7 +10,7 @@ require 'rbconfig' + $CFLAGS = case RUBY_VERSION + when /^1\.9/; '-DRUBY19' + when /^2\./; '-DRUBY19' +- when /^3\./; '-DRUBY19' ++ when /^3\./; '-DRUBY19 -DRUBY30' + else; '' + end + +diff --git a/pwd/shadow.c b/pwd/shadow.c +index eeb96d4..e73e0db 100644 +--- a/pwd/shadow.c ++++ b/pwd/shadow.c +@@ -56,8 +56,13 @@ static VALUE convert_pw_struct( struct passwd *entry ) + { + /* Hmm. Why custom pw_change instead of sp_lstchg? */ + return rb_struct_new(rb_sPasswdEntry, ++#if defined(RUBY30) ++ rb_str_new2(entry->pw_name), /* sp_namp */ ++ rb_str_new2(entry->pw_passwd), /* sp_pwdp, encryped password */ ++#else + rb_tainted_str_new2(entry->pw_name), /* sp_namp */ + rb_tainted_str_new2(entry->pw_passwd), /* sp_pwdp, encryped password */ ++#endif + Qnil, /* sp_lstchg, date when the password was last changed (in days since Jan 1, 1970) */ + Qnil, /* sp_min, days that password must stay same */ + Qnil, /* sp_max, days until password changes. */ +@@ -66,7 +71,11 @@ static VALUE convert_pw_struct( struct passwd *entry ) + INT2FIX(difftime(entry->pw_change, 0) / (24*60*60)), /* pw_change */ + INT2FIX(difftime(entry->pw_expire, 0) / (24*60*60)), /* sp_expire */ + Qnil, /* sp_flag */ ++#if defined(RUBY30) ++ rb_str_new2(entry->pw_class), /* sp_loginclass, user access class */ ++#else + rb_tainted_str_new2(entry->pw_class), /* sp_loginclass, user access class */ ++#endif + NULL); + } + +diff --git a/shadow/shadow.c b/shadow/shadow.c +index 35a77a1..5202ce5 100644 +--- a/shadow/shadow.c ++++ b/shadow/shadow.c +@@ -34,8 +34,13 @@ static VALUE rb_eFileLock; + static VALUE convert_pw_struct( struct spwd *entry ) + { + return rb_struct_new(rb_sPasswdEntry, ++#if defined(RUBY30) ++ rb_str_new2(entry->sp_namp), ++ rb_str_new2(entry->sp_pwdp), ++#else + rb_tainted_str_new2(entry->sp_namp), + rb_tainted_str_new2(entry->sp_pwdp), ++#endif + INT2FIX(entry->sp_lstchg), + INT2FIX(entry->sp_min), + INT2FIX(entry->sp_max), diff --git a/ruby-shadow-2.5.1.gem b/ruby-shadow-2.5.1.gem new file mode 100644 index 0000000000000000000000000000000000000000..031346f7c534ad6b7d182282a2aef1b7b28de1f5 Binary files /dev/null and b/ruby-shadow-2.5.1.gem differ diff --git a/rubygem-ruby-shadow.spec b/rubygem-ruby-shadow.spec index e768354425bd00ab9d8ad17d0ba406302e59a7bf..a476ed8cde9a40dee11d9b48b96f8eb057807001 100644 --- a/rubygem-ruby-shadow.spec +++ b/rubygem-ruby-shadow.spec @@ -1,13 +1,15 @@ %global gem_name ruby-shadow Name: rubygem-%{gem_name} -Version: 2.5.0 +Version: 2.5.1 Release: 1 Summary: Ruby shadow password module License: Public Domain URL: https://github.com/apalmblad/ruby-shadow Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: https://raw.githubusercontent.com/apalmblad/ruby-shadow/master/test/basic_test.rb -Patch0: ruby-shadow-2.5.0-cflags.patch +Patch0: ruby-shadow-2.5.1-cflags.patch +Patch1: ruby-shadow-2.5.1-taintedness-ruby32-removal.patch +Patch2: ruby-shadow-2.5.1-extconf-ruby32-fix.patch BuildRequires: gcc ruby(release) rubygems-devel ruby-devel rubygem(minitest) BuildRequires: rubygem(test-unit) Obsoletes: ruby-shadow < 1.4.1-36 @@ -27,11 +29,13 @@ Documentation for %{name}. gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec -%patch0 -p0 +%patch1 -p1 +%patch2 -p1 +%patch0 -p1 cp %{SOURCE1} . %build -export CONFIGURE_ARGS="--with-cflags='%{optflags}'" +export CONFIGURE_ARGS="--with-cflags='%{optflags} -Werror=implicit-function-declaration'" gem build %{gem_name}.gemspec %gem_install @@ -70,5 +74,8 @@ popd %doc %{gem_instdir}/README.euc %changelog +* Tue Aug 01 2023 wulei - 2.5.1-1 +- Update to 2.5.1 + * Tue Jul 28 2020 shaoqiang kang - 2.5.0-1 - Package init