ssh.h
00001 /* vi: ts=8 sts=4 sw=4 00002 * 00003 * $Id$ 00004 * 00005 * This file is part of the KDE project, module tdesu. 00006 * Copyright (C) 2000 Geert Jansen <jansen@kde.org> 00007 * 00008 * This is free software; you can use this library under the GNU Library 00009 * General Public License, version 2. See the file "COPYING.LIB" for the 00010 * exact licensing terms. 00011 */ 00012 00013 #ifndef __SSH_h_Included__ 00014 #define __SSH_h_Included__ 00015 00016 #include <tqcstring.h> 00017 00018 #include "stub.h" 00019 00020 #include <tdelibs_export.h> 00021 00026 class TDESU_EXPORT SshProcess: public StubProcess 00027 { 00028 public: 00029 SshProcess(const TQCString &host=0, const TQCString &user=0, const TQCString &command=0); 00030 ~SshProcess(); 00031 00032 enum Errors { SshNotFound=1, SshNeedsPassword, SshIncorrectPassword }; 00033 00037 void setHost(const TQCString &host) { m_Host = host; } 00038 00042 void setStub(const TQCString &stub); 00043 00051 int checkNeedPassword(); 00052 00057 int checkInstall(const char *password); 00058 00062 int exec(const char *password, int check=0); 00063 00064 TQCString prompt() { return m_Prompt; } 00065 TQCString error() { return m_Error; } 00066 00067 protected: 00068 virtual TQCString display(); 00069 virtual TQCString displayAuth(); 00070 virtual TQCString dcopServer(); 00071 00072 private: 00073 TQCString dcopForward(); 00074 int ConverseSsh(const char *password, int check); 00075 00076 int m_dcopPort; 00077 int m_dcopSrv; 00078 TQCString m_Prompt; 00079 TQCString m_Host; 00080 TQCString m_Error; 00081 TQCString m_Stub; 00082 00083 protected: 00084 virtual void virtual_hook( int id, void* data ); 00085 private: 00086 class SshProcessPrivate; 00087 SshProcessPrivate *d; 00088 }; 00089 00090 #endif