mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Check if user pressed cancel in password dialog
This commit is contained in:
parent
5302de7db9
commit
84f54567c1
@ -153,9 +153,8 @@ tryagain:
|
|||||||
// Run program as root using su or sudo
|
// Run program as root using su or sudo
|
||||||
char *line;
|
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:"));
|
const char *pwd = password(_("This program requires administrator privileges.\nPlease enter your password below:"));
|
||||||
|
if (pwd == 0) return EDERUN_USER_CANCELED;
|
||||||
|
|
||||||
// Chat routine
|
// Chat routine
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -62,6 +62,7 @@ enum{
|
|||||||
EDERUN_WAITPID_FAILED = 65531,
|
EDERUN_WAITPID_FAILED = 65531,
|
||||||
EDERUN_EXECVE_FAILED = 65530,
|
EDERUN_EXECVE_FAILED = 65530,
|
||||||
EDERUN_PTY_FAILED = 65529
|
EDERUN_PTY_FAILED = 65529
|
||||||
|
EDERUN_USER_CANCELED = 65528
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -453,9 +453,8 @@ tryagain:
|
|||||||
if (param_root) {
|
if (param_root) {
|
||||||
char *line;
|
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:"));
|
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
|
// Chat routine
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user