From 8c1b8b5fda1a36e401bbf0b5563eb9e322d69354 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Mon, 8 Nov 2021 09:33:56 +0100 Subject: [PATCH] Patch for homebrew --- lib/wpscan/db/updater.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/wpscan/db/updater.rb b/lib/wpscan/db/updater.rb index 08d9e858..1cd3a47a 100644 --- a/lib/wpscan/db/updater.rb +++ b/lib/wpscan/db/updater.rb @@ -24,6 +24,10 @@ module WPScan FileUtils.mkdir_p(repo_directory.to_s) unless Dir.exist?(repo_directory.to_s) + # When --no-update is passed, return to avoid raising an error if the directory is not writable + # Mainly there for Homebrew: https://github.com/wpscanteam/wpscan/pull/1455 + return if ParsedCli.update == false + unless repo_directory.writable? raise "#{repo_directory} is not writable (uid: #{Process.uid}, gid: #{Process.gid})" end