Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semgrep checks and shellcheck braces checks #835

Merged
merged 7 commits into from Oct 24, 2023

Conversation

HoxhaEndri
Copy link
Member

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)? If possible add a screenshot.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

Copy link
Member

@m-1-k-3 m-1-k-3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review my notes and questions

@@ -27,7 +27,7 @@ if ("${FIRMAE_ETC}"); then
BINARY_NAME=$("${BUSYBOX}" basename "${BINARY_NAME}")
if ( ! ("${BUSYBOX}" ps | "${BUSYBOX}" grep -v grep | "${BUSYBOX}" grep -sqi "${BINARY_NAME}") ); then
"${BUSYBOX}" echo "[*] Starting $BINARY_NAME service ..."
${BINARY} &
"${BINARY}" &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this BINARY variable could be something like:
binary parameter parameter ...
In this special case we can't add the "" to it.
Please, could you add a comment to ensure we do not forget about this situation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but I am renaming the variable to _BINARY, so semgrep won't flag it as an unquoted variable.

@@ -160,7 +160,8 @@ ask_chatgpt() {
local CNT=0
while [[ "${CNT}" -lt 1000 ]]; do
CNT=$((CNT+1))
(( "${CNT}" % 100 == 0 )) && print_output "[*] Rate limit handling ... sleep mode - ${CNT}" "no_log"
temp="$(( "${CNT}" % 100 ))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this way?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to declare temp as local and capital pls.

local TMP_VAR=""
TMP_VAR=....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this way?

This way semgrep does not skip the analysis

@@ -43,7 +43,8 @@ S110_yara_check()
ulimit -Sv unlimited

while read -r YARA_OUT_LINE; do
if [[ "$YARA_OUT_LINE" == *" [] [author="* ]]; then
author_string=" [] [author="
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capital and local

modules/S22_php_check.sh Show resolved Hide resolved
@HoxhaEndri
Copy link
Member Author

Now when running check-project.sh, semgrep does not skip any file.

Copy link
Member

@m-1-k-3 m-1-k-3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job

@m-1-k-3 m-1-k-3 merged commit 654d5ea into e-m-b-a:master Oct 24, 2023
12 checks passed
@m-1-k-3 m-1-k-3 mentioned this pull request Oct 24, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants