capng_c 0.2.2 → 0.2.3
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 +2 -3
- data/.github/workflows/yum.yml +7 -7
- data/Rakefile +1 -3
- data/ci/apt-test.sh +2 -2
- data/ci/yum-test.sh +8 -1
- data/ext/capng/capng.c +15 -6
- data/ext/capng/extconf.rb +1 -0
- data/lib/capng/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de6f1d1c03adc792bf92f5da7f5c7ac85b35c3df5a155718b2b97abafa19d3be
|
4
|
+
data.tar.gz: 46c69dcfcea97099d5e64319a7ea9cf19a636fe8cf08e88d7b0bbc1f89e6a80e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b8e5bddcfd632b9c3d3bd1716239079c4e8e85f72fe626a5d508d8c94f598875ccf7e155b3b7686ed63b538b8427e0bd3937609866ac3c07076a87b4e76be0f
|
7
|
+
data.tar.gz: 138eef80b0d44a7ba757909a8ceb2979a9cd642c33e1a457ed7da2494cee7d754e0f1b1658df92b87c9780d1df39ac4cd088b2e89cf390648630673c64db0ce0
|
data/.github/workflows/linux.yml
CHANGED
@@ -8,7 +8,7 @@ jobs:
|
|
8
8
|
strategy:
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
|
-
ruby: [ '2.
|
11
|
+
ruby: [ '2.5', '2.6' , '2.7', '3.0', '3.1', '3.2', '3.3', '3.4' ]
|
12
12
|
os:
|
13
13
|
- ubuntu-latest
|
14
14
|
name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
|
@@ -25,6 +25,5 @@ jobs:
|
|
25
25
|
env:
|
26
26
|
CI: true
|
27
27
|
run: |
|
28
|
-
gem install bundler rake
|
29
28
|
bundle install --jobs 4 --retry 3
|
30
|
-
bundle exec rake
|
29
|
+
bundle exec rake
|
data/.github/workflows/yum.yml
CHANGED
@@ -9,16 +9,16 @@ jobs:
|
|
9
9
|
fail-fast: false
|
10
10
|
matrix:
|
11
11
|
label:
|
12
|
-
-
|
13
|
-
-
|
12
|
+
- RockyLinux 8 x86_64
|
13
|
+
- AlmaLinux 9 x86_64
|
14
14
|
- Fedora 33 x86_64
|
15
15
|
- AmazonLinux 2 x86_64
|
16
16
|
include:
|
17
|
-
- label:
|
18
|
-
test-docker-image:
|
17
|
+
- label: RockyLinux 8 x86_64
|
18
|
+
test-docker-image: rockylinux:8
|
19
19
|
test-script: ci/yum-test.sh
|
20
|
-
- label:
|
21
|
-
test-docker-image:
|
20
|
+
- label: AlmaLinux 9 x86_64
|
21
|
+
test-docker-image: almalinux:9
|
22
22
|
test-script: ci/yum-test.sh
|
23
23
|
- label: Fedora 33 x86_64
|
24
24
|
test-docker-image: fedora:33
|
@@ -36,4 +36,4 @@ jobs:
|
|
36
36
|
--tty \
|
37
37
|
--volume ${PWD}:/capng \
|
38
38
|
${{ matrix.test-docker-image }} \
|
39
|
-
/capng/${{ matrix.test-script }}
|
39
|
+
/capng/${{ matrix.test-script }}
|
data/Rakefile
CHANGED
data/ci/apt-test.sh
CHANGED
@@ -7,9 +7,9 @@ export DEBIAN_FRONTEND=noninteractive
|
|
7
7
|
apt update
|
8
8
|
apt install -V -y lsb-release
|
9
9
|
|
10
|
-
apt install -V -y ruby-dev git build-essential pkg-config
|
10
|
+
apt install -V -y ruby-dev git build-essential pkg-config libyaml-dev
|
11
11
|
apt install -V -y libcap-ng-dev
|
12
12
|
cd /capng && \
|
13
|
-
gem install bundler --no-document && \
|
13
|
+
gem install bundler -v 2.3.27 --no-document && \
|
14
14
|
bundle install && \
|
15
15
|
bundle exec rake
|
data/ci/yum-test.sh
CHANGED
@@ -34,6 +34,12 @@ case ${distribution} in
|
|
34
34
|
;;
|
35
35
|
esac
|
36
36
|
;;
|
37
|
+
rocky)
|
38
|
+
DNF="dnf --enablerepo=powertools"
|
39
|
+
;;
|
40
|
+
almalinux)
|
41
|
+
DNF="dnf --enablerepo=crb"
|
42
|
+
;;
|
37
43
|
esac
|
38
44
|
|
39
45
|
${DNF} groupinstall -y "Development Tools"
|
@@ -53,6 +59,7 @@ else
|
|
53
59
|
rubygems \
|
54
60
|
rpm-build
|
55
61
|
fi
|
62
|
+
${DNF} install -y libyaml-devel
|
56
63
|
${DNF} install -y libcap-ng-devel
|
57
64
|
|
58
65
|
if [ $USE_SCL -eq 1 ]; then
|
@@ -60,5 +67,5 @@ if [ $USE_SCL -eq 1 ]; then
|
|
60
67
|
export MANPATH=
|
61
68
|
cd /capng && source /opt/rh/rh-ruby26/enable && gem install bundler --no-document && bundle install && bundle exec rake
|
62
69
|
else
|
63
|
-
cd /capng && gem install bundler --no-document && bundle install && bundle exec rake
|
70
|
+
cd /capng && gem install bundler -v 2.3.27 --no-document && bundle install && bundle exec rake
|
64
71
|
fi
|
data/ext/capng/capng.c
CHANGED
@@ -67,6 +67,19 @@ rb_capng_alloc(VALUE klass)
|
|
67
67
|
return obj;
|
68
68
|
}
|
69
69
|
|
70
|
+
static int
|
71
|
+
capng_get_file_descriptor(VALUE rb_file)
|
72
|
+
{
|
73
|
+
#ifdef HAVE_RB_IO_DESCRIPTOR
|
74
|
+
return rb_io_descriptor(rb_file);
|
75
|
+
#else
|
76
|
+
rb_io_t* fptr = NULL;
|
77
|
+
|
78
|
+
fptr = RFILE(rb_file)->fptr;
|
79
|
+
return fptr->fd;
|
80
|
+
#endif
|
81
|
+
}
|
82
|
+
|
70
83
|
/*
|
71
84
|
* Initalize CapNG class.
|
72
85
|
*
|
@@ -500,15 +513,13 @@ static VALUE
|
|
500
513
|
rb_capng_get_caps_file(VALUE self, VALUE rb_file)
|
501
514
|
{
|
502
515
|
int result = 0, fd = 0;
|
503
|
-
rb_io_t* fptr = NULL;
|
504
516
|
|
505
517
|
Check_Type(rb_file, T_FILE);
|
506
518
|
|
507
519
|
if (NIL_P(rb_file)) {
|
508
520
|
return Qfalse;
|
509
521
|
}
|
510
|
-
|
511
|
-
fd = fptr->fd;
|
522
|
+
fd = capng_get_file_descriptor(rb_file);
|
512
523
|
result = capng_get_caps_fd(fd);
|
513
524
|
|
514
525
|
if (result == 0)
|
@@ -529,7 +540,6 @@ static VALUE
|
|
529
540
|
rb_capng_apply_caps_file(VALUE self, VALUE rb_file)
|
530
541
|
{
|
531
542
|
int result = 0, fd = 0;
|
532
|
-
rb_io_t* fptr = NULL;
|
533
543
|
|
534
544
|
Check_Type(rb_file, T_FILE);
|
535
545
|
|
@@ -537,8 +547,7 @@ rb_capng_apply_caps_file(VALUE self, VALUE rb_file)
|
|
537
547
|
return Qfalse;
|
538
548
|
}
|
539
549
|
|
540
|
-
|
541
|
-
fd = fptr->fd;
|
550
|
+
fd = capng_get_file_descriptor(rb_file);
|
542
551
|
result = capng_apply_caps_fd(fd);
|
543
552
|
|
544
553
|
if (result == 0)
|
data/ext/capng/extconf.rb
CHANGED
@@ -29,5 +29,6 @@ have_const("CAPNG_SELECT_ALL", "cap-ng.h")
|
|
29
29
|
have_const("CAPNG_AMBIENT", "cap-ng.h")
|
30
30
|
have_const("CAPNG_INIT_SUPP_GRP", "cap-ng.h")
|
31
31
|
have_func("rb_sym2str", "ruby.h")
|
32
|
+
have_func("rb_io_descriptor", "ruby.h")
|
32
33
|
have_func("capng_get_caps_fd", "cap-ng.h")
|
33
34
|
create_makefile("capng/capng")
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.3.5
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: libcap-ng bindings for Ruby.
|