• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdesu
 

kdesu

Public Member Functions
KDEsuClient Class Reference

#include <client.h>

List of all members.

Public Member Functions

int exec (const TQCString &command, const TQCString &user, const TQCString &options=0, const QCStringList &env=QCStringList())
int exitCode ()
int setPass (const char *pass, int timeout)
int setHost (const TQCString &host)
int setPriority (int priority)
int setScheduler (int scheduler)
int delCommand (const TQCString &command, const TQCString &user)
int setVar (const TQCString &key, const TQCString &value, int timeout=0, const TQCString &group=0)
TQCString getVar (const TQCString &key)
TQValueList< TQCString > getKeys (const TQCString &group)
bool findGroup (const TQCString &group)
int delVar (const TQCString &key)
int delVars (const TQCString &special_key)
int delGroup (const TQCString &group)
int ping ()
int stopServer ()
int startServer ()
bool isServerSGID ()

Detailed Description

A client class to access kdesud, the KDE su daemon.

Kdesud can assist in password caching in two ways:

  • For high security passwords, like for su and ssh, it executes the password requesting command for you. It feeds the password to the command, without ever returning it to you, the user. The daemon should be installed setgid nogroup, in order to be able to act as an inaccessible, trusted 3rd party. See exec, setPass, delCommand.
  • For lower security passwords, like web and ftp passwords, it can act as a persistent storage for string variables. These variables are returned to the user, and the daemon doesn't need to be setgid nogroup for this. See setVar, delVar, delGroup.

Definition at line 50 of file client.h.


Member Function Documentation

int KDEsuClient::delCommand ( const TQCString &  command,
const TQCString &  user 
)

Remove a password for a user/command.

Parameters:
commandThe command.
userThe user.
Returns:
zero on success, -1 on an error

Definition at line 268 of file client.cpp.

int KDEsuClient::delGroup ( const TQCString &  group)

Delete all persistent variables in a group.

Parameters:
groupthe group name. See setVar.
Returns:

Definition at line 353 of file client.cpp.

int KDEsuClient::delVar ( const TQCString &  key)

Delete a persistent variable.

Parameters:
keyThe name of the variable.
Returns:
zero on success, -1 on failure.

Definition at line 345 of file client.cpp.

int KDEsuClient::delVars ( const TQCString &  special_key)

Delete all persistent variables with the given key.

A specicalized variant of delVar(TQCString) that removes all subsets of the cached varaibles given by key. In order for all cached variables related to this key to be deleted properly, the value given to the group argument when the setVar function was called, must be a subset of the argument given here and the key

Note:
Simply supplying the group key here WILL not necessarily work. If you only have a group key, then use delGroup instead.
Parameters:
special_keythe name of the variable.
Returns:
zero on success, -1 on failure.

Definition at line 361 of file client.cpp.

int KDEsuClient::exec ( const TQCString &  command,
const TQCString &  user,
const TQCString &  options = 0,
const QCStringList &  env = QCStringList() 
)

Lets kdesud execute a command.

If the daemon does not have a password for this command, this will fail and you need to call setPass().

Parameters:
commandThe command to execute.
userThe user to run the command as.
optionsExtra options.
envExtra environment variables.
Returns:
Zero on success, -1 on failure.

Definition at line 224 of file client.cpp.

int KDEsuClient::exitCode ( )

Wait for the last command to exit and return the exit code.

Returns:
Exit code of last command, -1 on failure.

Definition at line 374 of file client.cpp.

bool KDEsuClient::findGroup ( const TQCString &  group)

Returns true if the specified group exists is cached.

Parameters:
groupthe group key
Returns:
true if the group is found

Definition at line 335 of file client.cpp.

TQValueList< TQCString > KDEsuClient::getKeys ( const TQCString &  group)

Gets all the keys that are membes of the given group.

Parameters:
groupthe group name of the variables.
Returns:
a list of the keys in the group.

Definition at line 302 of file client.cpp.

TQCString KDEsuClient::getVar ( const TQCString &  key)

Get a persistent variable.

Parameters:
keyThe name of the variable.
Returns:
Its value.

Definition at line 292 of file client.cpp.

bool KDEsuClient::isServerSGID ( )

Returns true if the server is safe (installed setgid), false otherwise.

Definition at line 401 of file client.cpp.

int KDEsuClient::ping ( )

Ping kdesud.

This can be used for diagnostics.

Returns:
Zero on success, -1 on failure

Definition at line 369 of file client.cpp.

int KDEsuClient::setHost ( const TQCString &  host)

Set the target host (optional).

Definition at line 246 of file client.cpp.

int KDEsuClient::setPass ( const char *  pass,
int  timeout 
)

Set root's password, lasts one session.

Parameters:
passRoot's password.
timeoutThe time that a password will live.
Returns:
Zero on success, -1 on failure.

Definition at line 214 of file client.cpp.

int KDEsuClient::setPriority ( int  priority)

Set the desired priority (optional), see StubProcess.

Definition at line 254 of file client.cpp.

int KDEsuClient::setScheduler ( int  scheduler)

Set the desired scheduler (optional), see StubProcess.

Definition at line 261 of file client.cpp.

int KDEsuClient::setVar ( const TQCString &  key,
const TQCString &  value,
int  timeout = 0,
const TQCString &  group = 0 
)

Set a persistent variable.

Parameters:
keyThe name of the variable.
valueIts value.
timeoutThe timeout in seconds for this key. Zero means no timeout.
groupMake the key part of a group. See delGroup.
Returns:
zero on success, -1 on failure.

Definition at line 277 of file client.cpp.

int KDEsuClient::startServer ( )

Try to start up kdesud.

Definition at line 417 of file client.cpp.

int KDEsuClient::stopServer ( )

Stop the daemon.

Definition at line 383 of file client.cpp.


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

kdesu

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

kdesu

Skip menu "kdesu"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdesu by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |