mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Use os.ReadFile instead of ioutil.ReadFile (#17649)
ioutil.ReadFile is deprecated and also doesn't work with certain kinds of symlinks.
This commit is contained in:
parent
5e2f8d7a42
commit
fc6d873758
@ -23,11 +23,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/minio/cli"
|
"github.com/minio/cli"
|
||||||
"github.com/minio/minio/internal/ioutil"
|
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
"github.com/pkg/sftp"
|
"github.com/pkg/sftp"
|
||||||
ftp "goftp.io/server/v2"
|
ftp "goftp.io/server/v2"
|
||||||
@ -117,7 +117,7 @@ func startSFTPServer(c *cli.Context) {
|
|||||||
logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is mandatory for --sftp='ssh-private-key=path/to/id_ecdsa'"), "unable to start SFTP server")
|
logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is mandatory for --sftp='ssh-private-key=path/to/id_ecdsa'"), "unable to start SFTP server")
|
||||||
}
|
}
|
||||||
|
|
||||||
privateBytes, err := ioutil.ReadFile(sshPrivateKey)
|
privateBytes, err := os.ReadFile(sshPrivateKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is not accessible: %v", err), "unable to start SFTP server")
|
logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is not accessible: %v", err), "unable to start SFTP server")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user