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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2282b438c73cafe667183986b8beef357b3d397eff60249658f94d71326cafc8
4
- data.tar.gz: 8bb3439b3e3934efe4e83bda4e256780f4c7bb718a7f4883bc33d530483b5813
3
+ metadata.gz: de6f1d1c03adc792bf92f5da7f5c7ac85b35c3df5a155718b2b97abafa19d3be
4
+ data.tar.gz: 46c69dcfcea97099d5e64319a7ea9cf19a636fe8cf08e88d7b0bbc1f89e6a80e
5
5
  SHA512:
6
- metadata.gz: d24ec898c4b40f26cee597a369f10c4ada7973fdba6c4cb51e85812702f2d6684b83e69946e4f019d94ff595380663150d4af1833b99e0f84cba99599a579110
7
- data.tar.gz: d077c6cbbc46950174bbd6e0c2cbf296ac679b69a2231f560de846203718d562c920b53343db7d2dde48bd484cbcf3b50904c763f37ae99d330616bac0c015b1
6
+ metadata.gz: 1b8e5bddcfd632b9c3d3bd1716239079c4e8e85f72fe626a5d508d8c94f598875ccf7e155b3b7686ed63b538b8427e0bd3937609866ac3c07076a87b4e76be0f
7
+ data.tar.gz: 138eef80b0d44a7ba757909a8ceb2979a9cd642c33e1a457ed7da2494cee7d754e0f1b1658df92b87c9780d1df39ac4cd088b2e89cf390648630673c64db0ce0
@@ -8,7 +8,7 @@ jobs:
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [ '2.4', '2.5', '2.6' , '2.7' ]
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
@@ -9,16 +9,16 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  label:
12
- - CentOS 7 x86_64
13
- - CentOS 8 x86_64
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: CentOS 7 x86_64
18
- test-docker-image: centos:7
17
+ - label: RockyLinux 8 x86_64
18
+ test-docker-image: rockylinux:8
19
19
  test-script: ci/yum-test.sh
20
- - label: CentOS 8 x86_64
21
- test-docker-image: centos:8
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
@@ -12,9 +12,7 @@ end
12
12
 
13
13
  require "rake/extensiontask"
14
14
 
15
- spec = eval File.read("capng_c.gemspec")
16
-
17
- Rake::ExtensionTask.new("capng", spec) do |ext|
15
+ Rake::ExtensionTask.new("capng") do |ext|
18
16
  ext.lib_dir = "lib/capng"
19
17
  end
20
18
 
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
- fptr = RFILE(rb_file)->fptr;
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
- fptr = RFILE(rb_file)->fptr;
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
@@ -1,3 +1,3 @@
1
1
  class CapNG
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
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.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: 2020-12-25 00:00:00.000000000 Z
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.2.3
152
+ rubygems_version: 3.3.5
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: libcap-ng bindings for Ruby.