diff --git a/ruby-shadow.gemspec b/chef-ruby-shadow.gemspec similarity index 86% rename from ruby-shadow.gemspec rename to chef-ruby-shadow.gemspec index 52a6cd3..234cdaa 100644 --- a/ruby-shadow.gemspec +++ b/chef-ruby-shadow.gemspec @@ -16,9 +16,9 @@ Gem::Specification.new do |spec| spec.files << file.chomp end spec.homepage = 'https://github.com/apalmblad/ruby-shadow' - spec.name = 'ruby-shadow' - spec.required_ruby_version = ['>= 1.8'] + spec.name = 'chef-ruby-shadow' + spec.required_ruby_version = ['>= 3.0'] spec.summary = '*nix Shadow Password Module' - spec.version = '2.5.1' + spec.version = '3.0.0' spec.license = "Unlicense" end diff --git a/extconf.rb b/extconf.rb index d17f926..6f43ae2 100644 --- a/extconf.rb +++ b/extconf.rb @@ -1,7 +1,7 @@ # -*- ruby -*- # extconf.rb # -# Modified at: <1999/8/19 06:38:55 by ttate> +# Modified at: <1999/8/19 06:38:55 by ttate> # require 'mkmf' @@ -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/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..9d02310 100644 --- a/shadow/shadow.c +++ b/shadow/shadow.c @@ -31,11 +31,11 @@ static VALUE rb_sGroupEntry; static VALUE rb_eFileLock; -static VALUE convert_pw_struct( struct spwd *entry ) +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),