Skip to content

fix: harden configuration path handling - #1263

Merged
hidb4ai merged 2 commits into
oceanbase:masterfrom
askdb:fix/1262-config-path-handling
Oct 10, 2026
Merged

hidb4ai merged 2 commits into
oceanbase:masterfrom
askdb:fix/1262-config-path-handling

Conversation

@askdb

@askdb askdb commented Oct 10, 2026

Copy link
Copy Markdown
Member

Summary

Invalid deployment paths in configuration can reach shell commands and cause failures or unintended shell interpretation. This change validates effective observer and obproxy paths during configuration loading and consistently quotes paths in version, PID, configuration-check, and I/O device-discovery commands.

Closes #1262

Solution Description

  • Validate observer home_path, data_dir, and redo_dir, and obproxy home_path, after applying node overrides and global defaults. Report the affected node and field for invalid values.
  • Accept absolute paths, ~, and ~/ paths with supported characters; reject empty values, non-string values, unsupported relative paths, whitespace, and shell metacharacters.
  • Preserve execution-host home-directory expansion when quoting ~ paths and use POSIX path joins for remote commands.
  • Add 12 regression tests for validation, inheritance, defaults, home-relative paths, and downstream command construction.
  • Document supported path formats in the English and Chinese README files.

Validation

Validated in an isolated environment using Python 3.14.3 on macOS:

python -m pytest test/common/test_config_path_handling.py test/common/test_config_parse.py test/common/test_config_helper.py -q
20 passed, 16 subtests passed

python -m pytest test/common/test_command.py -q
16 passed

git diff HEAD^ HEAD --check
Passed

The runs emitted existing invalid-escape and dependency deprecation warnings. No live OceanBase cluster integration test was performed.

Compatibility

Existing defaults and node-over-global precedence are unchanged. Unsupported configured paths now fail early with a field-specific error instead of reaching downstream commands.

askdb added 2 commits October 10, 2026 10:55
- improve validation for configuration path fields
- standardize downstream path handling
- add regression coverage for boundary inputs

Related to oceanbase#1262

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@hidb4ai
hidb4ai merged commit 9f02d9f into oceanbase:master Oct 10, 2026
16 checks passed
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.

[Enhancement]: Improve Validation and Handling of Configuration Path Fields

2 participants