diff --git a/README.md b/README.md index eaffeda..b96b091 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,7 @@ given file. __Features__ -As a regular user account, you can obtain a list of available features. -But to enable, disable or query the status of a feature for a given file -a superuser account is required: +As a regular user account, you can obtain a list of available features: ``` ruby #!/usr/bin/env ruby @@ -61,17 +59,14 @@ BSD::Control A complete API reference is available at [0x1eef.github.io/x/hbsdctl.rb](https://0x1eef.github.io/x/hbsdctl.rb). +## Sources + +* [GitHub](https://github.com/0x1eef/hbsdctl.rb) +* [GitLab](https://gitlab.com/0x1eef/hbsdctl.rb) +* [git.hardenedbsd.org](https://git.hardenedbsd.org/0x1eef/hbsdctl.rb) + ## Install -**Git** - -hbsdctl.rb is distributed as a RubyGem through its git repositories.
-[git.hardenedbsd.org](https://git.hardenedbsd.org/0x1eef/hbsdctl.rb), -[GitHub](https://github.com/0x1eef/hbsdctl.rb), -and -[GitLab](https://gitlab.com/0x1eef/hbsdctl.rb) -are available as sources. - **Rubygems.org** hbsdctl.rb can also be installed via rubygems.org. diff --git a/ext/hbsdctl.rb/feature.c b/ext/hbsdctl.rb/feature.c index 53f9a93..35a1469 100644 --- a/ext/hbsdctl.rb/feature.c +++ b/ext/hbsdctl.rb/feature.c @@ -1,8 +1,6 @@ #include -#include #include #include "include/feature.h" -static VALUE __rb_eError(void); static VALUE __set(VALUE, VALUE, VALUE); /** @@ -33,13 +31,3 @@ __set(VALUE rb_path, VALUE rb_feature, VALUE rb_state) rb_syserr_fail(errno, "hbsdcontrol_set_feature_state"); } } - - -static VALUE -__rb_eError(void) -{ - VALUE rb_mBSD = rb_const_get(rb_cObject, rb_intern("BSD")), - rb_mControl = rb_const_get(rb_mBSD, rb_intern("Control")), - rb_eError = rb_const_get(rb_mControl, rb_intern("Error")); - return (rb_eError); -} diff --git a/test/superuser/disable_feature_test.rb b/test/superuser/disable_feature_test.rb index 7ca374e..11468f0 100644 --- a/test/superuser/disable_feature_test.rb +++ b/test/superuser/disable_feature_test.rb @@ -5,7 +5,7 @@ module BSD::Control include FileUtils def test_disable_mprotect_nonexistent_file - assert_raises Errno::ENOENT do + assert_raises(Errno::ENOENT) do BSD::Control.feature(:mprotect).disable!(file) end end