Skip to content

fix: azure blob writes fail with permission mismatch when the SAS lacks the tag permission - #5

Open
locle2302 wants to merge 1 commit into
masterfrom
fix/azure-empty-tags-header
Open

fix: azure blob writes fail with permission mismatch when the SAS lacks the tag permission#5
locle2302 wants to merge 1 commit into
masterfrom
fix/azure-empty-tags-header

Conversation

@locle2302

@locle2302 locle2302 commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Passes nil instead of an empty azblob.BlobTagsMap{} to the azblob SDK in PutBlob, CommitBlockList, and StartCopyFromURL, so blob write requests no longer carry an empty x-ms-tags header.

Why is this PR needed?

The SDK's SerializeBlobTagsHeader only omits the x-ms-tags header when the tags map is nil; an empty map serializes to an empty header. Azure treats any request carrying x-ms-tags as an attempt to set blob tags, which requires the t permission on the SAS. The platform issues user-delegation SAS tokens with sp=racwdl, so every write through a goofys mount fails with 403 AuthorizationPermissionMismatch, surfacing as Permission denied on file close. Reads and lists are unaffected.

Steps to Reproduce

  1. Mount an Azure container with a user-delegation SAS that has sp=racwdl (no t).
  2. cp somefile /bucket/ — fails with failed to close: Permission denied; goofys logs show PutBlob rejected with AuthorizationPermissionMismatch.
  3. Same 403 reproduces with plain curl by adding an empty x-ms-tags header to a PUT that otherwise succeeds; with this fix, writes through the mount succeed.

@locle2302 locle2302 self-assigned this Jul 22, 2026
@locle2302
locle2302 requested a review from giraffesyo July 22, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant