Elevated DCP on Windows 10 rejects every drive-letter path as a reparse point
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
Start with the elevation switch and the open path in pkg/io/file_windows.go (lines 65-79 and 176-205), then the error mapping at lines 492-508, and the kubeconfig write in pkg/kubeconfig/kubeconfig.go (lines 76-96). Reproduce by running dcp start-apiserver elevated on Windows with a path under C:\temp. Done means an elevated run writes the kubeconfig and diagnostics log on a drive-letter path, with a Windows test covering it.
索引モデルが issue の本文から書いたものです。
説明
Since v0.26.0 (993ca71, "Windows file hardening"), an elevated DCP on Windows creates files through
openRestrictedFile, which opens \??\ + the absolute path with OBJ_DONT_REPARSE. On Windows 10 22H2 the \??\X:
drive-letter symbolic link itself counts as a reparse, so the open fails with STATUS_REPARSE_POINT_ENCOUNTERED for
every path on every drive, whether or not the path contains junctions or symlinks. The kubeconfig is written through
this path, so start-apiserver exits before the API server starts.
Non-elevated DCP uses plain os.OpenFile and is unaffected. v0.24.3 works elevated on the same machine.
Impact
An Aspire 13.6.x AppHost started from an elevated Visual Studio or terminal times out after 60 s in
KubernetesService.EnsureKubernetesAsync (Polly.Timeout.TimeoutRejectedException). With --detach the child's
error never reaches the caller, so the timeout is the only symptom. Aspire 13.4.6 (DCP 0.24.3) worked in the same
setup.
Repro
From an elevated prompt:
dcp.exe start-apiserver --server-only --kubeconfig C:\temp\dcp\kubeconfig
could not write kubeconfig file "C:\temp\dcp\kubeconfig": restricted file policy: ... restricted file path traverses a
reparse point: ...; choose an absolute path on a fixed local ACL-capable drive without junction or symlink ancestors
The same failure shows up for diagnostics logs when DCP_DIAGNOSTICS_LOG_FOLDER is set:
failed to enable diagnostics log output: failed to create log file: restricted file policy: restricted file path
contains a reparse point: restricted file path traverses a reparse point: open
C:\temp\dcp-logs\15155557_dec53d9f-start-apiserver-f224f790.log: The object manager encountered a reparse point while
retrieving an object.
No component of C:\temp\dcp-logs or %TEMP% is a reparse point (fsutil reparsepoint query, file attributes).
Cause
NtCreateFile with FILE_READ_ATTRIBUTES, FILE_OPEN, non-elevated, Windows 10 Enterprise 22H2 (19045.7725):
| Object name | Attributes | Status |
|---|---|---|
\??\C:\Windows\win.ini |
OBJ_CASE_INSENSITIVE |
0x00000000 |
\??\C:\Windows\win.ini |
OBJ_CASE_INSENSITIVE | OBJ_DONT_REPARSE |
0xC000050B |
\Device\HarddiskVolume3\Windows\win.ini |
OBJ_CASE_INSENSITIVE | OBJ_DONT_REPARSE |
0x00000000 |
Paths on other fixed drives behave the same. Windows 11 and Server 2022/2025 not checked.
Code at v0.26.5:
- Elevation switch:
pkg/io/file_windows.go#L65-L79 - Open with
OBJ_DONT_REPARSE:
pkg/io/file_windows.go#L176-L205 - Error mapping:
pkg/io/file_windows.go#L492-L508 - Kubeconfig write:
pkg/kubeconfig/kubeconfig.go#L76-L96
Suggested fix
Resolve the drive letter to its NT device path (QueryDosDevice) before building the object name, or open the volume
root without OBJ_DONT_REPARSE and open the remaining components relative to that handle with it.
Separately, a --detach child that fails before writing the kubeconfig should report the failure to the parent (or
exit the parent non-zero), instead of leaving the caller to time out.
Environment
- DCP 0.26.5 (51648b2a), via Aspire.Hosting.Orchestration.win-x64 13.6.1
- Win10, Visual Studio run as administrator
- Workaround: run the AppHost non-elevated
- 主要言語
- Go
- スター
- 191
- フォーク
- 26
- 平均マージ
- 1日 1時間
- マージ済み PR(30日)
- 16
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/dcp のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Add application iconオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:session-state issue-rating: 🦞 diamond lobster no-stale P2
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
openclaw/wacli#503 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
apache/rocketmq-dashboard#6895 ·
メンテナーはふだん 3 日以内に返信
-
agent-butler-finding chore
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
jordansmall/spindrift#5466 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
open-telemetry/opentelemetry-go-compile-instrumentation#1507 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 87/100
777genius/agent-notifications#490 ·
メンテナーはふだん 1 日以内に返信