lib/backup/jar.rb in encbs-0.2.3 vs lib/backup/jar.rb in encbs-0.2.4
- old
+ new
@@ -136,14 +136,22 @@
def hash_local_files
files = {}
if File.directory? @local_path
- matches = Dir.glob(File.join(@local_path, "/**/*"), File::FNM_DOTMATCH)
+ matches = []
+
+ Dir.glob(File.join(@local_path, "/**/*"), File::FNM_DOTMATCH) do |file|
+ if File.file?(file) or File.directory?(file)
+ puts_fail "Permission denied: #{file}" unless File.readable?(file)
- matches = matches.select do |match|
- match[/\/\.\.$/].nil? and match[/\/\.$/].nil?
+ matches << file if file[/\/\.\.$/].nil? and file[/\/\.$/].nil?
+ end
end
+
+ #matches = matches.select do |match|
+ # match[/\/\.\.$/].nil? and match[/\/\.$/].nil?
+ #end
matches << @local_path
matches.each do |match|
files.merge!(@file_item.stat match)