• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDEsu

SuProcess Class Reference

Executes a command under elevated privileges, using su. More...

#include <su.h>

Inheritance diagram for SuProcess:

Inheritance graph
[legend]

List of all members.


Public Types

enum  checkMode { NoCheck = 0, Install = 1, NeedPassword = 2 }
enum  Errors { SuNotFound = 1, SuNotAllowed, SuIncorrectPassword }

Public Member Functions

int checkInstall (const char *password)
int checkNeedPassword ()
int exec (const char *password, int check=NoCheck)
 SuProcess (const QCString &user=0, const QCString &command=0)
 ~SuProcess ()

Protected Member Functions

virtual void virtual_hook (int id, void *data)

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.

Enumerator:
NoCheck 
Install 
NeedPassword 

Definition at line 37 of file su.h.

enum SuProcess::Errors

Enumerator:
SuNotFound 
SuNotAllowed 
SuIncorrectPassword 

Definition at line 32 of file su.h.


Constructor & Destructor Documentation

SuProcess::SuProcess ( const QCString &  user = 0,
const QCString &  command = 0 
)

Definition at line 53 of file su.cpp.

SuProcess::~SuProcess (  ) 

Definition at line 68 of file su.cpp.


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.

void SuProcess::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Reimplemented from StubProcess.

Definition at line 339 of file su.cpp.


The documentation for this class was generated from the following files:
  • su.h
  • su.cpp

KDEsu

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal