From 4d49d83565a99e1c41e3a7e8e0c2732afcd83b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 26 Aug 2021 14:29:14 +0200 Subject: Rebrand K => TDE. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 2 +- INSTALL | 2 +- README | 6 +- doc/man/ksshaskpass.1 | 29 ------- doc/man/tdesshaskpass.1 | 29 +++++++ src/CMakeL10n.txt | 2 +- src/CMakeLists.txt | 2 +- src/ksshaskpass.cpp | 139 -------------------------------- src/tdesshaskpass.cpp | 139 ++++++++++++++++++++++++++++++++ translations/messages/ksshaskpass.pot | 50 ------------ translations/messages/tdesshaskpass.pot | 50 ++++++++++++ 11 files changed, 225 insertions(+), 225 deletions(-) delete mode 100644 doc/man/ksshaskpass.1 create mode 100644 doc/man/tdesshaskpass.1 delete mode 100644 src/ksshaskpass.cpp create mode 100644 src/tdesshaskpass.cpp delete mode 100644 translations/messages/ksshaskpass.pot create mode 100644 translations/messages/tdesshaskpass.pot diff --git a/CMakeLists.txt b/CMakeLists.txt index d147a18..168b306 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ cmake_minimum_required( VERSION 2.8.12 ) ##### general package setup ##################### -project( ksshaskpass ) +project( tdesshaskpass ) set( VERSION 14.0.11 ) diff --git a/INSTALL b/INSTALL index 5c61726..63738bb 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ Basic Installation ================== -ksshaskpass relies on cmake to build. +tdesshaskpass relies on cmake to build. Here are suggested default options: diff --git a/README b/README index 5d0115c..1f852b9 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ - Ksshaskpass - a TDE version of ssh-askpass with TDEWallet support + tdesshaskpass - a TDE version of ssh-askpass with TDEWallet support -Ksshaskpass is a TDE version of ssh-askpass. The usual TDE dialog box is +tdesshaskpass is a TDE version of ssh-askpass. The usual TDE dialog box is used to enter a password. It includes integrated support for TDEWallet. @@ -17,7 +17,7 @@ Features: CONTRIBUTING ============== -If you wish to contribute to ksshaskpass, you might do so: +If you wish to contribute to tdesshaskpass, you might do so: - TDE Gitea Workspace (TGW) collaboration tool. https://mirror.git.trinitydesktop.org/gitea diff --git a/doc/man/ksshaskpass.1 b/doc/man/ksshaskpass.1 deleted file mode 100644 index e9dfcaf..0000000 --- a/doc/man/ksshaskpass.1 +++ /dev/null @@ -1,29 +0,0 @@ -.TH KSSHASKPASS 1 -.SH NAME -ksshaskpass \- prompts a user for a passphrase using TDE -.SH SYNOPSIS -.B ksshaskpass -.SH DESCRIPTION -.B ksshaskpass -is a TDE-based passphrase dialog for use with OpenSSH. -It is intended to be called by the -.BR ssh\-add (1) -program and not invoked directly. -It allows -.BR ssh\-add (1) -to obtain a passphrase from a user, even if not connected to a terminal -(assuming that an X display is available). -This happens automatically in the case where -.B ssh\-add -is invoked from one's -.B ~/.xsession -or as one of the TDE startup programs, for example. -.PP -In order to be called automatically by -.BR ssh\-add , -.B ksshaskpass -should be installed as -.IR /usr/bin/ssh\-askpass . -.SH AUTHOR -This manual page was written by Armin Berres . -It was based on that for gnome\-ssh\-askpass by Colin Watson . diff --git a/doc/man/tdesshaskpass.1 b/doc/man/tdesshaskpass.1 new file mode 100644 index 0000000..1ab9232 --- /dev/null +++ b/doc/man/tdesshaskpass.1 @@ -0,0 +1,29 @@ +.TH TDESSHASKPASS 1 +.SH NAME +tdesshaskpass \- prompts a user for a passphrase using TDE +.SH SYNOPSIS +.B tdesshaskpass +.SH DESCRIPTION +.B tdesshaskpass +is a TDE-based passphrase dialog for use with OpenSSH. +It is intended to be called by the +.BR ssh\-add (1) +program and not invoked directly. +It allows +.BR ssh\-add (1) +to obtain a passphrase from a user, even if not connected to a terminal +(assuming that an X display is available). +This happens automatically in the case where +.B ssh\-add +is invoked from one's +.B ~/.xsession +or as one of the TDE startup programs, for example. +.PP +In order to be called automatically by +.BR ssh\-add , +.B tdesshaskpass +should be installed as +.IR /usr/bin/ssh\-askpass . +.SH AUTHOR +This manual page was written by Armin Berres . +It was based on that for gnome\-ssh\-askpass by Colin Watson . diff --git a/src/CMakeL10n.txt b/src/CMakeL10n.txt index fefbe5b..e4026a0 100644 --- a/src/CMakeL10n.txt +++ b/src/CMakeL10n.txt @@ -1,3 +1,3 @@ ##### create translation templates ############## -tde_l10n_create_template( "messages/ksshaskpass" ) +tde_l10n_create_template( "messages/tdesshaskpass" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0c49fbb..016a8c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,7 +17,7 @@ link_directories( tde_add_executable( ${PROJECT_NAME} AUTOMOC SOURCES - ksshaskpass.cpp + tdesshaskpass.cpp LINK tdeui-shared tdeio-shared diff --git a/src/ksshaskpass.cpp b/src/ksshaskpass.cpp deleted file mode 100644 index 036b3dc..0000000 --- a/src/ksshaskpass.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2006 Hans van Leeuwen - * Copyright (C) 2008 Armin Berres - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - - -#include -#include -#include -#include -#include -#include -#include - -static TDECmdLineOptions options[] = -{ - { "+[dialog]", I18N_NOOP( "Dialog message. Leave undefined for default message" ), 0 }, - TDECmdLineLastOption -}; - -int main(int argc, char **argv) -{ - - TDEAboutData about ( - "Ksshaskpass", // appName - I18N_NOOP("Ksshaskpass"), // programName - "0.4.1", // version - I18N_NOOP("TDE version of ssh-askpass"), // shortDescription - TDEAboutData::License_GPL, // licenseType - "(c) 2006 Hans van Leeuwen\n(c) 2008 Armin Berres", // copyrightStatement statement - I18N_NOOP("Ksshaskpass allows you to interactively prompt users for a passphrase for ssh-add"), // text - "http://www.kde-apps.org/content/edit.php?content=50971", // homePageAddress - "trigger@space-based.de" // bugsEmailAddress - ); - about.addAuthor("Armin Berres", 0, "trigger@space-based.de"); - about.addAuthor("Hans van Leeuwen", 0, "hanz@hanz.nl"); - - TDECmdLineArgs::init(argc, argv, &about); - TDECmdLineArgs::addCmdLineOptions( options ); - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - TDEApplication app; - - - // Disable Session Management and DCOP. We don't need it. - app.disableSessionManagement(); - app.disableAutoDcopRegistration(); - - - // Declare variables - TQString walletFolder = about.appName(); - TQString dialog = I18N_NOOP("Please enter password"); // Default dialog text - TQString keyFile; - TQString password; - - - // Parse commandline arguments - if ( args->count() > 0 ) { - dialog = args->arg(0); - keyFile = dialog.section(" ", -2).remove(":"); - } - args->clear(); - - - // Open TDEWallet to see if a password was previously stored. - TDEWallet::Wallet *wallet = TDEWallet::Wallet::openWallet( TDEWallet::Wallet::NetworkWallet(), 0 ); - - if ( wallet && wallet->hasFolder(walletFolder) ) { - wallet->setFolder(walletFolder); - - TQString retrievedPass; - - wallet->readPassword(keyFile, retrievedPass); - - if (!retrievedPass.isNull()) - { - password = retrievedPass; - } - } - - - // Password could not be retrieved from wallet. Open password dialog - if (password.isNull()) - { - // create the password dialog, but only show "Enable Keep" button, if the wallet is opened - KPasswordDialog *kpd = new KPasswordDialog(KPasswordDialog::Password, wallet, 0); - kpd->setPrompt(dialog); - kpd->setCaption(i18n("Ksshaskpass")); - kpd->setAllowEmptyPasswords(false); - // We don't want to dump core when the password dialog is shown, because it could contain the entered password. - kpd->disableCoreDumps(); - - if ( kpd->exec() == KDialog::Accepted ) { - password = kpd->password(); - } - - // If "Enable Keep" is enabled, open/create a folder in TDEWallet and store the password. - if (!password.isNull() && wallet && kpd->keep()) - { - if ( !wallet->hasFolder( walletFolder ) ) { - wallet->createFolder(walletFolder); - } - wallet->setFolder(walletFolder); - wallet->writePassword(keyFile, password); - } - - delete kpd; - } - - // Close the wallet if it is opened. - if (wallet) { - TDEWallet::Wallet::closeWallet( TDEWallet::Wallet::NetworkWallet(), false ); - } - - // Finally return the password if one has been entered - if(!password.isNull()) - { - std::cout << password.local8Bit(); - return 0; - } - else - { - return 1; - } -} diff --git a/src/tdesshaskpass.cpp b/src/tdesshaskpass.cpp new file mode 100644 index 0000000..3914838 --- /dev/null +++ b/src/tdesshaskpass.cpp @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2006 Hans van Leeuwen + * Copyright (C) 2008 Armin Berres + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#include +#include +#include +#include +#include +#include +#include + +static TDECmdLineOptions options[] = +{ + { "+[dialog]", I18N_NOOP( "Dialog message. Leave undefined for default message" ), 0 }, + TDECmdLineLastOption +}; + +int main(int argc, char **argv) +{ + + TDEAboutData about ( + "tdesshaskpass", // appName + I18N_NOOP("tdesshaskpass"), // programName + "0.4.1", // version + I18N_NOOP("TDE version of ssh-askpass"), // shortDescription + TDEAboutData::License_GPL, // licenseType + "(c) 2006 Hans van Leeuwen\n(c) 2008 Armin Berres", // copyrightStatement statement + I18N_NOOP("tdesshaskpass allows you to interactively prompt users for a passphrase for ssh-add"), // text + "https://mirror.git.trinitydesktop.org/gitea/TDE/tdesshaskpass", // homePageAddress + "trigger@space-based.de" // bugsEmailAddress + ); + about.addAuthor("Armin Berres", 0, "trigger@space-based.de"); + about.addAuthor("Hans van Leeuwen", 0, "hanz@hanz.nl"); + + TDECmdLineArgs::init(argc, argv, &about); + TDECmdLineArgs::addCmdLineOptions( options ); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + TDEApplication app; + + + // Disable Session Management and DCOP. We don't need it. + app.disableSessionManagement(); + app.disableAutoDcopRegistration(); + + + // Declare variables + TQString walletFolder = about.appName(); + TQString dialog = I18N_NOOP("Please enter password"); // Default dialog text + TQString keyFile; + TQString password; + + + // Parse commandline arguments + if ( args->count() > 0 ) { + dialog = args->arg(0); + keyFile = dialog.section(" ", -2).remove(":"); + } + args->clear(); + + + // Open TDEWallet to see if a password was previously stored. + TDEWallet::Wallet *wallet = TDEWallet::Wallet::openWallet( TDEWallet::Wallet::NetworkWallet(), 0 ); + + if ( wallet && wallet->hasFolder(walletFolder) ) { + wallet->setFolder(walletFolder); + + TQString retrievedPass; + + wallet->readPassword(keyFile, retrievedPass); + + if (!retrievedPass.isNull()) + { + password = retrievedPass; + } + } + + + // Password could not be retrieved from wallet. Open password dialog + if (password.isNull()) + { + // create the password dialog, but only show "Enable Keep" button, if the wallet is opened + KPasswordDialog *kpd = new KPasswordDialog(KPasswordDialog::Password, wallet, 0); + kpd->setPrompt(dialog); + kpd->setCaption(i18n("tdesshaskpass")); + kpd->setAllowEmptyPasswords(false); + // We don't want to dump core when the password dialog is shown, because it could contain the entered password. + kpd->disableCoreDumps(); + + if ( kpd->exec() == KDialog::Accepted ) { + password = kpd->password(); + } + + // If "Enable Keep" is enabled, open/create a folder in TDEWallet and store the password. + if (!password.isNull() && wallet && kpd->keep()) + { + if ( !wallet->hasFolder( walletFolder ) ) { + wallet->createFolder(walletFolder); + } + wallet->setFolder(walletFolder); + wallet->writePassword(keyFile, password); + } + + delete kpd; + } + + // Close the wallet if it is opened. + if (wallet) { + TDEWallet::Wallet::closeWallet( TDEWallet::Wallet::NetworkWallet(), false ); + } + + // Finally return the password if one has been entered + if(!password.isNull()) + { + std::cout << password.local8Bit(); + return 0; + } + else + { + return 1; + } +} diff --git a/translations/messages/ksshaskpass.pot b/translations/messages/ksshaskpass.pot deleted file mode 100644 index 34ba65c..0000000 --- a/translations/messages/ksshaskpass.pot +++ /dev/null @@ -1,50 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2021-08-26 03:48+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Instead of a literal translation, add your name to the end of the list (separated by a comma). -#, ignore-inconsistent -msgid "" -"_: NAME OF TRANSLATORS\n" -"Your names" -msgstr "" - -#. Instead of a literal translation, add your email to the end of the list (separated by a comma). -#, ignore-inconsistent -msgid "" -"_: EMAIL OF TRANSLATORS\n" -"Your emails" -msgstr "" - -#: ksshaskpass.cpp:31 -msgid "Dialog message. Leave undefined for default message" -msgstr "" - -#: ksshaskpass.cpp:40 ksshaskpass.cpp:102 -msgid "Ksshaskpass" -msgstr "" - -#: ksshaskpass.cpp:42 -msgid "TDE version of ssh-askpass" -msgstr "" - -#: ksshaskpass.cpp:45 -msgid "" -"Ksshaskpass allows you to interactively prompt users for a passphrase for " -"ssh-add" -msgstr "" - -#: ksshaskpass.cpp:66 -msgid "Please enter password" -msgstr "" diff --git a/translations/messages/tdesshaskpass.pot b/translations/messages/tdesshaskpass.pot new file mode 100644 index 0000000..8f96075 --- /dev/null +++ b/translations/messages/tdesshaskpass.pot @@ -0,0 +1,50 @@ +# SOME DESCRIPTIVE TITLE. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2021-08-26 03:48+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Instead of a literal translation, add your name to the end of the list (separated by a comma). +#, ignore-inconsistent +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" + +#. Instead of a literal translation, add your email to the end of the list (separated by a comma). +#, ignore-inconsistent +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" + +#: tdesshaskpass.cpp:31 +msgid "Dialog message. Leave undefined for default message" +msgstr "" + +#: tdesshaskpass.cpp:40 tdesshaskpass.cpp:102 +msgid "tdesshaskpass" +msgstr "" + +#: tdesshaskpass.cpp:42 +msgid "TDE version of ssh-askpass" +msgstr "" + +#: tdesshaskpass.cpp:45 +msgid "" +"tdesshaskpass allows you to interactively prompt users for a passphrase for " +"ssh-add" +msgstr "" + +#: tdesshaskpass.cpp:66 +msgid "Please enter password" +msgstr "" -- cgit v1.2.1