Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Elevated DCP on Windows 10 rejects every drive-letter path as a reparse point

オープン
#296 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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:

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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/dcp のほかの issue

microsoft/dcp の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。