#include <string.h>
#include <sys/types.h>
#include <unistd.h>
-#include <termios.h>
#include "nm-default.h"
#include "polkit-agent.h"
gpointer user_data)
{
char *response, *tmp, *p;
- struct termios termios_orig, termios_new;
g_print ("%s\n", message);
g_print ("(action_id: %s)\n", action_id);
- if (!echo_on) {
- tcgetattr (STDIN_FILENO, &termios_orig);
- termios_new = termios_orig;
- termios_new.c_lflag &= ~(ECHO);
- tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_new);
- }
-
/* Ask user for polkit authorization password */
if (user) {
/* chop of ": " if present */
p = strrchr (tmp, ':');
if (p && !strcmp (p, ": "))
*p = '\0';
- response = nmc_readline ("%s (%s): ", tmp, user);
+ response = nmc_readline_echo (echo_on, "%s (%s): ", tmp, user);
g_free (tmp);
} else
- response = nmc_readline ("%s", request);
+ response = nmc_readline_echo (echo_on, "%s", request);
g_print ("\n");
- /* Restore original terminal settings */
- if (!echo_on)
- tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig);
-
return response;
}