cloudera / cloudera-scripts-for-log4j

Scripts for addressing log4j zero day security issue
Apache License 2.0
86 stars 68 forks source link

Backup of tar.gz files is not occurring at the correct path with '-b' option #46

Open sugandhaAggarwal2 opened 2 years ago

sugandhaAggarwal2 commented 2 years ago

Issue is in cloudera-scripts-for-log4j/hdp_support_scripts/delete_jndi.sh file, where we are not passing backupdir while patching tar.gz file.

Actual code snippet with the issue: for tarfile in $(find -L $targetdir -name "*.tar.gz" -o -name "*.tgz"); do if [ -L "$tarfile" ]; then continue fi if zgrep -q JndiLookup.class $tarfile; then $patch_tgz $tarfile fi done

Correct will be: for tarfile in $(find -L $targetdir -name "*.tar.gz" -o -name "*.tgz"); do if [ -L "$tarfile" ]; then continue fi if zgrep -q JndiLookup.class $tarfile; then $patch_tgz $tarfile $backupdir fi done

PS: Fix of this issue was identified by my fellow colleague Davinder Singh.

abiboakye commented 10 months ago

@sugandhaAggarwal2

which line of code is the issue in cloudera-scripts-for-log4j/hdp_support_scripts/delete_jndi.sh file, where we are not passing backupdir while patching tar.gz file? And also, has the changes been amended here on github