2
jrubyをスクリプト言語(ゲームのクエストを書くため)として使用しようとしていますが、Dir
、Process
またはRubyVM
のような潜在的に危険なクラスの使用を防ぐ必要があります。 いくつかの特定のルビクラスにのみアクセスを許可するには?
class Dir
def Dir.[]
end
def Dir.chdir
end
def Dir.chroot
end
def Dir.delete
end
def Dir.entries
end
def Dir.exist?
end
def Dir.exists?
end
def Dir.foreach
end
def Dir.getwd
end
def Dir.glob
end
def Dir.home
end
def Dir.mkdir
end
def Dir.initialitze
end
def Dir.open
end
def Dir.pwd
end
def Dir.rmdir
end
def Dir.unlink
end
def close
end
def each
end
def fileno
end
def inspect
end
def path
end
def pos
end
def read
end
def rewind
end
def seek
end
def tell
end
def to_path
end
end
しかし、私は本当にこのタスクを実行したり、さらに良くすることができるはずのクラスをホワイトリストに登録するもっと簡単な方法があることを願っています:
私はすでに、単一のメソッドやクラスをブラックリストに面倒な方法を見つけましたつかいます。
はそれが 'クラスのDir \ nはデフDir.workaround_pwd \ n個を使用して、この予防を回避することはできませんDir.pwd \ n end \ n end \ n' – seyfahni
@seyfahni、私はあなたを理解していません、答えを更新することによってあなたの意見の完全な説明を与えてください – Ilya
私はちょうどあなたのソリューションの簡単な回避策があると思います:ペーストビンの回避策](https://pastebin.com/v0ssbHhg) – seyfahni