KDEsu
ssh.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __SSH_h_Included__
00012 #define __SSH_h_Included__
00013
00014 #include "stub.h"
00015
00016 #include <kdesu/kdesu_export.h>
00017
00018 namespace KDESu {
00019
00024 class KDESU_EXPORT SshProcess: public StubProcess
00025 {
00026 public:
00027 explicit SshProcess(const QByteArray &host = QByteArray(),
00028 const QByteArray &user = QByteArray(),
00029 const QByteArray &command = QByteArray());
00030 ~SshProcess();
00031
00032 enum Errors { SshNotFound=1, SshNeedsPassword, SshIncorrectPassword };
00033
00037 void setHost(const QByteArray &host);
00038
00042 void setStub(const QByteArray &stub);
00043
00051 int checkNeedPassword();
00052
00057 int checkInstall(const char *password);
00058
00062 int exec(const char *password, int check=0);
00063
00064 QByteArray prompt() const;
00065 QByteArray error() const;
00066
00067 protected:
00068 virtual QByteArray display();
00069 virtual QByteArray displayAuth();
00070
00071 private:
00072 int ConverseSsh(const char *password, int check);
00073
00074 protected:
00075 virtual void virtual_hook( int id, void* data );
00076 private:
00077 class SshProcessPrivate;
00078 SshProcessPrivate * const d;
00079 };
00080
00081 }
00082
00083 #endif