mirror of https://github.com/apache/jclouds.git
Fix TOCTOU issue when getting blob during removal
Fixes gaul/s3proxy#318.
This commit is contained in:
parent
ec0ef7c9ff
commit
05573fa108
|
@ -632,14 +632,14 @@ public final class LocalBlobStore implements BlobStore {
|
||||||
logger.debug("Container %s does not exist", containerName);
|
logger.debug("Container %s does not exist", containerName);
|
||||||
throw cnfe(containerName);
|
throw cnfe(containerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the blob doesn't exist, a null object is returned
|
// If the blob doesn't exist, a null object is returned
|
||||||
if (!storageStrategy.blobExists(containerName, key)) {
|
Blob blob = loadBlob(containerName, key);
|
||||||
|
if (blob == null) {
|
||||||
logger.debug("Item %s does not exist in container %s", key, containerName);
|
logger.debug("Item %s does not exist in container %s", key, containerName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Blob blob = loadBlob(containerName, key);
|
|
||||||
|
|
||||||
if (options != null) {
|
if (options != null) {
|
||||||
String eTag = blob.getMetadata().getETag();
|
String eTag = blob.getMetadata().getETag();
|
||||||
if (eTag != null) {
|
if (eTag != null) {
|
||||||
|
|
Loading…
Reference in New Issue