a5bc511
diff -up cups-1.4.4/cups/usersys.c.getpass cups-1.4.4/cups/usersys.c
a5bc511
--- cups-1.4.4/cups/usersys.c.getpass	2010-03-30 23:07:33.000000000 +0100
a5bc511
+++ cups-1.4.4/cups/usersys.c	2010-06-18 09:38:08.368096897 +0100
a5bc511
@@ -41,6 +41,8 @@
c8a8c3e
 #include "globals.h"
c8a8c3e
 #include <stdlib.h>
c8a8c3e
 #include <sys/stat.h>
c8a8c3e
+#include <termios.h>
9793260
+#include <signal.h>
c8a8c3e
 #ifdef WIN32
c8a8c3e
 #  include <windows.h>
a5bc511
 #else
a5bc511
@@ -406,7 +408,29 @@ _cupsGetPassword(const char *prompt)	/* 
a5bc511
   * Use the standard getpass function to get a password from the console.
a5bc511
   */
a5bc511
 
c8a8c3e
-  return (getpass(prompt));
c8a8c3e
+  static char password[100];
9793260
+  struct termios oldtio, newtio;
9793260
+  sigset_t oldset, newset;
c8a8c3e
+  int nread;
9793260
+  sigprocmask (SIG_BLOCK, NULL, &newset);
9793260
+  sigaddset (&newset, SIGINT);
9793260
+  sigaddset (&newset, SIGTSTP);
9793260
+  sigprocmask (SIG_BLOCK, &newset, &oldset);
9793260
+  tcgetattr (STDIN_FILENO, &oldtio);
9793260
+  newtio = oldtio;
9793260
+  newtio.c_lflag &= ~ECHO;
9793260
+  tcsetattr (STDIN_FILENO, TCSAFLUSH, &newtio);
c8a8c3e
+  fputs (prompt, stdout);
c8a8c3e
+  fflush (stdout);
c8a8c3e
+  nread = read (STDIN_FILENO, password, sizeof (password));
9793260
+  tcsetattr (STDIN_FILENO, TCSAFLUSH, &oldtio);
c8a8c3e
+  fputc ('\n', stdout);
9793260
+  sigprocmask (SIG_SETMASK, &oldset, NULL);
c8a8c3e
+  if (nread > 0)
c8a8c3e
+    password[nread - 1] = '\0';
c8a8c3e
+  else
c8a8c3e
+    password[0] ='\0';
c8a8c3e
+  return password;
c8a8c3e
 #endif /* WIN32 */
a5bc511
 }
c8a8c3e