Files
Paweł Gronowski 2533b708fa worker: Make workerid deletable by owner
Create workerid with 0600 on all platforms.
The worker ID needs no protection from its owner, the worker root is
already 0700, and the metadata_v2.db next to it uses 0600.
Keeping 0400 on Unix would need a per-platform mode for no benefit.

Cleaning Docker Desktop's Windows data directory failed on on the
workerid file:

```
Failed to delete Windows daemon artifact 'C:\ProgramData\Docker\buildkit': Access to the path 'workerid' is denied.
```

On Windows, Go maps 0400 mode to a create mode without the owner write
bit to FILE_ATTRIBUTE_READONLY. Go's os.Remove clears the attribute and
retries, so Go tools did not notice.
However ordinary deletions (via .NET File.Delete, Directory.Delete or
PowerShell Remove-Item without -Force) failed.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-09 17:03:33 +02:00
..