X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/9b0be715cfb2f9ca455c16a9de01b9c7a947a07c..24b2afcb2f3745654bd3a7e4fa8c4a8f42a9b1b8:/src/client.sml diff --git a/src/client.sml b/src/client.sml index 00000e7..a92b13f 100644 --- a/src/client.sml +++ b/src/client.sml @@ -25,12 +25,15 @@ datatype passwd_result = | Aborted | Error +fun hastty () = + Posix.ProcEnv.isatty Posix.FileSys.stdin + fun getpass () = let val tty = Posix.FileSys.stdin val termios = SOME (Posix.TTY.TC.getattr tty) handle OS.SysErr (reason, SOME syserr) => - if syserr = Posix.Error.notty then + if syserr = Posix.Error.notty orelse syserr = Posix.Error.inval then (print "Warning: no terminal found, not hiding password\n"; TextIO.flushOut TextIO.stdOut; NONE)