Repository: minio/minio (language: go)

Issue:
snowball zero ModTime (internal error: invalid version entry generated)
I tried to upload snowball (golang).

## Expected Behavior
n/a

## Current Behavior
```
UserAgent: MinIO (linux; amd64) minio-go/v7.0.47
Error: internal error: invalid version entry generated (*errors.errorString)
       5: /home/danil_e71/minio/internal/logger/logger.go:258:logger.LogIf()
       4: /home/danil_e71/minio/cmd/api-errors.go:2235:cmd.toAPIErrorCode()
       3: /home/danil_e71/minio/cmd/api-errors.go:2260:cmd.toAPIError()
       2: /home/danil_e71/minio/cmd/object-handlers.go:2224:cmd.objectAPIHandlers.PutObjectExtractHandler()
       1: net/http/server.go:2109:http.HandlerFunc.ServeHTTP()
```

## Possible Solution
You must set ModTime

```
	input <- minio.SnowballObject{
		ModTime: time.Now(),
```

## Steps to Reproduce (for bugs)

```
	input <- minio.SnowballObject{
		ModTime: 0, 
```

## Context
In previous versions zero modtime is no bug.

[cmd/xl-storage-format-v2.go
](https://github.com/minio/minio/blob/master/cmd/xl-storage-format-v2.go#L324)

## Regression
n/a

## Your Environment
* Version used minio/minio:RELEASE.2023-01-25T00-19-54Z



Discussion / hints:
We should probably set these objects to current time.

@harshavardhana Should we do it in the uploader, in minio, or both places?
@klauspost I thought the tar preserves the mtime here ? 
> input <- minio.SnowballObject{
> 		ModTime: time.Now(),

This is already set in our examples - where did you generate an object without modtime? https://github.com/minio/minio-go/blob/master/examples/minio/putobjectsnowball.go#L89 

@Danile71 
@harshavardhana 
the text of the error does not describe the error itself.
There was a legacy code without modtime and it worked in the old version of minio (automatically set modtime)
> @harshavardhana the text of the error does not describe the error itself. There was a legacy code without modtime and it worked in the old version of minio (automatically set modtime)
 
Our examples have always reflected using ModTime @Danile71 you should fix your client code as well.  We cannot allow 0-modtime objects that are wrong, that is what is rejected right now.

We will also use time.Now() on the server side as well if we see client sending us 0 modTime. 
@harshavardhana thanks, the client is already fixed)
https://github.com/minio/minio-go/pull/1763

And sending a similar check for the server.

Fix patch:
diff --git a/cmd/untar.go b/cmd/untar.go
index 4d6698aebd0b7..1434624831341 100644
--- a/cmd/untar.go
+++ b/cmd/untar.go
@@ -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 {


Test patch: