fix: Address PR review findings - resource limits and code cleanup#108
Merged
inureyes merged 2 commits intofeature/issue-98-hostlist-expressionfrom Dec 16, 2025
Merged
fix: Address PR review findings - resource limits and code cleanup#108inureyes merged 2 commits intofeature/issue-98-hostlist-expressionfrom
inureyes merged 2 commits intofeature/issue-98-hostlist-expressionfrom
Conversation
HIGH Priority Fixes:
- Add resource exhaustion protection in parse_hostfile():
* Maximum file size limit of 1 MB
* Maximum line count limit of 100,000 lines
* Check file size before reading to prevent DoS attacks
MEDIUM Priority Fixes:
- Remove code duplication:
* Move is_hostlist_expression() and looks_like_hostlist_range()
from src/main.rs and src/app/nodes.rs to src/hostlist/mod.rs
* Export functions as public API from hostlist module
* Update all call sites to use the exported functions
- Remove unused variable:
* Remove unused 'sign' variable from parse_number() in parser.rs
- Add overflow protection:
* Use checked_mul() for cartesian product allocations in expander.rs
* Return RangeTooLarge error if overflow would occur
* Prevent integer overflow in intermediate calculations
All changes compile successfully and pass tests (cargo test, cargo clippy).
59ff34f
into
feature/issue-98-hostlist-expression
1 check passed
inureyes
added a commit
that referenced
this pull request
Dec 16, 2025
* feat: Add pdsh-style hostlist expression support (#98) Implement range expansion syntax for specifying multiple hosts: - Simple ranges: node[1-5] -> node1, node2, node3, node4, node5 - Zero-padded: node[01-05] -> node01, node02, node03, node04, node05 - Comma-separated: node[1,3,5] -> node1, node3, node5 - Mixed: node[1-3,7] -> node1, node2, node3, node7 - Cartesian product: rack[1-2]-node[1-3] -> 6 hosts - File input: ^/path/to/file reads hosts from file Integrate with -H option, --filter, and --exclude options. Add 52 unit tests for hostlist module. * fix: Address PR review findings - resource limits and code cleanup (#108) * fix: Address PR review findings - resource limits and code cleanup HIGH Priority Fixes: - Add resource exhaustion protection in parse_hostfile(): * Maximum file size limit of 1 MB * Maximum line count limit of 100,000 lines * Check file size before reading to prevent DoS attacks MEDIUM Priority Fixes: - Remove code duplication: * Move is_hostlist_expression() and looks_like_hostlist_range() from src/main.rs and src/app/nodes.rs to src/hostlist/mod.rs * Export functions as public API from hostlist module * Update all call sites to use the exported functions - Remove unused variable: * Remove unused 'sign' variable from parse_number() in parser.rs - Add overflow protection: * Use checked_mul() for cartesian product allocations in expander.rs * Return RangeTooLarge error if overflow would occur * Prevent integer overflow in intermediate calculations All changes compile successfully and pass tests (cargo test, cargo clippy). * docs: Add HOSTLIST EXPRESSIONS section and update option docs in manpage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement range expansion syntax for specifying multiple hosts:
Integrate with -H option, --filter, and --exclude options.
Add 52 unit tests for hostlist module.HIGH Priority Fixes:
MEDIUM Priority Fixes:
Remove code duplication:
from src/main.rs and src/app/nodes.rs to src/hostlist/mod.rs
Remove unused variable:
Add overflow protection:
All changes compile successfully and pass tests (cargo test, cargo clippy).