2006-07-05 Esteban Sanchez <esteban@steve-o.org>

* pandora.h, ssh/padora_ssh_client.h: Define renamed.

        * pandora_windows_service.cc: SSH user modified.

        * main.cc: Added Pandora_SSH_Test

        * ssh/pandora_ssh_test.h: Added define to avoid recursive inclusion.

        * ssh/pandora_ssh_test.cc: Unnecessary includes removed.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@93 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2006-07-05 15:02:28 +00:00
parent a379c0891c
commit 6c16f6bc67
10 changed files with 94 additions and 61 deletions

View File

@ -1,3 +1,15 @@
2006-07-05 Esteban Sanchez <esteban@steve-o.org>
* pandora.h, ssh/padora_ssh_client.h: Define renamed.
* pandora_windows_service.cc: SSH user modified.
* main.cc: Added Pandora_SSH_Test
* ssh/pandora_ssh_test.h: Added define to avoid recursive inclusion.
* ssh/pandora_ssh_test.cc: Unnecessary includes removed.
2006-07-05 Esteban Sanchez <esteban@steve-o.org>
* pandora.[cc,h]: Program name and display name of the application.

View File

@ -5,7 +5,7 @@ UnitCount=59
Type=1
Ver=1
ObjFiles=
Includes=
Includes=E:\work\common\Dev-Cpp\include\;E:\work\common\Dev-Cpp\include\c++\3.4.2\;E:\work\common\Dev-Cpp\include\c++\
Libs=
PrivateResource=
ResourceIncludes=
@ -547,26 +547,6 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit52]
FileName=ssh\pandora_ssh_test.h
CompileCpp=1
Folder=SSH
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit53]
FileName=ssh\pandora_ssh_test.cc
CompileCpp=1
Folder=SSH
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit46]
FileName=ssh\libssh2\hostkey.c
CompileCpp=1
@ -578,26 +558,6 @@ OverrideBuildCmd=0
BuildCmd=
[Unit54]
FileName=misc\pandora_file.cc
CompileCpp=1
Folder=Misc
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit55]
FileName=misc\pandora_file.h
CompileCpp=1
Folder=Misc
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit56]
FileName=windows\pandora_windows_info.h
CompileCpp=1
Folder=Windows
@ -607,7 +567,7 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit57]
[Unit55]
FileName=windows\pandora_windows_info.cc
CompileCpp=1
Folder=Windows
@ -617,17 +577,7 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit59]
FileName=modules\pandora_module_service.cc
CompileCpp=1
Folder=Modules
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit58]
[Unit56]
FileName=modules\pandora_module_service.h
CompileCpp=1
Folder=Modules
@ -637,3 +587,53 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit57]
FileName=modules\pandora_module_service.cc
CompileCpp=1
Folder=Modules
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit52]
FileName=misc\pandora_file.cc
CompileCpp=1
Folder=Misc
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit53]
FileName=misc\pandora_file.h
CompileCpp=1
Folder=Misc
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit58]
FileName=ssh\pandora_ssh_test.h
CompileCpp=1
Folder=SSH
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=
[Unit59]
FileName=ssh\pandora_ssh_test.cc
CompileCpp=1
Folder=SSH
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

View File

@ -20,10 +20,12 @@
#include "pandora.h"
#include "pandora_windows_service.h"
#include "ssh/pandora_ssh_test.h"
#define PATH_SIZE _MAX_PATH+1
#define SERVICE_INSTALL_CMDLINE_PARAM "--install"
#define SERVICE_UNINSTALL_CMDLINE_PARAM "--uninstall"
#define SSH_TEST_CMDLINE_PARAM "--test-ssh"
int
main (int argc, char *argv[]) {
@ -53,6 +55,17 @@ main (int argc, char *argv[]) {
delete service;
return 0;
} else if (_stricmp(argv[i], SSH_TEST_CMDLINE_PARAM) == 0) {
SSH::Pandora_SSH_Test ssh_test;
delete service;
try {
ssh_test.test ();
} catch (Pandora_Exception e) {
return 1;
}
return 0;
} else {
cerr << "Usage: " << argv[0] << "[" << SERVICE_INSTALL_CMDLINE_PARAM
<< "] [" << SERVICE_UNINSTALL_CMDLINE_PARAM << "]" << endl;

View File

@ -18,8 +18,8 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PANDORA_FILE_H__
#define __PANDORA_FILE_H__
#ifndef __PANDORA_FILE__
#define __PANDORA_FILE__
#include <string>
#include "../pandora.h"

View File

@ -17,8 +17,8 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PANDORA_H__
#define __PANDORA_H__
#ifndef __PANDORA__
#define __PANDORA__
#include <list>
#include <string>

View File

@ -215,7 +215,7 @@ Pandora_Windows_Service::pandora_run () {
privkey_file = Pandora::getPandoraInstallDir ();
privkey_file += "key\\id_dsa";
ssh_client->connectWithPublicKey (remote_host.c_str (), 22, "babel",
ssh_client->connectWithPublicKey (remote_host.c_str (), 22, "pandora",
pubkey_file, privkey_file, "");
} catch (SSH::Authentication_Failed e) {
delete ssh_client;

View File

@ -18,8 +18,8 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PANDORA_SSH_CLIENT_H__
#define __PANDORA_SSH_CLIENT_H__
#ifndef __PANDORA_SSH_CLIENT__
#define __PANDORA_SSH_CLIENT__
#include <string>
#include "../pandora.h"

View File

@ -19,7 +19,6 @@
*/
#include "pandora_ssh_test.h"
#include "../pandora_agent_conf.h"
#include "../tinyxml/tinyxml.h"
#include "../misc/pandora_file.h"
#include <iostream>
@ -117,6 +116,10 @@ Pandora_SSH_Test::test () {
cout << "Created a blank XML file in " << tmp_filepath<< endl;
remote_filepath = conf->getValue ("server_path");
if (remote_filepath[remote_filepath.length () - 1] != '/') {
remote_filepath += "/";
}
cout << "Remote copying " << tmp_filepath << "on server " << remote_host
<< " at " << remote_filepath << tmp_filename << endl;
try {

View File

@ -18,6 +18,9 @@
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __PANDORA_SSH_TEST__
#define __PANDORA_SSH_TEST__
#include "pandora_ssh_client.h"
#include "../pandora_agent_conf.h"
@ -32,3 +35,5 @@ namespace SSH {
void test ();
};
}
#endif