summaryrefslogtreecommitdiff
path: root/dev-ruby/ruby-shadow
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-06 17:00:43 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-06 17:00:43 +0000
commit36ab3cd1ef5a1fcf019da2ad4d598d4a8b90d506 (patch)
tree8648eb9b08e9d94bd0939f1367d4738ae3b77193 /dev-ruby/ruby-shadow
parent334d7d1830a3556a4c5d62a0f8547e5eb40bc83e (diff)
gentoo auto-resync : 06:12:2023 - 17:00:43
Diffstat (limited to 'dev-ruby/ruby-shadow')
-rw-r--r--dev-ruby/ruby-shadow/Manifest4
-rw-r--r--dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32-taint.patch54
-rw-r--r--dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32.patch31
-rw-r--r--dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild16
4 files changed, 101 insertions, 4 deletions
diff --git a/dev-ruby/ruby-shadow/Manifest b/dev-ruby/ruby-shadow/Manifest
index 998306d50440..d380a2291d04 100644
--- a/dev-ruby/ruby-shadow/Manifest
+++ b/dev-ruby/ruby-shadow/Manifest
@@ -1,3 +1,5 @@
+AUX ruby-shadow-2.5.1-ruby32-taint.patch 2265 BLAKE2B 6fd9443e10f85578f22d17ae63728d19eec5b7823a147c3edcf7b3ddb4c9e1eb3adb6c4d78fd63e9914a695575bc29e7fd6929ca99d60a02a2fe7fa5d37a944a SHA512 6dc7211372537eb1f43f735c35e5241311b8b44b99cac1e3bd54fd0f74ceb5057cf519d3162a15224cad7851eb604e515978698a5b4466cabad15d13e757e3a1
+AUX ruby-shadow-2.5.1-ruby32.patch 1151 BLAKE2B 654a3776fdfdf9bfb5c3d431ac2709392483bc2f3f576c43855c458f1b69e224bff14975ffbb48c55866084b741beef7175738936ad06fe6dc770d91ce90cd1a SHA512 f56e3a94055b6c12ef3944662eaefd5f89193c6915a00820ee5ebe6ef9b6741a75b10465508af2f20939ea7b52a7e0f0710c83f320cfb9a7ea9434660dc717b4
DIST ruby-shadow-2.5.1.gem 11264 BLAKE2B 0371fbf8f01dd6907b26369c33e69bc11664282ce1005792cff70113b0a05bfe0ce0eddd15896a9c6bcc9de38671d73034414f354f34d2716fd4f9265d823cbf SHA512 401ba31f6f87b9b50597e3924c67ef9d0a8f566ea4649735caf59e2b706861babf9b3aa273b7c47ca1cc9c8b4fde79ab21d2e264cd7ba58041fe7b8f9fd87411
-EBUILD ruby-shadow-2.5.1.ebuild 520 BLAKE2B ec1f15c219e900dd105ceebec5665038da0c211f13655620ef53374d9da1b6cfd057eac0d66c45f1641e825cdcd6991458a3b92685b112dbe76bf47587637b9f SHA512 ef34e18fdf3a95a019824be29a67575305e030ef6cc485463a462be916b71f7cad901c1b2253e253a4560d4f3bf21b674f4a3f0ba20271ea7f22d4fc82d8126b
+EBUILD ruby-shadow-2.5.1.ebuild 661 BLAKE2B e2e873361d1225067889323749b301560ce2b83a8af71418728d2760eaffa767b90dea4cabac695a78296a45c1e634e9d190f538804250d76cd8d348b4340d0c SHA512 b6c5f8155184e83ee85c3d698ea37dd029bf086f2968b6508b5ccd2cac399602c36c01677e6a471131638853bb5b4384f1c6517796b341feb6f78b6f43259efa
MISC metadata.xml 348 BLAKE2B ea93f8284e10399b71c36f731411b2dd8dc21062add09b74199b8a0007270591e98f7a57c388cd54296cf2d34f450674336ee112c204ea476c401cc094b14ae2 SHA512 753e086ad25985267e80210e6bea514257e8b8c339b67aaafd1f6b444e4218aa72d7c176b2faf41cda705f1c6ce8ff162ed40c497092e65882c0790d690e9956
diff --git a/dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32-taint.patch b/dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32-taint.patch
new file mode 100644
index 000000000000..4c66e63fbb1a
--- /dev/null
+++ b/dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32-taint.patch
@@ -0,0 +1,54 @@
+From 70330521b99e84c8f7445c213dfde0768f45a690 Mon Sep 17 00:00:00 2001
+From: Michael Hashizume <michael.hashizume@puppet.com>
+Date: Thu, 20 Oct 2022 13:28:09 -0700
+Subject: [PATCH] Removes taint checking functions
+
+Taint checking has been completely removed from Ruby as of Ruby
+3.2.0. This commit removes taint checking functions from ruby-
+shadow.
+
+See https://bugs.ruby-lang.org/issues/16131
+---
+ pwd/shadow.c | 6 +++---
+ shadow/shadow.c | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/pwd/shadow.c b/pwd/shadow.c
+index eeb96d4..46313d4 100644
+--- a/pwd/shadow.c
++++ b/pwd/shadow.c
+@@ -56,8 +56,8 @@ static VALUE convert_pw_struct( struct passwd *entry )
+ {
+ /* Hmm. Why custom pw_change instead of sp_lstchg? */
+ return rb_struct_new(rb_sPasswdEntry,
+- rb_tainted_str_new2(entry->pw_name), /* sp_namp */
+- rb_tainted_str_new2(entry->pw_passwd), /* sp_pwdp, encryped password */
++ rb_str_new2(entry->pw_name), /* sp_namp */
++ rb_str_new2(entry->pw_passwd), /* sp_pwdp, encryped password */
+ 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 +66,7 @@ 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 */
+- rb_tainted_str_new2(entry->pw_class), /* sp_loginclass, user access class */
++ rb_str_new2(entry->pw_class), /* sp_loginclass, user access class */
+ NULL);
+ }
+
+diff --git a/shadow/shadow.c b/shadow/shadow.c
+index 35a77a1..9a2ae70 100644
+--- a/shadow/shadow.c
++++ b/shadow/shadow.c
+@@ -34,8 +34,8 @@ static VALUE rb_eFileLock;
+ static VALUE convert_pw_struct( struct spwd *entry )
+ {
+ return rb_struct_new(rb_sPasswdEntry,
+- rb_tainted_str_new2(entry->sp_namp),
+- rb_tainted_str_new2(entry->sp_pwdp),
++ rb_str_new2(entry->sp_namp),
++ rb_str_new2(entry->sp_pwdp),
+ INT2FIX(entry->sp_lstchg),
+ INT2FIX(entry->sp_min),
+ INT2FIX(entry->sp_max),
diff --git a/dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32.patch b/dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32.patch
new file mode 100644
index 000000000000..3cbcf4b088b3
--- /dev/null
+++ b/dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32.patch
@@ -0,0 +1,31 @@
+From eab4aba3f5e06ea8f124d3e5ff6b3fa88c4807cd Mon Sep 17 00:00:00 2001
+From: Mamoru TASAKA <mtasaka@fedoraproject.org>
+Date: Thu, 1 Dec 2022 12:23:05 +0900
+Subject: [PATCH] extconf.rb: use Rbconfig::CONFIG instead of mkmf CONFIG
+
+In mkmf.rb CONFIG is defined as CONFIG is defined as RbConfig::MAKEFILE_CONFIG
+and RbConfig::MAKEFILE_CONFIG is almost same as RbConfig::CONFIG
+except that RbConfig::MAKEFILE_CONFIG uses reference for other variables.
+
+Using CONFIG in extconf.rb causes error with ruby3.2 because now
+CONFIG['host_os'] uses reference for target_os variable, and extconf.rb
+expects that this variable is all expanded. So instead, use RbConfig::CONFIG .
+
+Closes #30
+---
+ extconf.rb | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/extconf.rb b/extconf.rb
+index d17f926..55dcff5 100644
+--- a/extconf.rb
++++ b/extconf.rb
+@@ -14,7 +14,7 @@
+ 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/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild b/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild
index ef081802042c..a1d3d469c90a 100644
--- a/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild
+++ b/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-USE_RUBY="ruby26 ruby27 ruby30 ruby31"
+USE_RUBY="ruby31 ruby32"
RUBY_FAKEGEM_TASK_TEST=""
@@ -14,9 +14,19 @@ RUBY_FAKEGEM_EXTENSIONS=(./extconf.rb)
inherit ruby-fakegem
DESCRIPTION="ruby shadow bindings"
-HOMEPAGE="https://github.com/apalmblad/ruby-shadow http://ttsky.net"
+HOMEPAGE="https://github.com/apalmblad/ruby-shadow"
LICENSE="|| ( public-domain Unlicense )"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ppc ~ppc64 ~riscv ~sparc x86"
IUSE=""
+
+PATCHES=(
+ "${FILESDIR}/${P}-ruby32.patch"
+ "${FILESDIR}/${P}-ruby32-taint.patch"
+)
+
+all_ruby_prepare() {
+ sed -e '16i$CFLAGS += ENV["CFLAGS"]' \
+ -i extconf.rb || die
+}