mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
Creating symlinks on Windows requires administrator privileges or Developer Mode, so NewBundle fails with "A required privilege is not held by the client" when containerd creates a task without them. Replace the direct os.Symlink and os.Readlink calls with platform specific helpers. On non-Windows platforms they keep the existing symlink behaviour. On Windows, createWorkLink creates a directory junction using go-winio's reparse point encoding, which does not need elevated privileges. os.Readlink resolves both symlinks and junctions, so resolveWorkLink uses it on both platforms. createWorkLink closes the directory handle before removing the half-created junction directory on failure. The handle is opened without sharing, so removing the directory while it is still open would fail. Signed-off-by: Craig Gumbley <craiggumbley@gmail.com> Signed-off-by: Eric Curtin <eric.curtin@docker.com> Assisted-by: OpenCode (anthropic/claude-sonnet-5-5)