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

KDEsu

  • KDESu
  • SuProcess
Public Types | Public Member Functions | Protected Member Functions | List of all members
KDESu::SuProcess Class Reference

#include <kdesu/su.h>

Inheritance diagram for KDESu::SuProcess:
Inheritance graph
[legend]

Public Types

enum  checkMode { NoCheck =0, Install =1, NeedPassword =2 }
 
enum  Errors { SuNotFound =1, SuNotAllowed, SuIncorrectPassword }
 
- 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

 SuProcess (const QByteArray &user=0, const QByteArray &command=0)
 
 ~SuProcess ()
 
int checkInstall (const char *password)
 
int checkNeedPassword ()
 
int exec (const char *password, int check=NoCheck)
 
QString superUserCommand ()
 
bool useUsersOwnPassword ()
 
- Public Member Functions inherited from KDESu::StubProcess
 StubProcess ()
 
 ~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
 PtyProcess ()
 
virtual ~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

virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KDESu::StubProcess
int ConverseStub (int check)
 
virtual QByteArray display ()
 
virtual QByteArray displayAuth ()
 
- Protected Member Functions inherited from KDESu::PtyProcess
QList< QByteArray > environment () const
 

Additional Inherited Members

- Static Public Member Functions inherited from KDESu::PtyProcess
static bool checkPid (pid_t pid)
 
static int checkPidExited (pid_t pid)
 
- Public Attributes inherited from KDESu::PtyProcess
public __pad0__: static int waitMS(int fd
 
public int ms
 
- Protected Attributes inherited from KDESu::StubProcess
bool m_bXOnly
 
QByteArray m_Command
 
KDESuPrivate::KCookie * m_pCookie
 
int m_Priority
 
int m_Scheduler
 
QByteArray m_User
 
- Protected Attributes inherited from KDESu::PtyProcess
bool m_bErase
 
bool m_bTerminal
 
QByteArray m_Command
 
QByteArray m_Exit
 
int m_Pid
 

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 72 of file su.cpp.

KDESu::SuProcess::~SuProcess ( )

Definition at line 89 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 109 of file su.cpp.

int KDESu::SuProcess::checkNeedPassword ( )

Checks if a password is needed.

Definition at line 114 of file su.cpp.

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

Definition at line 123 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 94 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 99 of file su.cpp.

void KDESu::SuProcess::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Standard hack to add virtual methods in a BC way.

Unused.

Reimplemented from KDESu::StubProcess.

Definition at line 332 of file su.cpp.


The documentation for this class was generated from the following files:
  • su.h
  • su.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEsu

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal