summaryrefslogtreecommitdiffstats
path: root/src/pwgui/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pwgui/main.cpp')
-rw-r--r--src/pwgui/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pwgui/main.cpp b/src/pwgui/main.cpp
index c33b3f6..77ec7f0 100644
--- a/src/pwgui/main.cpp
+++ b/src/pwgui/main.cpp
@@ -126,6 +126,8 @@ int main(int argc, char *argv[])
// Seems we need the dialog
int status;
+ char creds[NAMELEN], *pass = NULL;
+ snprintf(creds, NAMELEN, "%s", argv[3]);
do {
int pfd[2];
if (pipe(pfd) != 0) {
@@ -139,7 +141,7 @@ int main(int argc, char *argv[])
helper_dropprivs();
helper_copyenv();
QApplication a(argc, argv);
- PwGui w(pfd[1]);
+ PwGui w(pfd[1], creds);
w.show();
exit(a.exec());
return CUPS_BACKEND_FAILED;
@@ -147,8 +149,8 @@ int main(int argc, char *argv[])
// Main (Parent)
close(pfd[1]);
// Read from pipe
- char creds[NAMELEN], *pass = NULL;
int bytes = read(pfd[0], creds, NAMELEN - 1);
+ close(pfd[0]);
// Wait for child to die
waitpid(pid, NULL, 0); // Don't check status, just look at pipe data
if (bytes <= 0) {