capng_c 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46ab5a21fef03d5b25db0124526add7f625acc865ae10da0f8614b6290b5aec0
4
- data.tar.gz: cae7565475f00217336124b3c1d0bad6fd3772470e3c8e2605ebac09bac87829
3
+ metadata.gz: eea2ca339ebb678c88b6c3ee7726878a46c2bdef9a8756daca982bb22bc009a5
4
+ data.tar.gz: 6b792b28771206844c5daac503ad2003c443799ebbf64b27f2f4cc616694a5e7
5
5
  SHA512:
6
- metadata.gz: 90fab6a90550512222604afee7896c75b766559d39f3288cad6191fb5b1192f080efc4bec6deef2c00377da4f7e8d129ec928191d67fa9277aac505652064b59
7
- data.tar.gz: eee3466a6e594b8b5d4fa1835c7650a6d7669cb20be1410c32c8e0b2d878d197263848ec2f1ea7923088428611a78400569f9be55ea16a4c0115ee3b6cd8547d
6
+ metadata.gz: 3071407d369065ac165ed2e1c4c8c9962205f9e67601152c884dc0d76bed6720e8c95ebd28b951029ed752f74a82b734876fbfed102e66325dd548b7a23a85b2
7
+ data.tar.gz: f1d1728a2b9de22433383cfeae38d7682f43af05995ef4c26fb4dcf89df58398525a3c8f10cc688ce11e847a55109811add8398c02a6b976d70b2210440c659c
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in ioext.gemspec
3
+ # Specify your gem's dependencies in capng_c.gemspec
4
4
  gemspec
@@ -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
 
@@ -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
 
@@ -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);
@@ -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(CAPNG_SELECT_AMBIENT)
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(CAPNG_SELECT_ALL)
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(CAPNG_AMBIENT)
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(CAPNG_INIT_SUPP_GRP)
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
@@ -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")
@@ -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
 
@@ -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
 
@@ -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(CAPNG_SELECT_AMBIENT)
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(CAPNG_SELECT_ALL)
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(CAPNG_AMBIENT)
73
+ #if defined(HAVE_CONST_CAPNG_AMBIENT)
74
74
  } else if (strcmp(capability_name, "ambient") == 0) {
75
75
  return CAPNG_AMBIENT;
76
76
  #endif
@@ -1,3 +1,3 @@
1
1
  class CapNG
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capng_c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Hatake