Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion install/opm
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ THISDIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
LIB="$THISDIR/../lib"
OPM=$LIB/opm/src/cmd/opm.os

oscript $OPM "$@"
"$THISDIR/oscript" "$OPM" "$@"
Copy link
Owner

Choose a reason for hiding this comment

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

THISDIR указывает на каталог где лежит шеллскрипт и это тот же каталог, где лежит исполняемый файл oscript. Получается, что $THISDIR/oscript аналогично ./oscript

Copy link
Owner

Choose a reason for hiding this comment

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

Или я не понял смысл изменения

Copy link
Collaborator

Choose a reason for hiding this comment

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

oscript и ./oscript - не одно и то же. Второе будет искать только в текущем каталоге. Первое - в path.

Copy link
Owner

Choose a reason for hiding this comment

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

Да, тут я неверно написал. Но смысл изменения все равно непонятен

4 changes: 2 additions & 2 deletions install/opm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setlocal

set lib="%~dp0..\lib"
set lib=%~dp0..\lib
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Quote the SET value for safety with paths containing spaces.

The lib variable assignment is unquoted. If the installation path contains spaces, this will cause issues. The static analysis tool correctly flags this (SEC002).

Proposed fix
-set lib=%~dp0..\lib
+set "lib=%~dp0..\lib"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set lib=%~dp0..\lib
set "lib=%~dp0..\lib"
🧰 Tools
🪛 Blinter (1.0.102)

[error] 5-5: Unsafe SET command usage. Explanation: SET commands without proper validation or quoting can cause security issues. Recommendation: Always quote SET values and validate input: SET "var=safe value". Context: SET command value should be quoted for safety

(SEC002)

🤖 Prompt for AI Agents
In `@install/opm.bat` at line 5, Update the SET assignment for the environment
variable named lib so the assigned path is quoted to handle spaces; locate the
line using the SET command that assigns lib (currently using %~dp0..\lib) and
change it to use the SET syntax that places the entire assignment in quotes
(i.e., use the quoted-set form) so paths containing spaces are preserved safely.

Copy link
Owner

Choose a reason for hiding this comment

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

Кролик прав, зачем убраны кавычки?

set opm=%lib%\opm\src\cmd\opm.os

oscript %opm% %*
"%~dp0oscript.exe" "%opm%" %*