Update set_rights
This commit is contained in:
parent
5d8a05fb22
commit
8839b1f4d4
1 changed files with 2 additions and 5 deletions
|
@ -62,11 +62,8 @@ module BSD::Capsicum
|
||||||
def set_rights!(io, capabilities)
|
def set_rights!(io, capabilities)
|
||||||
rights = Fiddle::Pointer.malloc(Constants::SIZEOF_CAP_RIGHTS_T)
|
rights = Fiddle::Pointer.malloc(Constants::SIZEOF_CAP_RIGHTS_T)
|
||||||
FFI.cap_rights_init(rights, *capabilities)
|
FFI.cap_rights_init(rights, *capabilities)
|
||||||
if FFI.cap_rights_limit(io.to_i, rights).zero?
|
FFI.cap_rights_limit(io.to_i, rights).zero? ||
|
||||||
true
|
raise(SystemCallError.new("cap_rights_limit", Fiddle.last_error))
|
||||||
else
|
|
||||||
raise SystemCallError.new("cap_rights_limit", Fiddle.last_error)
|
|
||||||
end
|
|
||||||
ensure
|
ensure
|
||||||
rights.call_free
|
rights.call_free
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue