author | Mahlon E. Smith <mahlon@martini.nu> |
Tue, 03 Mar 2009 22:23:45 +0000 | |
changeset 7 | 4460fc10c6a3 |
parent 0 | 92d00ff32c56 |
permissions | -rw-r--r-- |
7
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
1 |
#!/usr/bin/env ruby |
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
2 |
# |
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
3 |
# An example 'jexec' in ruby. |
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
4 |
# |
0 | 5 |
|
6 |
BEGIN { |
|
7 |
require 'pathname' |
|
8 |
basedir = Pathname.new( __FILE__ ).dirname.parent |
|
7
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
9 |
|
0 | 10 |
$LOAD_PATH.unshift basedir + "ext" unless |
11 |
$LOAD_PATH.include? basedir + "ext" |
|
12 |
} |
|
13 |
||
7
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
14 |
require 'jail' |
0 | 15 |
|
7
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
16 |
BSD::Jail.attach( ARGV.shift.to_i ) |
4460fc10c6a3
* Now with 87% more hot jail action!
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
17 |
exec( *ARGV ) |
0 | 18 |