Skip to content

Fix conditional logic and port range validation in helper scripts#38

Open
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai:claude/fix-kali-derivative-test-mT4D7
Open

Fix conditional logic and port range validation in helper scripts#38
assisted-by-ai wants to merge 1 commit intoKicksecure:masterfrom
assisted-by-ai:claude/fix-kali-derivative-test-mT4D7

Conversation

@assisted-by-ai
Copy link
Copy Markdown

Summary

This PR fixes two bugs in the helper scripts: a conditional logic error in distribution detection and an incorrect port range validation message.

Key Changes

  • get_os.sh: Fixed the Kali derivative detection condition by explicitly comparing kali_derivative_detected to "1" instead of relying on implicit truthiness. The original condition would fail to properly detect when the variable was set.
  • ip_syntax.sh: Corrected the port range validation error message from 0-65535 to 1-65535 to accurately reflect the actual valid port range (ports must be greater than 0).

Implementation Details

The first fix ensures that the Oracle repository incompatibility check with Kali Linux distributions works correctly by using explicit value comparison rather than implicit boolean evaluation. The second fix corrects user-facing documentation in error messages to match the actual validation logic that checks port > 0.

https://claude.ai/code/session_01CokgibdWMKM8hSYezDskTH

- get_os.sh: use `= "1"` for kali_derivative_detected check for
  consistency with other _detected variable checks in the codebase
- ip_syntax.sh: correct error message from "0-65535" to "1-65535"
  since port 0 is rejected by the `-gt 0` check

https://claude.ai/code/session_01CokgibdWMKM8hSYezDskTH
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.

2 participants