mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
fix: set modTime to current in snowball if archive shows empty (#16482)
This commit is contained in:
parent
8fa80874a6
commit
027ff0f3a8
@ -30,6 +30,7 @@ import (
|
||||
"path"
|
||||
"runtime"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/cosnicolaou/pbzip2"
|
||||
"github.com/klauspost/compress/s2"
|
||||
@ -259,6 +260,12 @@ func untar(ctx context.Context, r io.Reader, putObject func(reader io.Reader, in
|
||||
continue
|
||||
}
|
||||
|
||||
// If zero or earlier modtime, set to current.
|
||||
// Otherwise the resulting objects will be invalid.
|
||||
if header.ModTime.UnixNano() <= 0 {
|
||||
header.ModTime = time.Now()
|
||||
}
|
||||
|
||||
// Sync upload.
|
||||
rc := disconnectReader{r: tarReader}
|
||||
if err := putObject(&rc, header.FileInfo(), name); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user