summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
index d8b1014..57118c9 100644
--- a/noncore/settings/sshkeys/sshkeys.cpp
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -25,44 +25,51 @@
25#include <qfile.h> 25#include <qfile.h>
26#include <qmultilineedit.h> 26#include <qmultilineedit.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qlistview.h> 28#include <qlistview.h>
29#include <qcombobox.h> 29#include <qcombobox.h>
30 30
31#include <sys/types.h> 31#include <sys/types.h>
32#include <sys/stat.h> 32#include <sys/stat.h>
33#include <fcntl.h> 33#include <fcntl.h>
34#include <sys/ioctl.h> 34#include <sys/ioctl.h>
35#include <stdlib.h> 35#include <stdlib.h>
36#include <unistd.h> 36#include <unistd.h>
37#include <stdio.h> 37#include <stdio.h>
38#include <ctype.h> 38#include <ctype.h>
39 39
40using namespace Opie::Core; 40using namespace Opie::Core;
41static char *keynames[] = { "identity", "id_rsa", "id_dsa" }; 41static const char *keynames[] = { "identity", "id_rsa", "id_dsa" };
42 42
43SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl ) 43
44 : SSHKeysBase( parent, name, fl ) 44static void detachTerminal() {
45{
46 /* If we had a controlling TTY, detach from it. 45 /* If we had a controlling TTY, detach from it.
47 This is to ensure that SSH uses ssh-askpass */ 46 This is to ensure that SSH uses ssh-askpass */
48 int fd = open("/dev/tty", O_RDONLY); 47 int fd = open("/dev/tty", O_RDONLY);
49 if (fd != -1) { 48 if (fd != -1) {
50 ioctl(fd, TIOCNOTTY, NULL); 49 ioctl(fd, TIOCNOTTY, NULL);
51 close(fd); 50 close(fd);
52 } 51 }
52}
53
54
55SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
56 : SSHKeysBase( parent, name, fl )
57{
58 detachTerminal();
59
53 60
54 QCString home = QFile::encodeName( QDir::homeDirPath() ); 61 QCString home = QFile::encodeName( QDir::homeDirPath() );
55 unsigned i; 62 unsigned i;
56 63
57 connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton())); 64 connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton()));
58 connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton())); 65 connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton()));
59 connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton())); 66 connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton()));
60 67
61 connect(&addprocess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), 68 connect(&addprocess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
62 this, SLOT(log_sshadd_output(Opie::Core::OProcess*,char*,int))); 69 this, SLOT(log_sshadd_output(Opie::Core::OProcess*,char*,int)));
63 connect(&addprocess, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), 70 connect(&addprocess, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
64 this, SLOT(log_sshadd_stderr(Opie::Core::OProcess*,char*,int))); 71 this, SLOT(log_sshadd_stderr(Opie::Core::OProcess*,char*,int)));
65 connect(&addprocess, SIGNAL(processExited(Opie::Core::OProcess*)), 72 connect(&addprocess, SIGNAL(processExited(Opie::Core::OProcess*)),
66 this, SLOT(ssh_add_exited(Opie::Core::OProcess*))); 73 this, SLOT(ssh_add_exited(Opie::Core::OProcess*)));
67 74
68 connect(KeyFileName, SIGNAL(textChanged(const QString&)), 75 connect(KeyFileName, SIGNAL(textChanged(const QString&)),