-rw-r--r-- | noncore/settings/sshkeys/main.cpp | 28 | ||||
-rw-r--r-- | noncore/settings/sshkeys/opie-sshkeys.control | 2 | ||||
-rw-r--r-- | noncore/settings/sshkeys/sshkeys.cpp | 16 | ||||
-rw-r--r-- | noncore/settings/sshkeys/sshkeys.h | 1 | ||||
-rw-r--r-- | noncore/settings/sshkeys/sshkeys.pro | 4 |
5 files changed, 20 insertions, 31 deletions
diff --git a/noncore/settings/sshkeys/main.cpp b/noncore/settings/sshkeys/main.cpp index 9f19d0f..d0c0e2b 100644 --- a/noncore/settings/sshkeys/main.cpp +++ b/noncore/settings/sshkeys/main.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * ssh-agent key manipulation utility | 2 | * ssh-agent key manipulation utility |
3 | * | 3 | * |
4 | * (C) 2002 David Woodhouse <dwmw2@infradead.org> | 4 | * (C) 2002 David Woodhouse <dwmw2@infradead.org> |
5 | * | 5 | * |
@@ -18,32 +18,10 @@ | |||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <qpe/qpeapplication.h> | 22 | #include <opie2/oapplicationfactory.h> |
23 | #include "sshkeys.h" | 23 | #include "sshkeys.h" |
24 | #include <stdio.h> | ||
25 | #include <sys/types.h> | ||
26 | #include <sys/stat.h> | ||
27 | #include <fcntl.h> | ||
28 | #include <sys/ioctl.h> | ||
29 | #include <unistd.h> | ||
30 | 24 | ||
31 | int main(int argc, char *argv[]) | 25 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<SSHKeysApp> ) |
32 | { | ||
33 | QPEApplication a(argc, argv); | ||
34 | SSHKeysApp app; | ||
35 | int fd; | ||
36 | 26 | ||
37 | /* If we had a controlling TTY, detach from it. | ||
38 | This is to ensure that SSH uses ssh-askpass */ | ||
39 | fd = open("/dev/tty", O_RDONLY); | ||
40 | if (fd != -1) { | ||
41 | ioctl(fd, TIOCNOTTY, NULL); | ||
42 | close(fd); | ||
43 | } | ||
44 | |||
45 | a.showMainWidget(&app); | ||
46 | |||
47 | return a.exec(); | ||
48 | } | ||
49 | 27 | ||
diff --git a/noncore/settings/sshkeys/opie-sshkeys.control b/noncore/settings/sshkeys/opie-sshkeys.control index 08e3508..1f2a1fc 100644 --- a/noncore/settings/sshkeys/opie-sshkeys.control +++ b/noncore/settings/sshkeys/opie-sshkeys.control | |||
@@ -1,6 +1,6 @@ | |||
1 | Package: opie-sshkeys | 1 | Package: opie-sshkeys |
2 | Files: bin/sshkeys apps/Settings/sshkeys.desktop pics/sshkeys/sshkeys.png | 2 | Files: plugins/applications/libsshkeys.so* bin/sshkeys apps/Settings/sshkeys.desktop pics/sshkeys/sshkeys.png |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Maintainer: David Woodhouse <dwmw2@infradead.org> | 5 | Maintainer: David Woodhouse <dwmw2@infradead.org> |
6 | Architecture: arm | 6 | Architecture: arm |
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp index cebc845..d8b1014 100644 --- a/noncore/settings/sshkeys/sshkeys.cpp +++ b/noncore/settings/sshkeys/sshkeys.cpp | |||
@@ -20,15 +20,19 @@ | |||
20 | */ | 20 | */ |
21 | #include "sshkeys.h" | 21 | #include "sshkeys.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qdir.h> | ||
25 | #include <qfile.h> | ||
24 | #include <qmultilineedit.h> | 26 | #include <qmultilineedit.h> |
25 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
26 | #include <qlistview.h> | 28 | #include <qlistview.h> |
27 | #include <qcombobox.h> | 29 | #include <qcombobox.h> |
28 | 30 | ||
29 | #include <sys/types.h> | 31 | #include <sys/types.h> |
30 | #include <sys/stat.h> | 32 | #include <sys/stat.h> |
33 | #include <fcntl.h> | ||
34 | #include <sys/ioctl.h> | ||
31 | #include <stdlib.h> | 35 | #include <stdlib.h> |
32 | #include <unistd.h> | 36 | #include <unistd.h> |
33 | #include <stdio.h> | 37 | #include <stdio.h> |
34 | #include <ctype.h> | 38 | #include <ctype.h> |
@@ -38,9 +42,17 @@ static char *keynames[] = { "identity", "id_rsa", "id_dsa" }; | |||
38 | 42 | ||
39 | SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl ) | 43 | SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl ) |
40 | : SSHKeysBase( parent, name, fl ) | 44 | : SSHKeysBase( parent, name, fl ) |
41 | { | 45 | { |
42 | char *home = getenv("HOME"); | 46 | /* If we had a controlling TTY, detach from it. |
47 | This is to ensure that SSH uses ssh-askpass */ | ||
48 | int fd = open("/dev/tty", O_RDONLY); | ||
49 | if (fd != -1) { | ||
50 | ioctl(fd, TIOCNOTTY, NULL); | ||
51 | close(fd); | ||
52 | } | ||
53 | |||
54 | QCString home = QFile::encodeName( QDir::homeDirPath() ); | ||
43 | unsigned i; | 55 | unsigned i; |
44 | 56 | ||
45 | connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton())); | 57 | connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton())); |
46 | connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton())); | 58 | connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton())); |
@@ -60,9 +72,9 @@ SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl ) | |||
60 | for (i = 0; i < sizeof(keynames)/sizeof(keynames[0]); i++) { | 72 | for (i = 0; i < sizeof(keynames)/sizeof(keynames[0]); i++) { |
61 | char thiskeyname[32]; | 73 | char thiskeyname[32]; |
62 | 74 | ||
63 | thiskeyname[31] = 0; | 75 | thiskeyname[31] = 0; |
64 | snprintf(thiskeyname, 31, "%s/.ssh/%s", home, keynames[i]); | 76 | snprintf(thiskeyname, 31, "%s/.ssh/%s", home.data(), keynames[i]); |
65 | if (!access(thiskeyname, R_OK)) { | 77 | if (!access(thiskeyname, R_OK)) { |
66 | KeyFileName->insertItem(thiskeyname); | 78 | KeyFileName->insertItem(thiskeyname); |
67 | } | 79 | } |
68 | } | 80 | } |
diff --git a/noncore/settings/sshkeys/sshkeys.h b/noncore/settings/sshkeys/sshkeys.h index 519f540..0807f74 100644 --- a/noncore/settings/sshkeys/sshkeys.h +++ b/noncore/settings/sshkeys/sshkeys.h | |||
@@ -32,8 +32,9 @@ class SSHKeysApp : public SSHKeysBase | |||
32 | 32 | ||
33 | public: | 33 | public: |
34 | SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 34 | SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
35 | ~SSHKeysApp(); | 35 | ~SSHKeysApp(); |
36 | static QString appName() { return QString::fromLatin1( QUICKAPP_NAME); } | ||
36 | 37 | ||
37 | private: | 38 | private: |
38 | void log_text(const char *text); | 39 | void log_text(const char *text); |
39 | void flush_sshadd_output(void); | 40 | void flush_sshadd_output(void); |
diff --git a/noncore/settings/sshkeys/sshkeys.pro b/noncore/settings/sshkeys/sshkeys.pro index 87d5ce9..0910d29 100644 --- a/noncore/settings/sshkeys/sshkeys.pro +++ b/noncore/settings/sshkeys/sshkeys.pro | |||
@@ -1,12 +1,10 @@ | |||
1 | TEMPLATE = app | 1 | CONFIG += qt quick-app |
2 | CONFIG += qt warn_on | ||
3 | HEADERS = sshkeys.h | 2 | HEADERS = sshkeys.h |
4 | SOURCES = main.cpp sshkeys.cpp | 3 | SOURCES = main.cpp sshkeys.cpp |
5 | TARGET = sshkeys | 4 | TARGET = sshkeys |
6 | INTERFACES = sshkeysbase.ui | 5 | INTERFACES = sshkeysbase.ui |
7 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 7 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe -lopiecore2 | 8 | LIBS += -lqpe -lopiecore2 |
10 | DESTDIR = $(OPIEDIR)/bin | ||
11 | 9 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 10 | include ( $(OPIEDIR)/include.pro ) |