rvc 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/rvc/known_hosts.rb +6 -1
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.3.3
@@ -1,9 +1,14 @@
1
1
  require 'digest/sha2'
2
2
  require 'fileutils'
3
+ require 'rbconfig'
3
4
 
4
5
  module RVC
5
6
 
6
7
  class KnownHosts
8
+ def initialize
9
+ @ignore_permissions = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
10
+ end
11
+
7
12
  def filename
8
13
  File.join(ENV['HOME'], ".rvc", "known_hosts");
9
14
  end
@@ -20,7 +25,7 @@ class KnownHosts
20
25
  expected_hashed_host = hash_host protocol, hostname
21
26
  expected_hashed_public_key = hash_public_key public_key
22
27
  if File.exists? filename
23
- fail "bad permissions on known_hosts, expected 0600" unless File.stat(filename).mode & 0666 == 0600
28
+ fail "bad permissions on #{filename}, expected 0600" unless @ignore_permissions or File.stat(filename).mode & 0666 == 0600
24
29
  File.readlines(filename).each_with_index do |l,i|
25
30
  hashed_host, hashed_public_key = l.split
26
31
  next unless hashed_host == expected_hashed_host
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rvc
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.3.2
5
+ version: 1.3.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rich Lane