KDESu::SshProcess

Search for usage in LXR

#include <KDESu/SshProcess>

Inheritance diagram for KDESu::SshProcess:

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())
 
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
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
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

QByteArray display () override
 
QByteArray displayAuth () override
 
void virtual_hook (int id, void *data) override
 
- Protected Member Functions inherited from KDESu::StubProcess
KDESU_NO_EXPORT StubProcess (StubProcessPrivate &dd)
 
int converseStub (int check)
 
void virtual_hook (int id, void *data) override
 
- Protected Member Functions inherited from KDESu::PtyProcess
KDESU_NO_EXPORT PtyProcess (PtyProcessPrivate &dd)
 
QList< QByteArrayenvironment () const
 

Additional Inherited Members

- Static Public Member Functions inherited from KDESu::PtyProcess
static bool checkPid (pid_t pid)
 
static int checkPidExited (pid_t pid)
 
static int waitMS (int fd, int ms)
 
- Protected Attributes inherited from KDESu::StubProcess
QByteArray m_command
 
KDESuPrivate::KCookie * m_cookie
 
int m_priority
 
int m_scheduler
 
QByteArray m_user
 
bool m_XOnly
 
- Protected Attributes inherited from KDESu::PtyProcess
std::unique_ptr< PtyProcessPrivate > const d_ptr
 
QByteArray m_command
 
bool m_erase
 
QByteArray m_exitString
 
int m_pid
 
bool m_terminal
 

Detailed Description

Executes a remote command, using ssh.

Definition at line 23 of file sshprocess.h.

Member Enumeration Documentation

◆ Errors

enum KDESu::SshProcess::Errors

Definition at line 26 of file sshprocess.h.

Constructor & Destructor Documentation

◆ SshProcess()

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

Definition at line 40 of file sshprocess.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 64 of file sshprocess.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 69 of file sshprocess.cpp.

◆ display()

QByteArray KDESu::SshProcess::display ( )
overrideprotectedvirtual

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 234 of file sshprocess.cpp.

◆ displayAuth()

QByteArray KDESu::SshProcess::displayAuth ( )
overrideprotectedvirtual

See display.

Reimplemented from KDESu::StubProcess.

Definition at line 239 of file sshprocess.cpp.

◆ error()

QByteArray KDESu::SshProcess::error ( ) const

Definition at line 144 of file sshprocess.cpp.

◆ exec()

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

Executes the command.

Definition at line 74 of file sshprocess.cpp.

◆ prompt()

QByteArray KDESu::SshProcess::prompt ( ) const

Definition at line 137 of file sshprocess.cpp.

◆ setHost()

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

Sets the target host.

Definition at line 50 of file sshprocess.cpp.

◆ setStub()

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

Sets the location of the remote stub.

Definition at line 57 of file sshprocess.cpp.

◆ virtual_hook()

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

Standard hack to add virtual methods in a BC way.

Unused.

Reimplemented from KDESu::PtyProcess.

Definition at line 244 of file sshprocess.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:49:31 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.