capng_c 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/linux.yml +30 -0
- data/README.md +2 -0
- data/ext/capng/capng.c +1 -1
- data/ext/capng/extconf.rb +1 -1
- data/ext/capng/print.c +2 -2
- data/lib/capng.rb +11 -0
- data/lib/capng/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31b53b59b57445d79f742beb25910e6bb62270673d6c171ffea029938d5f35ee
|
4
|
+
data.tar.gz: 62c157b61e3cc5e1bfd144effb8370a3de756e63a7cfccfb3012d236ceecd2d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3b0b2deda2fb0c46fcce53f54097659a4d7fddd34e1bc4ce01fd27dea02a220263cf668deb048542009dc92b885753938f753af37e7a87500b806111330e552
|
7
|
+
data.tar.gz: b2968668551f8b397d7f5da73d38004215cef706e2d8e2ecf09453a6ca4ef14ed4b8e550296767a5f38dba9e87edcb669b4edaf2cf8433e3f92c7c9a27591c0a
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: Linux testing
|
2
|
+
on:
|
3
|
+
- push
|
4
|
+
- pull_request
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ${{ matrix.os }}
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [ '2.4', '2.5', '2.6' , '2.7' ]
|
12
|
+
os:
|
13
|
+
- ubuntu-latest
|
14
|
+
name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
|
15
|
+
steps:
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
- name: Install dependencies
|
18
|
+
run: |
|
19
|
+
sudo apt update
|
20
|
+
sudo apt -V install libcap-ng-dev
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
- name: unit testing
|
25
|
+
env:
|
26
|
+
CI: true
|
27
|
+
run: |
|
28
|
+
gem install bundler rake
|
29
|
+
bundle install --jobs 4 --retry 3
|
30
|
+
bundle exec rake
|
data/README.md
CHANGED
data/ext/capng/capng.c
CHANGED
@@ -162,7 +162,7 @@ rb_capng_change_id(VALUE self, VALUE rb_uid, VALUE rb_gid, VALUE rb_flags)
|
|
162
162
|
if (result == 0)
|
163
163
|
return Qtrue;
|
164
164
|
else
|
165
|
-
|
165
|
+
rb_raise(rb_eRuntimeError, "Calling capng_change_id is failed with: (exitcode: %d)\n", result);
|
166
166
|
}
|
167
167
|
|
168
168
|
static VALUE
|
data/ext/capng/extconf.rb
CHANGED
data/ext/capng/print.c
CHANGED
@@ -67,7 +67,7 @@ rb_capng_print_caps_text(VALUE self, VALUE rb_where, VALUE rb_select_set)
|
|
67
67
|
if (result)
|
68
68
|
return rb_str_new2(result);
|
69
69
|
else
|
70
|
-
return rb_str_new2("
|
70
|
+
return rb_str_new2("none");
|
71
71
|
}
|
72
72
|
|
73
73
|
static VALUE
|
@@ -86,7 +86,7 @@ rb_capng_print_caps_numeric(VALUE self, VALUE rb_where, VALUE rb_select_set)
|
|
86
86
|
if (result)
|
87
87
|
return rb_str_new2(result);
|
88
88
|
else
|
89
|
-
return rb_str_new2("
|
89
|
+
return rb_str_new2("none");
|
90
90
|
}
|
91
91
|
|
92
92
|
void Init_capng_print(VALUE rb_cCapNG)
|
data/lib/capng.rb
CHANGED
@@ -6,6 +6,7 @@ class CapNG
|
|
6
6
|
|
7
7
|
alias_method :caps_file_raw, :caps_file
|
8
8
|
alias_method :apply_caps_file_raw, :apply_caps_file
|
9
|
+
alias_method :update_raw, :update
|
9
10
|
|
10
11
|
def caps_file(file_or_string_path)
|
11
12
|
if file_or_string_path.is_a?(String) && File.exist?(file_or_string_path)
|
@@ -30,4 +31,14 @@ class CapNG
|
|
30
31
|
raise ArgumentError, "#{file_or_string_path} should be File class or String class instance."
|
31
32
|
end
|
32
33
|
end
|
34
|
+
|
35
|
+
def update(action, type, capability_or_capability_array)
|
36
|
+
if capability_or_capability_array.is_a?(Array) && !capability_or_capability_array.empty?
|
37
|
+
capability_or_capability_array.each do |capability|
|
38
|
+
update_raw(action, type, capability)
|
39
|
+
end
|
40
|
+
else
|
41
|
+
update_raw(action, type, capability_or_capability_array)
|
42
|
+
end
|
43
|
+
end
|
33
44
|
end
|
data/lib/capng/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capng_c
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,7 @@ extensions:
|
|
80
80
|
- ext/capng/extconf.rb
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
|
+
- ".github/workflows/linux.yml"
|
83
84
|
- ".gitignore"
|
84
85
|
- Gemfile
|
85
86
|
- LICENSE
|