1
0
Fork 0

Merge branch 'v1.5' into master

This commit is contained in:
Fernandez Ludovic 2018-03-02 15:21:33 +01:00
commit bf43149d7e
293 changed files with 23915 additions and 1441 deletions

View file

@ -93,5 +93,13 @@ func ReadPassword(fd int) ([]byte, error) {
windows.SetConsoleMode(windows.Handle(fd), old)
}()
return readPasswordLine(os.NewFile(uintptr(fd), "stdin"))
var h windows.Handle
p, _ := windows.GetCurrentProcess()
if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
return nil, err
}
f := os.NewFile(uintptr(h), "stdin")
defer f.Close()
return readPasswordLine(f)
}