Commit 607d1550 authored by Loïck Bonniot's avatar Loïck Bonniot

[c] Fix password question on non-unix terminals

parent c17cfe72
Pipeline #301 passed with stage
......@@ -80,6 +80,15 @@ func readIntParam(message, def string, ptr *int) {
// Get the password from standard input
func readPassword(ptr *string, needConfirm bool) error {
if !terminal.IsTerminal(0) {
fmt.Println("+------------------------- WARNING --------------------------+")
fmt.Println("| This is not a UNIX terminal, your password will be visible |")
fmt.Println("+------------------------- WARNING --------------------------+")
readStringParam("Enter your passphrase", "", ptr)
return nil
}
oldState, err := terminal.MakeRaw(0)
if err != nil {
return err
......
......@@ -77,8 +77,8 @@ func (r *ContractRepository) GetWaitingForUser(email string) ([]Contract, error)
"ready": false,
"signers": bson.M{
"$elemMatch": bson.M{
"email" : email,
"hash" : "",
"email": email,
"hash": "",
}},
}, &res)
return res, err
......
......@@ -244,7 +244,7 @@ func launchMissedContracts(manager *mgdb.MongoManager, user *entities.User) {
repository := entities.NewContractRepository(manager.Get("contracts"))
contracts, err := repository.GetWaitingForUser(user.Email)
if err != nil {
log.Println("Cannot get missed contracts for user", user.Email + ":", err)
log.Println("Cannot get missed contracts for user", user.Email+":", err)
}
for _, c := range contracts {
......@@ -263,7 +263,7 @@ func launchMissedContracts(manager *mgdb.MongoManager, user *entities.User) {
// Update contract in database
_, err = repository.Collection.UpdateByID(c)
if err != nil {
log.Println("Cannot update missed contract", c.ID, "for user", user.Email + ":", err)
log.Println("Cannot update missed contract", c.ID, "for user", user.Email+":", err)
}
if c.Ready {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment