Fix building on Windows (#2008)

Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
This commit is contained in:
S7evinK 2021-11-02 17:50:59 +01:00 committed by GitHub
parent dec05c3347
commit 0c2872828b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 134 additions and 64 deletions

View file

@ -22,7 +22,6 @@ import (
"io/ioutil"
"os"
"strings"
"syscall"
"github.com/matrix-org/dendrite/setup"
"github.com/matrix-org/dendrite/setup/config"
@ -121,13 +120,13 @@ func getPassword(password, pwdFile *string, pwdStdin, askPass *bool, r io.Reader
// ask the user to provide the password
if *askPass {
fmt.Print("Enter Password: ")
bytePassword, err := term.ReadPassword(syscall.Stdin)
bytePassword, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
logrus.Fatalln("Unable to read password:", err)
}
fmt.Println()
fmt.Print("Confirm Password: ")
bytePassword2, err := term.ReadPassword(syscall.Stdin)
bytePassword2, err := term.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
logrus.Fatalln("Unable to read password:", err)
}