ruby-shadow
ruby-shadow copied to clipboard
Ruby-shadow on github, ruby19 support
On Linux, using Ruby 3.2.2, getting shadow.so: undefined symbol: rb_tainted_str_new2 with ruby-shadow-ruby32-2.5.1.gem. The following code in this gem uses rb_tainted_str_new2: pwd/shadow.c:59: rb_tainted_str_new2(entry->pw_name), /* sp_namp */ pwd/shadow.c:60: rb_tainted_str_new2(entry->pw_passwd), /* sp_pwdp, encryped...
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...
Tested with `ruby 2.5.9p229` on `Rocky 8.8`, and `ruby 3.0.2p107` on Ubuntu 22.04 (Jammy). ``` root@c3d40e9bb44f:/# cat ./example.rb #!/usr/bin/env ruby require 'shadow' u = Shadow::Passwd::getspnam('root') Shadow::Passwd::putspent(u, File.open('/etc/newshadow', 'w+')) ``` ```...
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
Even after #31 is merged, `make` shows some implicit functions are used: ``` gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -Ishadow -DHAVE_GETSPENT -DHAVE_FGETSPENT -DHAVE_SETSPENT -DHAVE_ENDSPENT -DHAVE_LCKPWDF -DHAVE_ULCKPWDF -DHAVE_SGETSPENT -DHAVE_RUBY_IO_H -fPIC -DRUBY19 -m64...
For ruby-shadow 2.5.1, `$ ruby extconf.rb` with ruby 3.2.0preview3 and onwards fails like: ``` [mockbuild@6df3d7ad097f49839ba1c83ed9e69826 ruby-shadow-2.5.1]$ ruby extconf.rb checking for ruby/io.h... yes *** extconf.rb failed *** Could not create Makefile...
@apalmblad I'm starting a new issue so we can track everything here. In the meantime, I think it's important if we decide if we even need to maintain backwards compatibility....