capng_c 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/ext/capng/capability.c +1 -1
- data/ext/capng/capng.c +1 -1
- data/ext/capng/capng.h +10 -10
- data/ext/capng/enum.c +9 -9
- data/ext/capng/extconf.rb +4 -0
- data/ext/capng/print.c +1 -1
- data/ext/capng/state.c +1 -1
- data/ext/capng/utils.c +3 -3
- data/lib/capng/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eea2ca339ebb678c88b6c3ee7726878a46c2bdef9a8756daca982bb22bc009a5
|
4
|
+
data.tar.gz: 6b792b28771206844c5daac503ad2003c443799ebbf64b27f2f4cc616694a5e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3071407d369065ac165ed2e1c4c8c9962205f9e67601152c884dc0d76bed6720e8c95ebd28b951029ed752f74a82b734876fbfed102e66325dd548b7a23a85b2
|
7
|
+
data.tar.gz: f1d1728a2b9de22433383cfeae38d7682f43af05995ef4c26fb4dcf89df58398525a3c8f10cc688ce11e847a55109811add8398c02a6b976d70b2210440c659c
|
data/Gemfile
CHANGED
data/ext/capng/capability.c
CHANGED
@@ -83,7 +83,7 @@ rb_capng_capability_from_name(VALUE self, VALUE rb_capability_name_or_symbol)
|
|
83
83
|
void
|
84
84
|
Init_capng_capability(VALUE rb_cCapNG)
|
85
85
|
{
|
86
|
-
rb_cCapability = rb_define_class_under(rb_cCapNG, "Capability", rb_cObject);
|
86
|
+
VALUE rb_cCapability = rb_define_class_under(rb_cCapNG, "Capability", rb_cObject);
|
87
87
|
|
88
88
|
rb_define_alloc_func(rb_cCapability, rb_capng_capability_alloc);
|
89
89
|
|
data/ext/capng/capng.c
CHANGED
@@ -399,7 +399,7 @@ rb_capng_apply_caps_file(VALUE self, VALUE rb_file)
|
|
399
399
|
void
|
400
400
|
Init_capng(void)
|
401
401
|
{
|
402
|
-
rb_cCapNG = rb_define_class("CapNG", rb_cObject);
|
402
|
+
VALUE rb_cCapNG = rb_define_class("CapNG", rb_cObject);
|
403
403
|
|
404
404
|
rb_define_alloc_func(rb_cCapNG, rb_capng_alloc);
|
405
405
|
|
data/ext/capng/capng.h
CHANGED
@@ -24,16 +24,16 @@
|
|
24
24
|
#include <sys/stat.h>
|
25
25
|
#include <fcntl.h>
|
26
26
|
|
27
|
-
VALUE rb_cCapNG;
|
28
|
-
VALUE rb_cCapNGPrint;
|
29
|
-
VALUE rb_cCapability;
|
30
|
-
VALUE rb_cState;
|
31
|
-
VALUE rb_mAction;
|
32
|
-
VALUE rb_mSelect;
|
33
|
-
VALUE rb_mType;
|
34
|
-
VALUE rb_mResult;
|
35
|
-
VALUE rb_mPrint;
|
36
|
-
VALUE rb_mFlags;
|
27
|
+
extern VALUE rb_cCapNG;
|
28
|
+
extern VALUE rb_cCapNGPrint;
|
29
|
+
extern VALUE rb_cCapability;
|
30
|
+
extern VALUE rb_cState;
|
31
|
+
extern VALUE rb_mAction;
|
32
|
+
extern VALUE rb_mSelect;
|
33
|
+
extern VALUE rb_mType;
|
34
|
+
extern VALUE rb_mResult;
|
35
|
+
extern VALUE rb_mPrint;
|
36
|
+
extern VALUE rb_mFlags;
|
37
37
|
|
38
38
|
capng_select_t select_name_to_select_type(char *select_name);
|
39
39
|
capng_act_t action_name_to_action_type(char *action_name);
|
data/ext/capng/enum.c
CHANGED
@@ -15,11 +15,11 @@
|
|
15
15
|
|
16
16
|
void Init_capng_enum(VALUE rb_cCapNG)
|
17
17
|
{
|
18
|
-
rb_mAction = rb_define_module_under(rb_cCapNG, "Action");
|
19
|
-
rb_mSelect = rb_define_module_under(rb_cCapNG, "Select");
|
20
|
-
rb_mType = rb_define_module_under(rb_cCapNG, "Type");
|
21
|
-
rb_mResult = rb_define_module_under(rb_cCapNG, "Result");
|
22
|
-
rb_mFlags = rb_define_module_under(rb_cCapNG, "Flags");
|
18
|
+
VALUE rb_mAction = rb_define_module_under(rb_cCapNG, "Action");
|
19
|
+
VALUE rb_mSelect = rb_define_module_under(rb_cCapNG, "Select");
|
20
|
+
VALUE rb_mType = rb_define_module_under(rb_cCapNG, "Type");
|
21
|
+
VALUE rb_mResult = rb_define_module_under(rb_cCapNG, "Result");
|
22
|
+
VALUE rb_mFlags = rb_define_module_under(rb_cCapNG, "Flags");
|
23
23
|
|
24
24
|
// capng_cat_t enum constants
|
25
25
|
rb_define_const(rb_mAction, "DROP", INT2NUM(CAPNG_DROP));
|
@@ -29,10 +29,10 @@ void Init_capng_enum(VALUE rb_cCapNG)
|
|
29
29
|
rb_define_const(rb_mSelect, "CAPS", INT2NUM(CAPNG_SELECT_CAPS));
|
30
30
|
rb_define_const(rb_mSelect, "BOUNDS", INT2NUM(CAPNG_SELECT_BOUNDS));
|
31
31
|
rb_define_const(rb_mSelect, "BOTH", INT2NUM(CAPNG_SELECT_BOTH));
|
32
|
-
#if defined(
|
32
|
+
#if defined(HAVE_CONST_CAPNG_SELECT_AMBIENT)
|
33
33
|
rb_define_const(rb_mSelect, "AMBIENT", INT2NUM(CAPNG_SELECT_AMBIENT));
|
34
34
|
#endif
|
35
|
-
#if defined(
|
35
|
+
#if defined(HAVE_CONST_CAPNG_SELECT_ALL)
|
36
36
|
rb_define_const(rb_mSelect, "ALL", INT2NUM(CAPNG_SELECT_ALL));
|
37
37
|
#endif
|
38
38
|
|
@@ -41,7 +41,7 @@ void Init_capng_enum(VALUE rb_cCapNG)
|
|
41
41
|
rb_define_const(rb_mType, "PERMITTED", INT2NUM(CAPNG_PERMITTED));
|
42
42
|
rb_define_const(rb_mType, "INHERITABLE", INT2NUM(CAPNG_INHERITABLE));
|
43
43
|
rb_define_const(rb_mType, "BOUNDING_SET", INT2NUM(CAPNG_BOUNDING_SET));
|
44
|
-
#if defined(
|
44
|
+
#if defined(HAVE_CONST_CAPNG_AMBIENT)
|
45
45
|
rb_define_const(rb_mType, "AMBIENT", INT2NUM(CAPNG_AMBIENT));
|
46
46
|
#endif
|
47
47
|
|
@@ -55,7 +55,7 @@ void Init_capng_enum(VALUE rb_cCapNG)
|
|
55
55
|
rb_define_const(rb_mFlags, "NO_FLAG", LONG2NUM(CAPNG_NO_FLAG));
|
56
56
|
rb_define_const(rb_mFlags, "DROP_SUPP_GRP", LONG2NUM(CAPNG_DROP_SUPP_GRP));
|
57
57
|
rb_define_const(rb_mFlags, "CLEAR_BOUNDING", LONG2NUM(CAPNG_CLEAR_BOUNDING));
|
58
|
-
#if defined(
|
58
|
+
#if defined(HAVE_CONST_CAPNG_INIT_SUPP_GRP)
|
59
59
|
// Ubuntu Trusty's libcap-ng-dev doesn't have CAPNG_INIT_SUPP_GRP constant.
|
60
60
|
rb_define_const(rb_mFlags, "INIT_SUPP_GRP", LONG2NUM(CAPNG_INIT_SUPP_GRP));
|
61
61
|
#endif
|
data/ext/capng/extconf.rb
CHANGED
@@ -24,6 +24,10 @@ pkg_config("libcap-ng")
|
|
24
24
|
$CFLAGS << " -Wall -std=c99 -fPIC "
|
25
25
|
# $CFLAGS << " -g -O0"
|
26
26
|
|
27
|
+
have_const("CAPNG_SELECT_AMBIENT", "cap-ng.h")
|
28
|
+
have_const("CAPNG_SELECT_ALL", "cap-ng.h")
|
29
|
+
have_const("CAPNG_AMBIENT", "cap-ng.h")
|
30
|
+
have_const("CAPNG_INIT_SUPP_GRP", "cap-ng.h")
|
27
31
|
have_func("rb_sym2str", "ruby.h")
|
28
32
|
have_func("capng_get_caps_fd", "cap-ng.h")
|
29
33
|
create_makefile("capng/capng")
|
data/ext/capng/print.c
CHANGED
@@ -151,7 +151,7 @@ rb_capng_print_caps_numeric(VALUE self, VALUE rb_where_name_or_type, VALUE rb_se
|
|
151
151
|
|
152
152
|
void Init_capng_print(VALUE rb_cCapNG)
|
153
153
|
{
|
154
|
-
rb_cCapNGPrint = rb_define_class_under(rb_cCapNG, "Print", rb_cObject);
|
154
|
+
VALUE rb_cCapNGPrint = rb_define_class_under(rb_cCapNG, "Print", rb_cObject);
|
155
155
|
|
156
156
|
rb_define_alloc_func(rb_cCapNGPrint, rb_capng_print_alloc);
|
157
157
|
|
data/ext/capng/state.c
CHANGED
@@ -90,7 +90,7 @@ rb_capng_state_restore(VALUE self)
|
|
90
90
|
void
|
91
91
|
Init_capng_state(VALUE rb_cCapNG)
|
92
92
|
{
|
93
|
-
rb_cState = rb_define_class_under(rb_cCapNG, "State", rb_cObject);
|
93
|
+
VALUE rb_cState = rb_define_class_under(rb_cCapNG, "State", rb_cObject);
|
94
94
|
|
95
95
|
rb_define_alloc_func(rb_cState, rb_capng_state_alloc);
|
96
96
|
|
data/ext/capng/utils.c
CHANGED
@@ -22,11 +22,11 @@ select_name_to_select_type(char *select_name)
|
|
22
22
|
return CAPNG_SELECT_BOUNDS;
|
23
23
|
} else if (strcmp(select_name, "both") == 0) {
|
24
24
|
return CAPNG_SELECT_BOTH;
|
25
|
-
#if defined(
|
25
|
+
#if defined(HAVE_CONST_CAPNG_SELECT_AMBIENT)
|
26
26
|
} else if (strcmp(select_name, "ambient") == 0) {
|
27
27
|
return CAPNG_SELECT_AMBIENT;
|
28
28
|
#endif
|
29
|
-
#if defined(
|
29
|
+
#if defined(HAVE_CONST_CAPNG_SELECT_ALL)
|
30
30
|
} else if (strcmp(select_name, "all") == 0) {
|
31
31
|
return CAPNG_SELECT_ALL;
|
32
32
|
#endif
|
@@ -70,7 +70,7 @@ capability_type_name_to_capability_type(char *capability_name)
|
|
70
70
|
return CAPNG_INHERITABLE;
|
71
71
|
} else if (strcmp(capability_name, "bounding_set") == 0) {
|
72
72
|
return CAPNG_BOUNDING_SET;
|
73
|
-
#if defined(
|
73
|
+
#if defined(HAVE_CONST_CAPNG_AMBIENT)
|
74
74
|
} else if (strcmp(capability_name, "ambient") == 0) {
|
75
75
|
return CAPNG_AMBIENT;
|
76
76
|
#endif
|
data/lib/capng/version.rb
CHANGED