• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEsu

  • KDESu
  • SshProcess
Public Types | Public Member Functions | Protected Member Functions | List of all members
KDESu::SshProcess Class Reference

#include <kdesu/ssh.h>

Inheritance diagram for KDESu::SshProcess:
KDESu::StubProcess KDESu::PtyProcess

Public Types

enum  Errors { SshNotFound =1 , SshNeedsPassword , SshIncorrectPassword }
Public Types inherited from KDESu::StubProcess
enum  Scheduler { SchedNormal , SchedRealtime }
Public Types inherited from KDESu::PtyProcess
enum  checkPidStatus { Error =-1 , NotExited =-2 , Killed =-3 }

Public Member Functions

 SshProcess (const QByteArray &host=QByteArray(), const QByteArray &user=QByteArray(), const QByteArray &command=QByteArray())
 ~SshProcess ()
int checkInstall (const char *password)
int checkNeedPassword ()
QByteArray error () const
int exec (const char *password, int check=0)
QByteArray prompt () const
void setHost (const QByteArray &host)
void setStub (const QByteArray &stub)
Public Member Functions inherited from KDESu::StubProcess
 StubProcess ()
 ~StubProcess ()
void setCommand (const QByteArray &command)
void setPriority (int prio)
void setScheduler (int sched)
void setUser (const QByteArray &user)
void setXOnly (bool xonly)
Public Member Functions inherited from KDESu::PtyProcess
 PtyProcess ()
virtual ~PtyProcess ()
int enableLocalEcho (bool enable=true)
int exec (const QByteArray &command, const QList< QByteArray > &args)
int fd () const
int pid () const
QByteArray readAll (bool block=true)
QByteArray readLine (bool block=true)
void setEnvironment (const QList< QByteArray > &env)
void setErase (bool erase)
void setExitString (const QByteArray &exit)
void setTerminal (bool terminal)
void unreadLine (const QByteArray &line, bool addNewline=true)
int waitForChild ()
int WaitSlave ()
void writeLine (const QByteArray &line, bool addNewline=true)

Protected Member Functions

virtual QByteArray display ()
virtual QByteArray displayAuth ()
virtual void virtual_hook (int id, void *data)
Protected Member Functions inherited from KDESu::StubProcess
int ConverseStub (int check)
Protected Member Functions inherited from KDESu::PtyProcess
QList< QByteArray > environment () const

Additional Inherited Members

Static Public Member Functions inherited from KDESu::PtyProcess
static bool checkPid (pid_t pid)
static int checkPidExited (pid_t pid)
Public Attributes inherited from KDESu::PtyProcess
 : static int waitMS(int fd
int ms
Protected Attributes inherited from KDESu::StubProcess
bool m_bXOnly
QByteArray m_Command
KDESuPrivate::KCookie * m_pCookie
int m_Priority
int m_Scheduler
QByteArray m_User
Protected Attributes inherited from KDESu::PtyProcess
bool m_bErase
bool m_bTerminal
QByteArray m_Command
QByteArray m_Exit
int m_Pid

Detailed Description

Executes a remote command, using ssh.

Definition at line 24 of file ssh.h.

Member Enumeration Documentation

◆ Errors

enum KDESu::SshProcess::Errors
Enumerator
SshNotFound 
SshNeedsPassword 
SshIncorrectPassword 

Definition at line 32 of file ssh.h.

Constructor & Destructor Documentation

◆ SshProcess()

KDESu::SshProcess::SshProcess ( const QByteArray & host = QByteArray(),
const QByteArray & user = QByteArray(),
const QByteArray & command = QByteArray() )
explicit

Definition at line 57 of file ssh.cpp.

◆ ~SshProcess()

KDESu::SshProcess::~SshProcess ( )

Definition at line 66 of file ssh.cpp.

Member Function Documentation

◆ checkInstall()

int KDESu::SshProcess::checkInstall ( const char * password)

Checks if the stub is installed and if the password is correct.

Returns
Zero if everything is correct, nonzero otherwise.

Definition at line 83 of file ssh.cpp.

◆ checkNeedPassword()

int KDESu::SshProcess::checkNeedPassword ( )

Checks if the current user@host needs a password.

Returns
The prompt for the password if a password is required. A null string otherwise.
Todo
The return doc is so obviously wrong that the C code needs to be checked.

Definition at line 89 of file ssh.cpp.

◆ display()

QByteArray KDESu::SshProcess::display ( )
protectedvirtual

This virtual function can be overloaded when special behavior is desired.

By default, it returns the value returned by KCookie.

Reimplemented from KDESu::StubProcess.

Definition at line 248 of file ssh.cpp.

◆ displayAuth()

QByteArray KDESu::SshProcess::displayAuth ( )
protectedvirtual

See display.

Reimplemented from KDESu::StubProcess.

Definition at line 254 of file ssh.cpp.

◆ error()

QByteArray KDESu::SshProcess::error ( ) const

Definition at line 160 of file ssh.cpp.

◆ exec()

int KDESu::SshProcess::exec ( const char * password,
int check = 0 )

Executes the command.

Definition at line 95 of file ssh.cpp.

◆ prompt()

QByteArray KDESu::SshProcess::prompt ( ) const

Definition at line 155 of file ssh.cpp.

◆ setHost()

void KDESu::SshProcess::setHost ( const QByteArray & host)

Sets the target host.

Definition at line 71 of file ssh.cpp.

◆ setStub()

void KDESu::SshProcess::setStub ( const QByteArray & stub)

Sets the localtion of the remote stub.

Definition at line 77 of file ssh.cpp.

◆ virtual_hook()

void KDESu::SshProcess::virtual_hook ( int id,
void * data )
protectedvirtual

Standard hack to add virtual methods in a BC way.

Unused.

Reimplemented from KDESu::StubProcess.

Definition at line 259 of file ssh.cpp.


The documentation for this class was generated from the following files:
  • ssh.h
  • ssh.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.14.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEsu

Skip menu "KDEsu"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal