cracklib_reloaded 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
  SHA1:
3
- metadata.gz: 0d9cf7dbb03f7f64797279ed4a386adcc8ec1d11
4
- data.tar.gz: 164b30dc0c97216a393a00bb27f56acc34a8cb95
3
+ metadata.gz: a2b6096ce9c9708f4edc757c90ce9adbf0a96777
4
+ data.tar.gz: 4d2ccfcecc12280e87be8f38c6ded990833482a9
5
5
  SHA512:
6
- metadata.gz: ac4b4822970dd6394e771666041752ae0dbba1377456dfdded4a4e162ef6b9ea2728c58aacf382bee2c2828152e3ac824c9dfa2f84fef747bec5d40031a279cc
7
- data.tar.gz: a293db95c3b01a016cefaa5419fa6c3fefe6c47ae8c41c2c52531b84b0691dc15645ad6c1460c3f91f8f81da444bbc02e6b519df73fb122eee16a6f797b31f74
6
+ metadata.gz: 7a0e7b54d64dd65c501479dd67989bb419b870ff230bd02101fe312457a60334887886a6d1d5a719c6d51035f3441132cc051b3c60cf0047985eea0d3a113023
7
+ data.tar.gz: 242b7187733312fee9cadbd29200222db57a4d3060f25ff3150a47a09a3ea732e7f7fc274b3ca658037f20a7b6cb2bef401b6fe3b019c7d7834cd5c05c27ede7
@@ -8,6 +8,7 @@ addons:
8
8
  - language-pack-en
9
9
  - language-pack-en-base
10
10
  - libcrack2
11
+ - libcrack2-dev
11
12
  - cracklib-runtime
12
13
  env:
13
14
  global:
@@ -16,6 +17,8 @@ env:
16
17
  - LANGUAGE=en_US.UTF-8
17
18
  # `cache` is only available for private projects
18
19
  cache: bundler
20
+ before_script:
21
+ - unset LIBCRACK_SO_PATH
19
22
  before_install:
20
23
  - gem update --system --no-doc
21
24
  - gem install bundler -v 1.14.6 --no-doc
data/README.md CHANGED
@@ -4,8 +4,9 @@ CrackLib is a library for checking that a password is not based on a simple char
4
4
 
5
5
  ## Dependencies
6
6
 
7
+ * CENTOS 5.x: sudo yum install cracklib cracklib-dicts
7
8
  * CENTOS 6.x: sudo yum install cracklib cracklib-devel
8
- * UBUNTU: sudo apt-get install libcrack2 cracklib-devel
9
+ * UBUNTU: sudo apt-get install libcrack2 libcrack2-dev cracklib-runtime
9
10
  * MAC: sudo port install cracklib cracklib-words
10
11
 
11
12
  ## Installation
@@ -6,13 +6,19 @@ module CracklibReloaded
6
6
  module CracklibReloadedFfiMixin
7
7
  extend FFI::Library
8
8
  libcrack_so_paths = []
9
- libcrack_so_paths << ENV['LIBCRACK_SO_PATH'].to_s
10
- libcrack_so_paths << '/usr/lib/libcrack.so.2' if 0.to_i.size != 8
11
- libcrack_so_paths << '/usr/lib64/libcrack.so.2'
12
- libcrack_so_paths << '/usr/lib/x86_64-linux-gnu/libcrack.so.2'
9
+ libcrack_so_paths << ENV['LIBCRACK_SO_PATH'].to_s if ENV['LIBCRACK_SO_PATH']
10
+ interpreter_bytes = 0.to_i.size
11
+ interpreter_bits = interpreter_bytes * 8
12
+ if interpreter_bits == 64
13
+ libcrack_so_paths << '/usr/lib64/libcrack.so.2'
14
+ libcrack_so_paths << '/usr/lib/x86_64-linux-gnu/libcrack.so.2'
15
+ end
16
+ libcrack_so_paths << '/usr/lib/libcrack.so.2' # generic
17
+ libcrack_so_paths << '/usr/lib/i386-linux-gnu/libcrack.so.2'
13
18
  LIBCRACK_SO_PATH = libcrack_so_paths.select { |file| File.readable?(file) }.first.freeze
14
19
 
15
20
  ffi_lib LIBCRACK_SO_PATH
21
+
16
22
  attach_function :cracklib_default_dict, :GetDefaultCracklibDict, [], :string
17
23
  attach_function :cracklib_check, :FascistCheck, %i[string string], :string
18
24
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CracklibReloaded
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cracklib_reloaded
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
  - Marcin Kalita