SuProcess Class Reference

`#include <su.h>`

Inheritance diagram for SuProcess:

## Public Types

enum | Errors { SuNotFound =1, SuNotAllowed, SuIncorrectPassword }
enum | checkMode { NoCheck =0, Install =1, NeedPassword =2 }
Public Types inherited from StubProcess
enum | Scheduler { SchedNormal, SchedRealtime }
Public Types inherited from PtyProcess
enum | checkPidStatus { Error =-1, NotExited =-2, Killed =-3 }

## Public Member Functions

| SuProcess (const QCString &user=0, const QCString &command=0)
int | exec (const char *password, int check=NoCheck)
int | checkInstall (const char *password)
int | checkNeedPassword ()
Public Member Functions inherited from StubProcess
void | setDcopTransport (const QCString &dcopTransport)
void | setCommand (const QCString &command)
void | setUser (const QCString &user)
void | setXOnly (bool xonly)
void | setDCOPForwarding (bool dcopForwarding)
void | setPriority (int prio)
void | setScheduler (int sched)
Public Member Functions inherited from PtyProcess
int | exec (const QCString &command, const QCStringList &args)
QCString | readLine (bool block=true)
QCString | readAll (bool block=true)
void | writeLine (const QCString &line, bool addNewline=true)
void | unreadLine (const QCString &line, bool addNewline=true)
void | setExitString (const QCString &exit)
int | waitForChild ()
int | WaitSlave ()
int | enableLocalEcho (bool enable=true)
void | setTerminal (bool terminal)
void | setErase (bool erase)
void | setEnvironment (const QCStringList &env)
int | fd ()
int | pid ()

## Protected Member Functions

virtual void | virtual_hook (int id, void *data)
Protected Member Functions inherited from StubProcess
int | ConverseStub (int check)
void | notifyTaskbar (const QString &suffix)
virtual QCString | display ()
virtual QCString | dcopServer ()
virtual QCString | dcopAuth ()
virtual QCString | iceAuth ()
Protected Member Functions inherited from PtyProcess
const QCStringList & | environment () const

## Additional Inherited Members

Static Public Member Functions inherited from PtyProcess
static int | waitMS (int fd, int ms)
static bool | checkPid (pid_t pid)
static int | checkPidExited (pid_t pid)
Protected Attributes inherited from StubProcess
bool | m_bXOnly
bool | m_bDCOPForwarding
int | m_Priority
int | m_Scheduler
QCString | m_dcopTransport
QCString | m_Command
QCString | m_User
KCookie * | m_pCookie
Protected Attributes inherited from PtyProcess
bool | m_bErase
bool | m_bTerminal
int | m_Pid
int | m_Fd
QCString | m_Command
QCString | m_Exit

## Detailed Description

Executes a command under elevated privileges, using su.

Definition at line 26 of file su.h.

## Member Enumeration Documentation

enum SuProcess::checkMode

Executes the command.

This will wait for the command to finish.

Definition at line 37 of file su.h.

## Member Function Documentation

int SuProcess::checkInstall | ( | const char * | password | ) |

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

Returns
  Zero if everything is correct, nonzero otherwise.

Definition at line 72 of file su.cpp.

int SuProcess::checkNeedPassword | ( |  | ) |

Checks if a password is needed.

Definition at line 77 of file su.cpp.

int SuProcess::exec | ( | const char * | password,
|  | int | check = `NoCheck`
| ) |  |

QCString command = __PATH_SU; if (::access(__PATH_SU, X_OK) != 0)

command = QFile::encodeName(KGlobal::dirs()->findExe("su"));

if (kill(m_Pid, SIGKILL) < 0) { ret=error; }

Definition at line 86 of file su.cpp.

The documentation for this class was generated from the following files:

- su.h
- su.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys