diff options
Diffstat (limited to 'dev-ruby/ruby-shadow')
| -rw-r--r-- | dev-ruby/ruby-shadow/Manifest | 1 | ||||
| -rw-r--r-- | dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32-taint.patch | 54 | ||||
| -rw-r--r-- | dev-ruby/ruby-shadow/files/ruby-shadow-2.5.1-ruby32.patch | 31 | ||||
| -rw-r--r-- | dev-ruby/ruby-shadow/metadata.xml | 9 | ||||
| -rw-r--r-- | dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild | 31 |
5 files changed, 126 insertions, 0 deletions
diff --git a/dev-ruby/ruby-shadow/Manifest b/dev-ruby/ruby-shadow/Manifest new file mode 100644 index 000000000000..7e0ec21e92f8 --- /dev/null +++ b/dev-ruby/ruby-shadow/Manifest @@ -0,0 +1 @@ +DIST ruby-shadow-2.5.1.gem 11264 BLAKE2B 0371fbf8f01dd6907b26369c33e69bc11664282ce1005792cff70113b0a05bfe0ce0eddd15896a9c6bcc9de38671d73034414f354f34d2716fd4f9265d823cbf SHA512 401ba31f6f87b9b50597e3924c67ef9d0a8f566ea4649735caf59e2b706861babf9b3aa273b7c47ca1cc9c8b4fde79ab21d2e264cd7ba58041fe7b8f9fd87411 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/metadata.xml b/dev-ruby/ruby-shadow/metadata.xml new file mode 100644 index 000000000000..c685ebad7e3a --- /dev/null +++ b/dev-ruby/ruby-shadow/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>ruby@gentoo.org</email> + <name>Gentoo Ruby Project</name> + </maintainer> + <origin>baldeagleos-repo</origin> +</pkgmetadata> diff --git a/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild b/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild new file mode 100644 index 000000000000..7fbf2f53f563 --- /dev/null +++ b/dev-ruby/ruby-shadow/ruby-shadow-2.5.1.ebuild @@ -0,0 +1,31 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +USE_RUBY="ruby31 ruby32 ruby33 ruby34" + +RUBY_FAKEGEM_TASK_TEST="" + +RUBY_FAKEGEM_EXTRADOC="HISTORY README README.euc" + +RUBY_FAKEGEM_EXTENSIONS=(./extconf.rb) + +inherit ruby-fakegem + +DESCRIPTION="ruby shadow bindings" +HOMEPAGE="https://github.com/apalmblad/ruby-shadow" + +LICENSE="|| ( public-domain Unlicense )" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ~hppa ppc ~ppc64 ~riscv ~sparc x86" + +PATCHES=( + "${FILESDIR}/${P}-ruby32.patch" + "${FILESDIR}/${P}-ruby32-taint.patch" +) + +all_ruby_prepare() { + sed -e '16i$CFLAGS += ENV["CFLAGS"]' \ + -i extconf.rb || die +} |
