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

KDEsu

KDESu::SuProcess

KDESu::SuProcess Class Reference

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

#include <kdesu/su.h>

Inheritance diagram for KDESu::SuProcess:
KDESu::StubProcess KDESu::PtyProcess

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)
QString superUserCommand ()
 SuProcess (const QByteArray &user=0, const QByteArray &command=0)
bool useUsersOwnPassword ()
 ~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 25 of file su.h.


Member Enumeration Documentation

enum KDESu::SuProcess::checkMode

Executes the command.

This will wait for the command to finish.

Enumerator:
NoCheck 
Install 
NeedPassword 

Definition at line 36 of file su.h.

enum KDESu::SuProcess::Errors
Enumerator:
SuNotFound 
SuNotAllowed 
SuIncorrectPassword 

Definition at line 31 of file su.h.


Constructor & Destructor Documentation

KDESu::SuProcess::SuProcess ( const QByteArray &  user = 0,
const QByteArray &  command = 0 
) [explicit]

Definition at line 67 of file su.cpp.

KDESu::SuProcess::~SuProcess (  ) 

Definition at line 84 of file su.cpp.


Member Function Documentation

int KDESu::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 104 of file su.cpp.

int KDESu::SuProcess::checkNeedPassword (  ) 

Checks if a password is needed.

Definition at line 109 of file su.cpp.

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

Definition at line 118 of file su.cpp.

QString KDESu::SuProcess::superUserCommand (  ) 

Checks what the default super user command is, e.g.

sudo, su, etc

Returns:
the default super user command

Definition at line 89 of file su.cpp.

bool KDESu::SuProcess::useUsersOwnPassword (  ) 

Checks whether or not the user's password is being asked for or another user's password.

Due to usage of systems such as sudo, even when attempting to switch to another user one may need to enter their own password.

Definition at line 94 of file su.cpp.

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

Standard hack to add virtual methods in a BC way.

Unused.

Reimplemented from KDESu::StubProcess.

Definition at line 353 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
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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