From b5a992e2f21b7b7c09e0d341750742a982d9efbc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 26 Feb 2014 16:15:32 +0100 Subject: Fix: run_backend returned wrong status code --- src/pwgui/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp index 1f7ddab..8cccccd 100644 --- a/src/pwgui/main.cpp +++ b/src/pwgui/main.cpp @@ -85,6 +85,7 @@ int main(int argc, char *argv[]) // argv[3] is title, get printergui pid from it if (!helper_getpiduid(argv[2], argv[3])) { // El cheapo validation failed. Don't enable "smart mode" (GUI etc), just exec real backend + fputs("ERROR: Dumb mode - will exec actual backend.\n", stderr); // Mimic cups behaviour wrt dropping privs (Only 0700 or 0500 == root) helper_loadlpuser(); struct stat st; @@ -151,6 +152,7 @@ int main(int argc, char *argv[]) char creds[NAMELEN], *pass = NULL; snprintf(creds, NAMELEN, "%s", argv[2]); do { + fputs("ERROR: Opening PW dialog....\n", stderr); int pfd[2]; if (pipe(pfd) != 0) { helper_error("PrinterGUI", "Konnte pipe für die GUI nicht anlegen."); @@ -273,7 +275,7 @@ static int run_backend(char *backend, char *uri, char *jobid, char *user, char * } status = WEXITSTATUS(status); if (status != CUPS_BACKEND_OK) fprintf(stderr, "ERROR: Backend returned %d\n", status); - return WEXITSTATUS(status); + return status; } static bool helper_getpiduid(char *user, char *title) -- cgit v1.2.3-55-g7522