Repository navigation
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Yu Chen (jsntcy),
ZelinWang (wangzelin007) and
Yong Zhang (yonzhan)
October 6, 2026 05:58
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Root paths are still created as directories, expanded Git Bash paths remain invalid, and regression coverage is missing.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Prevents unbounded parent traversal during Storage file batch uploads.
Changes:
- Stops directory traversal when
dirname()reaches a fixed point.
| File | Description |
|---|---|
storage/operations/file.py |
Adds termination logic for absolute paths. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| parents = [directory_path] | ||
| p = os.path.dirname(directory_path) | ||
| while p: | ||
| while p and p != parents[-1]: |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
JiaSeng-v
force-pushed
the
fix/issues_32147
branch
from
October 6, 2026 08:08
7fd43b0 to
53548ca
Compare
This branch has not been deployed
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.

Related command
az storage file upload-batchDescription
Fix #32147
az storage file upload-batch: Fix infinite loop/crash when --destination-path is an absolute path_make_directory_in_files_share()climbs parent directories usingos.path.dirname()until it returns a falsy value. For an absolute path,dirname()returns the root itself forever (e.g.'C:/' -> 'C:/','/' -> '/'), so the loop never terminated — theparentslist grew unbounded, consuming memory until the process crashed withMemoryError. This was reported with git bash, which silently expands a leading/(e.g./some/path) into an absolute path (e.g.C:/Program Files/Git/some/path) before the CLI ever sees it, but the bug affects any absolute--destination-pathregardless of shell.Fix: stop the loop once
dirname()stops making progress (i.e. returns the same path as the last one recorded), instead of relying on it eventually becoming empty.Testing Guide
az storage file upload-batch --destination --source --destination-path "/some/path" --account-key
Should complete normally (creating
/some/pathat the share root) instead of hanging/crashing withMemoryError.History Notes
[Storage] Fix #32147:
az storage file upload-batch: Fix infinite loop/crash when--destination-pathis an absolute pathThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.