KDESu 5.99.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDESu::StubProcess

Chat with kdesu_stub. More...

#include <KDESu/StubProcess>

Public Types

enum  Scheduler { SchedNormal , SchedRealtime }
 Different schedulers. More...
 
- Public Types inherited from KDESu::PtyProcess
enum  checkPidStatus { Error = -1 , NotExited = -2 , Killed = -3 }
 Error return values for checkPidExited() More...
 

Public Member Functions

void setCommand (const QByteArray &command)
 Set the command. More...
 
void setPriority (int prio)
 Set the priority of the process. More...
 
void setScheduler (int sched)
 Set the scheduler type. More...
 
void setUser (const QByteArray &user)
 Set the target user. More...
 
void setXOnly (bool xonly)
 Set to "X only mode": Sycoca is not built and kdeinit is not launched. More...
 
- Public Member Functions inherited from KDESu::PtyProcess
int enableLocalEcho (bool enable=true)
 Enables/disables local echo on the pseudo tty. More...
 
int exec (const QByteArray &command, const QList< QByteArray > &args)
 Forks off and execute a command. More...
 
int fd () const
 Returns the filedescriptor of the process. More...
 
int pid () const
 Returns the pid of the process. More...
 
QByteArray readAll (bool block=true)
 Read all available output from the program's standard out. More...
 
QByteArray readLine (bool block=true)
 Reads a line from the program's standard out. More...
 
void setEnvironment (const QList< QByteArray > &env)
 Set additinal environment variables. More...
 
void setErase (bool erase)
 Overwrites the password as soon as it is used. More...
 
void setExitString (const QByteArray &exit)
 Sets the exit string. More...
 
void setTerminal (bool terminal)
 Enables/disables terminal output. More...
 
void unreadLine (const QByteArray &line, bool addNewline=true)
 Puts back a line of input. More...
 
int waitForChild ()
 Waits for the child to exit. More...
 
int waitSlave ()
 Waits until the pty has cleared the ECHO flag. More...
 
int WaitSlave ()
 
void writeLine (const QByteArray &line, bool addNewline=true)
 Writes a line of text to the program's standard in. More...
 

Protected Member Functions

 StubProcess (StubProcessPrivate &dd)
 
int converseStub (int check)
 Exchange all parameters with kdesu_stub. More...
 
virtual QByteArray display ()
 This virtual function can be overloaded when special behavior is desired. More...
 
virtual QByteArray displayAuth ()
 See display. More...
 
void virtual_hook (int id, void *data) override
 Standard hack to add virtual methods in a BC way. More...
 
- Protected Member Functions inherited from KDESu::PtyProcess
 PtyProcess (PtyProcessPrivate &dd)
 
QList< QByteArray > environment () const
 
virtual void virtual_hook (int id, void *data)
 Standard hack to add virtual methods in a BC way. More...
 

Protected Attributes

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
QByteArray m_command
 Unused. More...
 
bool m_erase
 
QByteArray m_exitString
 String to scan for in output that indicates child has exited. More...
 
int m_pid
 PID of child process. More...
 
bool m_terminal
 Indicates running in a terminal, causes additional newlines to be printed after output. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from KDESu::PtyProcess
static bool checkPid (pid_t pid)
 Basic check for the existence of pid. More...
 
static int checkPidExited (pid_t pid)
 Check process exit status for process pid. More...
 
static int waitMS (int fd, int ms)
 Wait ms milliseconds (ie. More...
 

Detailed Description

Chat with kdesu_stub.

StubProcess extends PtyProcess with functionality to chat with kdesu_stub.

Member Enumeration Documentation

◆ Scheduler

Different schedulers.

SchedNormal is the normal Unix timesharing scheduler, while SchedRealtime is a POSIX.1b realtime scheduler.

Member Function Documentation

◆ converseStub()

int KDESu::StubProcess::converseStub ( int  check)
protected

Exchange all parameters with kdesu_stub.

◆ display()

virtual QByteArray KDESu::StubProcess::display ( )
protectedvirtual

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

By default, it returns the value returned by KCookie.

Reimplemented in KDESu::SshProcess.

◆ displayAuth()

virtual QByteArray KDESu::StubProcess::displayAuth ( )
protectedvirtual

See display.

Reimplemented in KDESu::SshProcess.

◆ setCommand()

void KDESu::StubProcess::setCommand ( const QByteArray &  command)

Set the command.

◆ setPriority()

void KDESu::StubProcess::setPriority ( int  prio)

Set the priority of the process.

The priority value must be between 0 and 100, 0 being the lowest priority. This value is mapped to the scheduler and system dependent priority range of the OS.

◆ setScheduler()

void KDESu::StubProcess::setScheduler ( int  sched)

Set the scheduler type.

◆ setUser()

void KDESu::StubProcess::setUser ( const QByteArray &  user)

Set the target user.

◆ setXOnly()

void KDESu::StubProcess::setXOnly ( bool  xonly)

Set to "X only mode": Sycoca is not built and kdeinit is not launched.

◆ virtual_hook()

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

Standard hack to add virtual methods in a BC way.

Unused.

Reimplemented from KDESu::PtyProcess.