Benign ruby Download

lib/portage/ucp/support/transaction_log.rb

Ruby creates a directory treeRuby parses JSON data
SHA-2564bb8c96b1b163c910117451c9e78ca987b05c7e8c56da971a30eacabf3a8f19f
MaleculeH₂(DbF₂)

Evidence

Ruby creates a directory tree lines 125–133
125:10… nd
126
127 private
128
129 def with_lock(lock_mode)
130 FileUtils.mkdir_p(File.dirname(@path))
131 File.open(@path, File::RDWR | File::CREAT, 0o600) do |file|
132 file.flock(lock_mode)
133 …
Ruby parses JSON data lines 139–148
139:17… file.read
140 return {} if raw.empty?
141
142 parsed = JSON.parse(raw)
143 parsed.is_a?(Hash) ? parsed : {}
144 rescue JSON::ParserError
⋯4 lines
Ruby serializes formatted JSON lines 151–160
151:7… file.rewind
152 file.truncate(0)
153 file.write(JSON.pretty_generate(data))
154 file.flush
155 File.chmod(0o600, @path)
156 end
157 end
158 end
159 end
160end

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.