Module: Common::VirusScan

Defined in:
lib/common/virus_scan.rb

Class Method Summary collapse

Class Method Details

.scan(file_path) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/common/virus_scan.rb', line 7

def scan(file_path)
  # `clamd` runs within service group, needs group read
  File.chmod(0o640, file_path)

  # NOTE: If using custom_args, no other arguments can be passed to
  # ClamScan::Client.scan. All other arguments will be ignored
  args = ['-c', Rails.root.join('config', 'clamd.conf').to_s, file_path]
  ClamScan::Client.scan(custom_args: args)
end