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
Conversation
There was a problem hiding this 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}" & |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
modules/Q02_openai_question.sh
Outdated
@@ -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 ))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this way?
There was a problem hiding this comment.
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=....
There was a problem hiding this comment.
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
modules/S110_yara_check.sh
Outdated
@@ -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=" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capital and local
Now when running check-project.sh, semgrep does not skip any file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job
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: