diff options
author | Darrell Anderson <humanreadable@yahoo.com> | 2013-05-17 12:45:40 -0500 |
---|---|---|
committer | Darrell Anderson <humanreadable@yahoo.com> | 2013-05-17 12:45:40 -0500 |
commit | 359294c33620c8328d61f67635046d7cc060530c (patch) | |
tree | f2ac08fdad8860f7bc1ac76203e31013a799fda7 /kdessh | |
parent | 7be7990fc5770d2cbcd937772e8239167b5900c6 (diff) | |
download | tdeutils-359294c33620c8328d61f67635046d7cc060530c.tar.gz tdeutils-359294c33620c8328d61f67635046d7cc060530c.zip |
Rename kdessh -> tdessh and kdelirc -> tdelirc.
Diffstat (limited to 'kdessh')
-rw-r--r-- | kdessh/CMakeLists.txt | 36 | ||||
-rw-r--r-- | kdessh/LICENSE.readme | 124 | ||||
-rw-r--r-- | kdessh/Makefile.am | 17 | ||||
-rw-r--r-- | kdessh/README | 3 | ||||
-rw-r--r-- | kdessh/kdessh.cpp | 201 | ||||
-rw-r--r-- | kdessh/sshdlg.cpp | 80 | ||||
-rw-r--r-- | kdessh/sshdlg.h | 33 |
7 files changed, 0 insertions, 494 deletions
diff --git a/kdessh/CMakeLists.txt b/kdessh/CMakeLists.txt deleted file mode 100644 index 8abf536..0000000 --- a/kdessh/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -################################################# -# -# (C) 2012 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - -add_definitions( - -DQT_NO_CAST_ASCII -) - - -##### kdessh (executable) ####################### - -tde_add_executable( kdessh AUTOMOC - SOURCES kdessh.cpp sshdlg.cpp - LINK tdeui-shared tdesu-shared - DESTINATION ${BIN_INSTALL_DIR} -) - diff --git a/kdessh/LICENSE.readme b/kdessh/LICENSE.readme deleted file mode 100644 index eb08ce6..0000000 --- a/kdessh/LICENSE.readme +++ /dev/null @@ -1,124 +0,0 @@ -kdessh - a KDE front end to ssh - -Copyright (c) 1999,2000 by Geert Jansen <jansen@kde.org> - - The "Artistic License" - - Preamble - - The intent of this document is to state the conditions under which a - Package may be copied, such that the Copyright Holder maintains some - semblance of artistic control over the development of the package, - while giving the users of the package the right to use and - distribute the Package in a more-or-less customary fashion, plus the - right to make reasonable modifications. - - Definitions: - - * "Package" refers to the collection of files distributed by the - Copyright Holder, and derivatives of that collection of files - created through textual modification. - - * "Standard Version" refers to such a Package if it has not been - modified, or has been modified in accordance with the wishes of - the Copyright Holder. - - * "Copyright Holder" is whoever is named in the copyright or - copyrights for the package. - - * "You" is you, if you're thinking about copying or distributing - this Package. - - * "Reasonable copying fee" is whatever you can justify on the - basis of media cost, duplication charges, time of people - involved, and so on. (You will not be required to justify it to - the Copyright Holder, but only to the computing community at - large as a market that must bear the fee.) - - * "Freely Available" means that no fee is charged for the item - itself, though there may be fees involved in handling the item. - It also means that recipients of the item may redistribute it - under the same conditions they received it. - - 1. You may make and give away verbatim copies of the source form of - the Standard Version of this Package without restriction, provided - that you duplicate all of the original copyright notices and - associated disclaimers. - - 2. You may apply bug fixes, portability fixes and other - modifications derived from the Public Domain or from the Copyright - Holder. A Package modified in such a way shall still be considered - the Standard Version. - - 3. You may otherwise modify your copy of this Package in any way, - provided that you insert a prominent notice in each changed file - stating how and when you changed that file, and provided that you do - at least ONE of the following: - - a) place your modifications in the Public Domain or - otherwise make them Freely Available, such as by posting - said modifications to Usenet or an equivalent medium, or - placing the modifications on a major archive site such as - ftp.uu.net, or by allowing the Copyright Holder to include - your modifications in the Standard Version of the Package. - - b) use the modified Package only within your corporation - or organization. - - c) rename any non-standard executables so the names do not - conflict with standard executables, which must also be - provided, and provide a separate manual page for each - non-standard executable that clearly documents how it - differs from the Standard Version. - - d) make other distribution arrangements with the Copyright - Holder. - - 4. You may distribute the programs of this Package in object code or - executable form, provided that you do at least ONE of the following: - - a) distribute a Standard Version of the executables and - library files, together with instructions (in the manual - page or equivalent) on where to get the Standard Version. - - b) accompany the distribution with the machine-readable - source of the Package with your modifications. - - c) accompany any non-standard executables with their - corresponding Standard Version executables, giving the - non-standard executables non-standard names, and clearly - documenting the differences in manual pages (or - equivalent), together with instructions on where to get - the Standard Version. - - d) make other distribution arrangements with the Copyright - Holder. - - 5. You may charge a reasonable copying fee for any distribution of - this Package. You may charge any fee you choose for support of this - Package. You may not charge a fee for this Package itself. However, - you may distribute this Package in aggregate with other (possibly - commercial) programs as part of a larger (possibly commercial) - software distribution provided that you do not advertise this - Package as a product of your own. - - 6. The scripts and library files supplied as input to or produced as - output from the programs of this Package do not automatically fall - under the copyright of this Package, but belong to whomever - generated them, and may be sold commercially, and may be aggregated - with this Package. - - 7. C or perl subroutines supplied by you and linked into this - Package shall not be considered part of this Package. - - 8. The name of the Copyright Holder may not be used to endorse or - promote products derived from this software without specific prior - written permission. - - 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - - The End - - diff --git a/kdessh/Makefile.am b/kdessh/Makefile.am deleted file mode 100644 index f716244..0000000 --- a/kdessh/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -## Makefile.am for kdessh -AM_CPPFLAGS = -DQT_NO_CAST_ASCII - -INCLUDES= $(all_includes) - -## kdessh -bin_PROGRAMS = kdessh -kdessh_SOURCES = kdessh.cpp sshdlg.cpp -kdessh_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kdessh_LDADD = $(LIB_TDEUI) -ltdesu -kdessh_METASOURCES = AUTO -noinst_HEADERS = sshdlg.h - -## Messages -messages: - $(XGETTEXT) $(kdessh_SOURCES) -o $(podir)/kdessh.pot - diff --git a/kdessh/README b/kdessh/README deleted file mode 100644 index b897486..0000000 --- a/kdessh/README +++ /dev/null @@ -1,3 +0,0 @@ -kdessh: A KDE front end to ssh. - -Please report bugs to Geert Jansen <jansen@kde.org>. diff --git a/kdessh/kdessh.cpp b/kdessh/kdessh.cpp deleted file mode 100644 index 5d64290..0000000 --- a/kdessh/kdessh.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* vi: ts=8 sts=4 sw=4 - * - * $Id$ - * - * This file is part of the KDE project, module tdesu. - * Copyright (C) 2000 Geert Jansen <jansen@kde.org> - */ - -#include <config.h> - -#include <unistd.h> -#include <string.h> -#include <pwd.h> -#include <stdlib.h> -#include <errno.h> - -#include <sys/time.h> -#include <sys/resource.h> - - -#include <kdebug.h> -#include <tdeapplication.h> -#include <kstandarddirs.h> -#include <tdeconfig.h> -#include <tdelocale.h> -#include <tdeaboutdata.h> -#include <tdecmdlineargs.h> -#include <tdemessagebox.h> - -#include <tdesu/ssh.h> -#include <tdesu/client.h> -#include <tdesu/defaults.h> - -#include "sshdlg.h" - -static TDECmdLineOptions options[] = -{ - { "+host", I18N_NOOP("Specifies the remote host"), 0 }, - { "+command", I18N_NOOP("The command to run"), 0 }, - { "u <user>", I18N_NOOP("Specifies the target uid"), 0 }, - { "s <path>", I18N_NOOP("Specify remote stub location"), "tdesu_stub" }, - { "n", I18N_NOOP("Do not keep password"), 0 }, - { "q", I18N_NOOP("Stop the daemon (forgets all passwords)"), 0 }, - { "t", I18N_NOOP("Enable terminal output (no password keeping)"), 0 }, - TDECmdLineLastOption -}; - - -int main(int argc, char *argv[]) -{ - TDEAboutData aboutData("kdessh", I18N_NOOP("TDE ssh"), - VERSION, I18N_NOOP("Runs a program on a remote host"), - TDEAboutData::License_Artistic, - "Copyright (c) 2000 Geert Jansen"); - aboutData.addAuthor("Geert Jansen", I18N_NOOP("Maintainer"), - "jansen@kde.org", "http://www.stack.nl/~geertj/"); - - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - // Stop daemon and exit? - if (args->isSet("q")) - { - KDEsuClient client; - if (client.ping() == -1) - { - kdError(1511) << "Daemon not running -- nothing to stop\n"; - exit(1); - } - if (client.stopServer() != -1) - { - kdDebug(1511) << "Daemon stopped\n"; - exit(0); - } - kdError(1511) << "Could not stop daemon\n"; - exit(1); - } - - if (args->count() < 2) - TDECmdLineArgs::usage(i18n("No command or host specified.")); - - // Check if ssh is available - if (TDEStandardDirs::findExe(TQString::fromLatin1("ssh")).isEmpty()) - { - kdError(1511) << "ssh not found\n"; - exit(1); - } - - // Get remote userid - TQCString user = args->getOption("u"); - if (user.isNull()) - { - struct passwd *pw = getpwuid(getuid()); - if (pw == 0L) - { - kdError(1511) << "You don't exist!\n"; - exit(1); - } - user = pw->pw_name; - } - - // Remote stub location - TQCString stub = args->getOption("s"); - - // Get remote host, command - TQCString host = args->arg(0); - TQCString command = args->arg(1); - for (int i=2; i<args->count(); i++) - { - command += " "; - command += args->arg(i); - } - - // Check for daemon and start if necessary - bool have_daemon = true; - KDEsuClient client; - if (!client.isServerSGID()) - { - kdWarning(1511) << "Daemon not safe (not sgid), not using it.\n"; - have_daemon = false; - } - else if ((client.ping() == -1) && (client.startServer() == -1)) - { - kdWarning(1511) << "Could not start daemon, reduced functionality.\n"; - have_daemon = false; - } - - // Try to exec the command with tdesud? - bool keep = !args->isSet("n") && have_daemon; - bool terminal = args->isSet("t"); - if (keep && !terminal) - { - client.setHost(host); - if (client.exec(command, user) != -1) - return 0; - } - - // Set core dump size to 0 because we will have - // root's password in memory. - struct rlimit rlim; - rlim.rlim_cur = rlim.rlim_max = 0; - if (setrlimit(RLIMIT_CORE, &rlim)) - { - kdError(1511) << "rlimit(): " << perror << "\n"; - exit(1); - } - - - // Read configuration - TDEConfig *config = TDEGlobal::config(); - config->setGroup(TQString::fromLatin1("Passwords")); - int timeout = config->readNumEntry(TQString::fromLatin1("Timeout"), defTimeout); - - SshProcess proc(host, user); - proc.setStub(stub); - int needpw = proc.checkNeedPassword(); - if (needpw < 0) - { - TQString msg = i18n("Ssh returned with an error!\n" - "The error message is:\n\n"); - msg += proc.error(); - KMessageBox::error(0L, msg); - exit(1); - } - - TQCString password; - if (needpw != 0) - { - KDEsshDialog *dlg = new KDEsshDialog(host, user, stub, - proc.prompt(), keep && !terminal); - dlg->addLine(i18n("Command"), command); - int res = dlg->exec(); - if (res == KDEsshDialog::Rejected) - exit(0); - keep = dlg->keep(); - password = dlg->password(); - delete dlg; - } else - keep = 0; - - // Make the dialog go away. - app.processEvents(); - - // Run command - if (keep && have_daemon) - { - client.setHost(host); - client.setPass(password, timeout); - return client.exec(command, user); - } else - { - proc.setCommand(command); - proc.setTerminal(terminal); - proc.setErase(true); - return proc.exec(password); - } -} - diff --git a/kdessh/sshdlg.cpp b/kdessh/sshdlg.cpp deleted file mode 100644 index c7ca281..0000000 --- a/kdessh/sshdlg.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* vi: ts=8 sts=4 sw=4 - * - * $Id$ - * - * This file is part of the KDE project, module tdesu. - * Copyright (C) 2000 Geert Jansen <jansen@kde.org> - */ - -#include <tdelocale.h> -#include <tdemessagebox.h> - -#include <tdesu/ssh.h> -#include "sshdlg.h" - - -KDEsshDialog::KDEsshDialog(TQCString host, TQCString user, TQCString stub, - TQString prompt, bool enableKeep) - : KPasswordDialog(Password, enableKeep, 0) -{ - m_Host = host; - m_User = user; - m_Stub = stub; - - setCaption(TQString::fromLatin1("%1@%2").arg(TQString(m_User)).arg(TQString(m_Host))); - - // Make the prompt a little more polite :-) - if (prompt.lower().left(6) == TQString::fromLatin1("enter ")) - prompt.remove(0, 6); - int pos = prompt.find(':'); - if (pos != -1) - prompt.remove(pos, 10); - prompt += '.'; - prompt.prepend(i18n("The action you requested needs authentication. " - "Please enter ")); - setPrompt(prompt); -} - - -KDEsshDialog::~KDEsshDialog() -{ -} - - -bool KDEsshDialog::checkPassword(const char *password) -{ - SshProcess proc(m_Host, m_User); - proc.setStub(m_Stub); - - int ret = proc.checkInstall(password); - switch (ret) - { - case -1: - KMessageBox::error(this, i18n("Conversation with ssh failed.\n")); - done(Rejected); - return false; - - case 0: - return true; - - case SshProcess::SshNotFound: - KMessageBox::sorry(this, - i18n("The programs 'ssh' or 'tdesu_stub' cannot be found.\n" - "Make sure your PATH is set correctly.")); - done(Rejected); - return false; - - case SshProcess::SshIncorrectPassword: - KMessageBox::sorry(this, i18n("Incorrect password. Please try again.")); - return false; - - default: - KMessageBox::error(this, i18n("Internal error: Illegal return from " - "SshProcess::checkInstall()")); - done(Rejected); - } - return true; -} - - -#include "sshdlg.moc" diff --git a/kdessh/sshdlg.h b/kdessh/sshdlg.h deleted file mode 100644 index 45175d7..0000000 --- a/kdessh/sshdlg.h +++ /dev/null @@ -1,33 +0,0 @@ -/* vi: ts=8 sts=4 sw=4 - * - * $Id$ - * - * This file is part of the KDE project, module tdesu. - * Copyright (C) 2000 Geert Jansen <jansen@kde.org> - */ - -#ifndef __SshDlg_h_Included__ -#define __SshDlg_h_Included__ - -#include <kpassdlg.h> - -class KDEsshDialog - : public KPasswordDialog -{ - Q_OBJECT - - -public: - KDEsshDialog(TQCString host, TQCString user, TQCString stub, - TQString prompt, bool enableKeep); - ~KDEsshDialog(); - -protected: - bool checkPassword(const char *password); - -private: - TQCString m_User, m_Host, m_Stub; -}; - - -#endif // __SshDlg_h_Included__ |