19 lines
558 B
Ruby
19 lines
558 B
Ruby
|
require "bundler/setup"
|
||
|
require "capsicum"
|
||
|
|
||
|
print "In capability mode: ", Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||
|
print "Enter capability mode: ", Capsicum.enter! ? "ok" : "error", "\n"
|
||
|
print "In capability mode: ", Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
||
|
|
||
|
begin
|
||
|
File.new(File::NULL)
|
||
|
rescue Errno::ECAPMODE => ex
|
||
|
print "Error: #{ex.message} (#{ex.class})", "\n"
|
||
|
end
|
||
|
|
||
|
##
|
||
|
# In capability mode: no
|
||
|
# Enter capability mode: ok
|
||
|
# In capability mode: yes
|
||
|
# Error: Not permitted in capability mode @ rb_sysopen - /dev/null (Errno::ECAPMODE)
|