Skip to content

Commit

Permalink
fix: fix removal of the upload directory in posix CompleteMultipartUp…
Browse files Browse the repository at this point in the history
…load

In the posix backend, the path argument to os.RemoveAll() does not
start with the bucket name. Since the path does not exist,
os.RemoveAll() does nothing and uploaded parts are left in the
".sgwtmp" directory.

This commit prefixes the path with the bucket name.

Fixes issue #626.

Signed-off-by: Christophe Vu-Brugier <[email protected]>
  • Loading branch information
cvubrugier committed Jun 12, 2024
1 parent c6e1757 commit db314a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/posix/posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ func (p *Posix) CompleteMultipartUpload(ctx context.Context, input *s3.CompleteM
}

// cleanup tmp dirs
os.RemoveAll(upiddir)
os.RemoveAll(filepath.Join(bucket, objdir, uploadID))
// use Remove for objdir in case there are still other uploads
// for same object name outstanding, this will fail if there are
os.Remove(filepath.Join(bucket, objdir))
Expand Down

0 comments on commit db314a4

Please sign in to comment.