Skip to content
This repository was archived by the owner on May 8, 2024. It is now read-only.

Commit 074b97a

Browse files
authored
update version 1.6.1
Bugfix $tempFile variable
1 parent b8d7e56 commit 074b97a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Fix-log4j_jndi_7zip.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Date: 16.12.2021
77
#############################
88
# Mod. Date: 23.12.2021
9-
$scriptVersion = "1.6"
9+
$scriptVersion = "1.6.1"
1010
#Change Log:
1111
# added additional if check to stop the process of bk file not found.
1212
# added PSScriptRoot for 7zip by default
@@ -174,10 +174,10 @@ else {
174174
Add-Content -Path $PathToLogFile -Value "$datelog Processing file $file"
175175
& $7zipPath d $file.fullname org/apache/logging/log4j/core/lookup/JndiLookup.class | Out-Null
176176
Write-Host " -- Checking if JNDILookup Class has been removed"
177-
Start-Process -FilePath "$7zipPath" -ArgumentList "l `"$($file.FullName)`" org/apache/logging/log4j/core/lookup/JndiLookup.class" -NoNewWindow -Wait -RedirectStandardOutput "$tmpFile"
177+
Start-Process -FilePath $7zipPath -ArgumentList "l `"$($file.FullName)`" org/apache/logging/log4j/core/lookup/JndiLookup.class" -NoNewWindow -Wait -RedirectStandardOutput "$tmpFile"
178178
Add-Content -Path $PathToLogFile -Value "$datelog --- Checking if JNDILookup Class has been removed"
179179
#check if jndilookup class was removed
180-
$validate = Select-String -Path "$tmpOutFile" -Pattern "JndiLookup.class" -CaseSensitive -Quiet -SimpleMatch
180+
$validate = Select-String -Path "$tmpFile" -Pattern "JndiLookup.class" -CaseSensitive -Quiet -SimpleMatch
181181
if (! $validate) {
182182
Write-Host " -- Verified: File successully cleaned up." -ForegroundColor Green
183183
Add-Content -Path $PathToLogFile -Value "$datelog --- Verified: File successully cleaned up."
@@ -222,7 +222,7 @@ else {
222222
Write-Host " -- Checking if JNDILookup Class has been removed"
223223
Start-Process -FilePath "$7zipPath" -ArgumentList "l `"$($file.FullName)`" org/apache/logging/log4j/core/lookup/JndiLookup.class" -NoNewWindow -Wait -RedirectStandardOutput "$tmpFile"
224224
Add-Content -Path $PathToLogFile -Value "$datelog --- Checking if JNDILookup Class has been removed"
225-
$validate = Select-String -Path "$tmpOutFile" -Pattern "JndiLookup.class" -CaseSensitive -Quiet -SimpleMatch
225+
$validate = Select-String -Path "$tmpFile" -Pattern "JndiLookup.class" -CaseSensitive -Quiet -SimpleMatch
226226
#check if jndilookup class was removed
227227
if (! $validate) {
228228
Write-Host " -- Verified: File successully cleaned up." -ForegroundColor Green

0 commit comments

Comments
 (0)