* Petter Reinholdtsen <[email protected]> [160606 14:01]:
> But I would love to figure out a way to verify that the fix really is working
> before I upload.  Anyone got a clue to spare there?

I'm attaching two test programs that both raise a SecurityError on
ruby2.2 in sid, but run through on ruby2.1 in jessie. They only
cover two Fiddle cases, and no DL cases, though.

-- 
 ,''`.  Christian Hofstaedtler <[email protected]>
: :' :  Debian Developer
`. `'   7D1A CFFA D9E0 806C 9C4C  D392 5C13 D6DB 9305 2E03
  `-

require 'fiddle'
$SAFE = 1

# '/usr/lib/libm.dylib'
s = '/lib/x86_64-linux-gnu/libm.so.6'
puts s.inspect
s = s.taint
puts s.inspect

libm = Fiddle.dlopen(s)
floor = Fiddle::Function.new(
    libm['floor'],
      [Fiddle::TYPE_DOUBLE],
        Fiddle::TYPE_DOUBLE
)

puts floor.call(3.14159) #=> 3.0

require 'fiddle'
libc = Fiddle.dlopen('/lib/x86_64-linux-gnu/libc.so.6')
puts = Fiddle::Function.new(
    libc['puts'],
      [Fiddle::TYPE_VOIDP],
        Fiddle::TYPE_INT
)

$SAFE = 1


s = 'foo'
s.taint

ptr = Fiddle::Pointer[s]

puts puts.call(ptr)

Attachment: signature.asc
Description: PGP signature

Reply via email to