c8a8c3e
--- cups-1.2.6/cups/usersys.c.getpass	2006-08-29 16:51:19.000000000 +0100
9793260
+++ cups-1.2.6/cups/usersys.c	2006-11-13 16:19:32.000000000 +0000
9793260
@@ -46,6 +46,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>
c8a8c3e
 #endif /* WIN32 */
9793260
@@ -455,7 +457,29 @@
c8a8c3e
 const char *				/* O - Password */
c8a8c3e
 _cupsGetPassword(const char *prompt)	/* I - Prompt string */
c8a8c3e
 {
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
 }
c8a8c3e
 #endif /* WIN32 */
c8a8c3e