capng_c 0.1.2 → 0.1.3
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/ext/capng/capng.c +16 -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: 2bb0e5ea482272f6f1678202e013e2279429a8d8db9331560a0037d5d3affee5
|
4
|
+
data.tar.gz: d00913ec86725ff56ec782cec00ade00c12ce7583963dabe080d2ae7f43a6de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fffbe03cb38e5237a24a4dacd9c0b0908d9d63692f04ef2c8e4e0181d96860f3ca0c6d2a7c35319123aaf6176b1faca303c8a6d4ddff1cd7c413250297112b6
|
7
|
+
data.tar.gz: 022ef6afb55bcaac0b83e8a31ae634f7839a2f8a6f49dc493328f0dd8ee44f04420227cf37eee3169142d6b5bbe8ee1c5df976f4e0158deffa225545c6c863c9
|
data/ext/capng/capng.c
CHANGED
@@ -226,13 +226,26 @@ rb_capng_update(VALUE self,
|
|
226
226
|
}
|
227
227
|
|
228
228
|
static VALUE
|
229
|
-
rb_capng_apply(VALUE self, VALUE
|
229
|
+
rb_capng_apply(VALUE self, VALUE rb_select_name_or_enum)
|
230
230
|
{
|
231
231
|
int result = 0;
|
232
|
+
capng_select_t select = 0;
|
232
233
|
|
233
|
-
|
234
|
+
switch (TYPE(rb_select_name_or_enum)) {
|
235
|
+
case T_SYMBOL:
|
236
|
+
select = select_name_to_select_type(RSTRING_PTR(rb_sym2str(rb_select_name_or_enum)));
|
237
|
+
break;
|
238
|
+
case T_STRING:
|
239
|
+
select = select_name_to_select_type(StringValuePtr(rb_select_name_or_enum));
|
240
|
+
break;
|
241
|
+
case T_FIXNUM:
|
242
|
+
select = NUM2INT(rb_select_name_or_enum);
|
243
|
+
break;
|
244
|
+
default:
|
245
|
+
rb_raise(rb_eArgError, "Expected a String or a Symbol instance, or a capability type constant");
|
246
|
+
}
|
234
247
|
|
235
|
-
result = capng_apply(
|
248
|
+
result = capng_apply(select);
|
236
249
|
|
237
250
|
if (result == 0)
|
238
251
|
return Qtrue;
|
data/lib/capng/version.rb
CHANGED