gitlab-grit 2.7.2 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 727486f55a14379860dea18408acb3617a2e2398
4
- data.tar.gz: cd06b6d3eacba266cc8d7d7692d6d74d5457e256
3
+ metadata.gz: a8c6f512f0477d03aeb48a9626fa774dd9f062d4
4
+ data.tar.gz: 284e6614616088e8e0f607240ae231ad89126b43
5
5
  SHA512:
6
- metadata.gz: ef7848f04f4d0aa8038d21cdf7182b9b5853270f276d842303f2ea7eef5ff0530ec04f08034595673e567fdef46c7e70d8b726ac9b79c3eb667595f4f2972279
7
- data.tar.gz: a78b09a020528c6b8a6a706988db9cb58aba6ba985f4c0758bd6ca68cf48e4100a3ff7a748f9f1fd94604a1a3f2a72e6c46a9e448ba18d903f922fd92f5e6e9e
6
+ metadata.gz: 348f57115329b50107c46e2a12f9d1d100d7c7aa69b2c6949fa3a15734bdff0098523f44ad57df11e26873037311628e4957d3b7c806b6454a386e1fc4d7aa83
7
+ data.tar.gz: 40fd462abe147a14c0883756a55ba11a69c054df8c87233d9271f98beabed8949d6db886ebd7503dc90d53285db413c53cda738e52d3649a9c28f7722f177939
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 2.7.3
@@ -683,7 +683,9 @@ module Grit
683
683
  end
684
684
 
685
685
  def self.add_file(name, contents)
686
- File.open(name, 'w') do |f|
686
+ path = File.join(Dir.pwd, name)
687
+ raise "Invalid path: #{path}" unless File.absolute_path(path) == path
688
+ File.open(path, 'w') do |f|
687
689
  f.write contents
688
690
  end
689
691
  end
@@ -117,7 +117,9 @@ module Grit
117
117
  #
118
118
  # Returns Boolean
119
119
  def fs_exist?(file)
120
- File.exist?(File.join(self.git_dir, file))
120
+ path = File.join(self.git_dir, file)
121
+ raise "Invalid path: #{path}" unless File.absolute_path(path) == path
122
+ File.exist?(path)
121
123
  end
122
124
 
123
125
  # Read a normal file from the filesystem.
@@ -125,7 +127,9 @@ module Grit
125
127
  #
126
128
  # Returns the String contents of the file
127
129
  def fs_read(file)
128
- File.read(File.join(self.git_dir, file))
130
+ path = File.join(self.git_dir, file)
131
+ raise "Invalid path: #{path}" unless File.absolute_path(path) == path
132
+ File.read(path)
129
133
  end
130
134
 
131
135
  # Write a normal file to the filesystem.
@@ -135,6 +139,7 @@ module Grit
135
139
  # Returns nothing
136
140
  def fs_write(file, contents)
137
141
  path = File.join(self.git_dir, file)
142
+ raise "Invalid path: #{path}" unless File.absolute_path(path) == path
138
143
  FileUtils.mkdir_p(File.dirname(path))
139
144
  File.open(path, 'w') do |f|
140
145
  f.write(contents)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-grit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2
4
+ version: 2.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-09 00:00:00.000000000 Z
13
+ date: 2014-12-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: charlock_holmes