Skip to content

Commit

Permalink
Patch for destination length check with no read permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
gapra-msft committed Oct 25, 2023
1 parent a756368 commit b09722e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@

# Change Log

## Version 10.21.1

### Bug Fixes

1. Fixed an issue where validating destination length would fail a job instead of logging the error if read permissions are not provided.

## Version 10.21.0

### New Features
Expand Down
2 changes: 1 addition & 1 deletion common/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package common

const AzcopyVersion = "10.21.0"
const AzcopyVersion = "10.21.1"
const UserAgent = "AzCopy/" + AzcopyVersion
const S3ImportUserAgent = "S3Import " + UserAgent
const GCPImportUserAgent = "GCPImport " + UserAgent
Expand Down
6 changes: 4 additions & 2 deletions ste/xfer-anyToRemote-file.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"crypto/md5"
"errors"
"fmt"
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob"
"hash"
"net/http"
Expand Down Expand Up @@ -552,8 +553,9 @@ func epilogueWithCleanupSendToRemote(jptm IJobPartTransferMgr, s sender, sip ISo
shouldCheckLength := true
destLength, err := s.GetDestinationLength()

if resp, respOk := err.(pipeline.Response); respOk && resp.Response() != nil &&
resp.Response().StatusCode == http.StatusForbidden {
var respErr *azcore.ResponseError
resp, respOk := err.(pipeline.Response)
if (respOk && resp.Response() != nil && resp.Response().StatusCode == http.StatusForbidden) || (errors.As(err, &respErr) && respErr.StatusCode == http.StatusForbidden) {
// The destination is write-only. Cannot verify length
shouldCheckLength = false
checkLengthFailureOnReadOnlyDst.Do(func() {
Expand Down

0 comments on commit b09722e

Please sign in to comment.