EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SSHBlackbox support for BDS 2006

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#21513
Posted: 09/14/2012 00:49:59
by Jarek Walek (Standard support level)
Joined: 09/14/2012
Posts: 4

Do you still support BDS 2006 (C++ Builder 2006) for SSH Blackbox ? I have version 9.1.217 (SecureBlackbox for Delphi 2005 to Delphi 2007), but examples (and programs) not works (problem with TClientSocket)

Regards,
Jarek
#21515
Posted: 09/14/2012 00:56:09
by Eugene Mayevski (EldoS Corp.)

BDS 2006 shared one set of files between Delphi and C++Builder. Due to this and due to lack of proper translation of out parameters into .h files declarations of methods differ. And this can cause minor issues with compiling some supplementary classes.

If you tell us what exatly problems you are having, we would be able to solve them. Yet I need to notice that TClientSocket was deprecated 12 years ago and in vast majority of cases you can use either SecureBlackbox classes themselves or Indy as a replacement. Of course, if you are using TClientSocket in non-blocking asynchronous mode, things become more complicated, but also solveable.


Sincerely yours
Eugene Mayevski
#21517
Posted: 09/14/2012 01:36:38
by Jarek Walek (Standard support level)
Joined: 09/14/2012
Posts: 4

Hi,
thanks for the quick response :)

Main problem:
1. I install SSHBlackbox on my computer
2. Run DBS Studio 2006
3. Create VCL application
4. Add component TElSimpleSSHClient1
5. Compile and get errors like attachment 1


Regards,
Jarek


#21518
Posted: 09/14/2012 01:39:32
by Eugene Mayevski (EldoS Corp.)

Oh, that's a totally different story. This is due to a buggy header file generator in C++Builder. This has been discussed just recently in this topic. Please comment out the line in question and the rest of issues should go away.


Sincerely yours
Eugene Mayevski
#21520
Posted: 09/14/2012 02:09:23
by Jarek Walek (Standard support level)
Joined: 09/14/2012
Posts: 4

Worked great, thanks. And second problem :)
I open the sample project SSHDemo_BDS2006.bdsproj and I get the error (see attachment). I click on Ignore but when I compile i get error Field Form1->ClientSocket1 does not have a corresponding component. Remove the declaration ?

Regards,
Jarek


#21521
Posted: 09/14/2012 02:13:04
by Vsevolod Ievgiienko (EldoS Corp.)

Hello.

You should install dclsockets*.bpl manually to remove the problem. This BPL is usually located in the same directory as BDS 2006 binaries.
#21522
Posted: 09/14/2012 02:20:11
by Eugene Mayevski (EldoS Corp.)

Please note, that SSHDemo shows how to use TElSSHClient and supplementary classes. TElSSHClient is a sophisticated component which is used for complex tasks. For most regular SSH-related tasks TElSimpleSSHClient is enough. Despite its name, TElSimpleSSHClient includes some high-level functionality and has built-in socket transport. Consequently you won't need TClientSocket to use TElSimpleSSHClient. Use of TElSimpleSSHClient is shown in SimpleSSHDemo.

I'd suggest to start with TElSimpleSSHClient and move to TElSSHClient only if you really need this (due to complexity of architecture of SSH protocol family and consequently of TElSSHClient).


Sincerely yours
Eugene Mayevski
#21534
Posted: 09/14/2012 06:34:34
by Jarek Walek (Standard support level)
Joined: 09/14/2012
Posts: 4

Thanks, every works fine, but.. :)
I have very simple code
Code
void __fastcall TForm1::Button2Click(TObject *Sender)
{

  AnsiString ret = "";
  txt = "";
  AnsiString ErrData;
  
ElSimpleSSHClient1->Command = Edit3->Text;
ElSimpleSSHClient1->CommandTimeout = 2000;

try
{
ElSimpleSSHClient1->Open();
while (ElSimpleSSHClient1->CanReceive(0))
   {
      txt = txt + ElSimpleSSHClient1->ReceiveText();
   }
if(txt.Length())
   Memo1->Lines->Add(txt);

}
catch(Exception &e)
{
  ElSimpleSSHClient1->Close();
  Memo1->Lines->Add(e.Message);
}

ElSimpleSSHClient1->Close();
}

This code some return all data, some return part off data and some return nothing (for the same command, for example IBM AIX df -g)

Regards,
Jarek
#21535
Posted: 09/14/2012 06:40:08
by Eugene Mayevski (EldoS Corp.)

SSH shell and command access is a bidirectional protocol and this causes complexities in handling remote data. Please take a look at the sample and you'll see that the logic of the data receiving part is more sophisticated than in your code. Please use the logic of the sample. In particular, your code will fail if there's no data in the socket yet the connection is alive.


Sincerely yours
Eugene Mayevski
#21536
Posted: 09/14/2012 06:41:00
by Vsevolod Ievgiienko (EldoS Corp.)

Try to specify a timeout for CanReceive instead of 0 that means "no wait at all".
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 2860 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!