Hey all,
i created a dialog(similar to kdesu) that asks for root's password before running my application. my idea was simple:
i connect my ok btn in a new slot and the "su" command process is executed.
checkRootPWDproc->start("su");
checkRootPWDproc->write(rootpwd);
checkRootPWDproc->closeWriteChannel();
connect( checkRootPWDproc,
SIGNAL(finished
(int,
QProcess::ExitStatus)),
this,
SLOT(checkRootPWDprocFinished
()));
checkRootPWDproc = new QProcess(this);
checkRootPWDproc->start("su");
checkRootPWDproc->write(rootpwd);
checkRootPWDproc->closeWriteChannel();
connect( checkRootPWDproc, SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(checkRootPWDprocFinished()));
To copy to clipboard, switch view to plain text mode
where rootpwd = tha root password that user entered in my qlineedit box at the dialog.
in the "checkRootPWDprocFinished()" slot the idea is to do some error checking and check if root password is correct blah blah blah but for completing the qprocess side of thinks ive just wrote a simple "exit(1)" 
so with the above code the thing i want to do is when the su command is executed, it prompts for a password, so i use the write() function to write the user-given password and then close the writechannel and w8 for the command to finish.
the application compiles ok but when i enter the root pwd and press "ok" that application does nothing! (it doesnt even terminate as it supposed to be with 'exit(1);')...
so.. please help
Bookmarks