Check if user pressed cancel in password dialog

This commit is contained in:
Vedran Ljubovic 2006-09-11 12:47:48 +00:00
parent 5302de7db9
commit 84f54567c1
3 changed files with 3 additions and 4 deletions

View File

@ -153,9 +153,8 @@ tryagain:
// Run program as root using su or sudo
char *line;
// TODO: fix password dialog so that Cancel can be detected
// At the moment it's impossible to tell if the password is blank
const char *pwd = password(_("This program requires administrator privileges.\nPlease enter your password below:"));
if (pwd == 0) return EDERUN_USER_CANCELED;
// Chat routine
while (1) {

View File

@ -62,6 +62,7 @@ enum{
EDERUN_WAITPID_FAILED = 65531,
EDERUN_EXECVE_FAILED = 65530,
EDERUN_PTY_FAILED = 65529
EDERUN_USER_CANCELED = 65528
};

View File

@ -453,9 +453,8 @@ tryagain:
if (param_root) {
char *line;
// TODO: fix password dialog so that Cancel can be detected
// At the moment it's impossible to tell if the password is blank
const char *pwd = password(_("This program requires administrator privileges.\nPlease enter your password below:"));
if (pwd == 0) { fprintf(stderr,"Canceled\n"); exit(1); }
// Chat routine
while (1) {