2024-06-25 05:23:16 +02:00
|
|
|
require "bundler/setup"
|
2024-06-25 08:25:53 +02:00
|
|
|
require "bsd/capsicum"
|
2024-06-25 05:23:16 +02:00
|
|
|
|
2024-06-25 08:25:53 +02:00
|
|
|
print "[parent] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
2024-06-25 05:23:16 +02:00
|
|
|
fork do
|
2024-06-25 08:25:53 +02:00
|
|
|
print "[subprocess] Enter capability mode: ", BSD::Capsicum.enter! ? "ok" : "error", "\n"
|
|
|
|
print "[subprocess] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
2024-06-25 05:23:16 +02:00
|
|
|
print "[subprocess] Exit", "\n"
|
|
|
|
exit 42
|
|
|
|
end
|
|
|
|
Process.wait
|
2024-06-25 08:25:53 +02:00
|
|
|
print "[parent] In capability mode: ", BSD::Capsicum.in_capability_mode? ? "yes" : "no", "\n"
|
2024-06-25 05:23:16 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# [parent] In capability mode: no
|
|
|
|
# [subprocess] Enter capability mode: ok
|
|
|
|
# [subprocess] In capability mode: yes
|
|
|
|
# [subprocess] Exit
|
|
|
|
# [parent] In capability mode: no
|