hiera-eyaml 2.0.7 → 2.0.8

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: 91148de066d290b4cdd6341ca54a3e20f7ae62fc
4
- data.tar.gz: 349951ef92e5d63dbd56cd769e32cf9fc16eb7ec
3
+ data.tar.gz: ebf0bc12a2d2dee0ff34b2b5ff40a8e5947f453c
4
+ metadata.gz: a5513c72714f17232041547bef4ed0f0df78466c
5
5
  SHA512:
6
- metadata.gz: 633324c4a0bb00849b924fb667975650b88256e0941b4ff123499d64d6d11f14f8f47769f9c301423a44d9bd9c9a7257de9eeaa0673290473c1332420882e07f
7
- data.tar.gz: 22a2eae199bae8f23f96bfe68634a440eb2dc1db512463b2c54f711085d09e318cd1f2a111232b068f8ec59967c7c8eed7f98a1c67daf638896e2e9ecb004f19
6
+ data.tar.gz: a825732caca0993b76700f4ad49be7c275ea58666a1d89ba78cc1aea45ca2bb0f2d019c44ea8f1396cc6ec1e6a6ad99e343fd106b03361fb4daef33155be985e
7
+ metadata.gz: 4e7d9bb0ea87cd0aebeae0073009288baa4a60879036abf67e2e28e09d6453d17967816e12ba8b65fb58371da977038ae70b49406c6f7067d2d4769bc43e2f29
@@ -3,8 +3,12 @@ rvm:
3
3
  - "1.8.7-p374"
4
4
  - "1.9.2"
5
5
  - "1.9.3"
6
+ - "2.0.0"
7
+ - "2.1.5"
6
8
  before_install:
7
9
  - sudo apt-get update
8
10
  - sudo apt-get install expect
9
11
  script:
10
12
  bundle exec cucumber -f progress
13
+ notifications:
14
+ email: false
data/CHANGES.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Change log for hiera-eyaml
2
2
  ==========================
3
3
 
4
+ 2.0.8
5
+ -----
6
+
7
+ - (#149) - Fix to tempfile permissions and invalid editor scenario (@elyscape)
8
+
4
9
  2.0.7
5
10
  -----
6
11
 
data/Gemfile CHANGED
@@ -4,7 +4,9 @@ gem 'highline', '~> 1.6.19'
4
4
  gem 'trollop', '~> 2.0'
5
5
 
6
6
  group :development do
7
- gem "aruba"
7
+ gem "aruba", '~> 0.6.2'
8
+ gem "cucumber", '~> 1.1'
9
+ gem "rspec-expectations", '~> 3.1.0'
8
10
  gem "hiera-eyaml-plaintext"
9
11
  gem "puppet"
10
12
  end
@@ -2,7 +2,7 @@ class Hiera
2
2
  module Backend
3
3
  module Eyaml
4
4
 
5
- VERSION = "2.0.7"
5
+ VERSION = "2.0.8"
6
6
  DESCRIPTION = "Hiera-eyaml is a backend for Hiera which provides OpenSSL encryption/decryption for Hiera properties"
7
7
 
8
8
  class RecoverableError < StandardError
@@ -68,15 +68,15 @@ eos
68
68
  end
69
69
 
70
70
  def self.execute
71
+ editor = Utils.find_editor
72
+
71
73
  encrypted_parser = Parser::ParserFactory.encrypted_parser
72
74
  tokens = encrypted_parser.parse Eyaml::Options[:input_data]
73
75
  decrypted_input = tokens.each_with_index.to_a.map{|(t,index)| t.to_decrypted :index => index}.join
74
76
  decrypted_file_content = Eyaml::Options[:no_preamble] ? decrypted_input : (self.preamble + decrypted_input)
75
- decrypted_file = Utils.write_tempfile decrypted_file_content
76
-
77
- editor = Utils.find_editor
78
77
 
79
78
  begin
79
+ decrypted_file = Utils.write_tempfile decrypted_file_content unless decrypted_file
80
80
  system "#{editor} \"#{decrypted_file}\""
81
81
  status = $?
82
82
 
@@ -72,9 +72,22 @@ class Hiera
72
72
  file.close!
73
73
 
74
74
  file = File.open(path, "w")
75
+ file.chmod(0600)
76
+ if ENV['OS'] == 'Windows_NT'
77
+ # Windows doesn't support chmod
78
+ icacls = 'C:\Windows\system32\icacls.exe'
79
+ if File.executable? icacls
80
+ current_user = `C:\\Windows\\system32\\whoami.exe`.chomp
81
+ # Use ACLs to restrict access to the current user only
82
+ command = %Q{#{icacls} "#{file.path}" /grant:r "#{current_user}":f /inheritance:r}
83
+ system "#{command} >NUL 2>&1"
84
+ end
85
+ end
75
86
  file.puts data_to_write
76
87
  file.close
77
88
 
89
+ Utils::debug "Wrote temporary file: #{path}"
90
+
78
91
  path
79
92
  end
80
93
 
@@ -1,5 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
+ # ToDo: Remove as 'rake install' task will build and install the latest gem?
4
+
3
5
  gem uninstall hiera-eyaml --executables
4
6
  RAKE_OUT=`rake build`
5
7
  echo ${RAKE_OUT}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-eyaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Poulton
@@ -9,28 +9,28 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2015-03-04 00:00:00 Z
12
+ date: 2015-04-15 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
+ name: trollop
16
+ prerelease: false
15
17
  requirement: &id001 !ruby/object:Gem::Requirement
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: "2.0"
20
- version_requirements: *id001
21
- prerelease: false
22
22
  type: :runtime
23
- name: trollop
23
+ version_requirements: *id001
24
24
  - !ruby/object:Gem::Dependency
25
+ name: highline
26
+ prerelease: false
25
27
  requirement: &id002 !ruby/object:Gem::Requirement
26
28
  requirements:
27
29
  - - ~>
28
30
  - !ruby/object:Gem::Version
29
31
  version: 1.6.19
30
- version_requirements: *id002
31
- prerelease: false
32
32
  type: :runtime
33
- name: highline
33
+ version_requirements: *id002
34
34
  description: Hiera backend for decrypting encrypted yaml properties
35
35
  email:
36
36
  executables: