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

tdesu

  • tdesu
client.h
1/*
2 *
3 * $Id$
4 *
5 * This file is part of the KDE project, module tdesu.
6 * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
7 *
8 * This is free software; you can use this library under the GNU Library
9 * General Public License, version 2. See the file "COPYING.LIB" for the
10 * exact licensing terms.
11 *
12 * client.h: client to access tdesud.
13 */
14
15#ifndef __KDE_su_Client_h_Included__
16#define __KDE_su_Client_h_Included__
17
18#include <tqglobal.h>
19#include <tdelibs_export.h>
20
21#ifdef Q_OS_UNIX
22
23#include <sys/types.h>
24#include <sys/socket.h>
25#include <sys/un.h>
26
27#include <tqcstring.h>
28#include <tqvaluelist.h>
29
30typedef TQValueList<TQCString> QCStringList;
31
49
50class TDESU_EXPORT TDEsuClient {
51public:
52 TDEsuClient();
53 ~TDEsuClient();
54
65 int exec(const TQCString &command, const TQCString &user, const TQCString &options=0, const QCStringList &env=QCStringList());
66
71 int exitCode();
72
80 int setPass(const char *pass, int timeout);
81
85 int setHost(const TQCString &host);
86
90 int setPriority(int priority);
91
95 int setScheduler(int scheduler);
96
103 int delCommand(const TQCString &command, const TQCString &user);
104
114 int setVar(const TQCString &key, const TQCString &value, int timeout=0, const TQCString &group=0);
115
121 TQCString getVar(const TQCString &key);
122
128 TQValueList<TQCString> getKeys(const TQCString &group);
129
137 bool findGroup(const TQCString &group);
138
144 int delVar(const TQCString &key);
145
161 int delVars(const TQCString &special_key);
162
169 int delGroup(const TQCString &group);
170
175 int ping();
176
180 int stopServer();
181
185 int startServer();
186
190 bool isServerSGID();
191
192private:
193 int connect();
194
195 int sockfd;
196 TQCString sock;
197
198 int command(const TQCString &cmd, TQCString *result=0L);
199 TQCString escape(const TQCString &str);
200
201 class TDEsuClientPrivate;
202 TDEsuClientPrivate *d;
203};
204
205#endif //Q_OS_UNIX
206
207#endif //__KDE_su_Client_h_Included__
TDEsuClient::delVar
int delVar(const TQCString &key)
Delete a persistent variable.
Definition client.cpp:363
TDEsuClient::stopServer
int stopServer()
Stop the daemon.
Definition client.cpp:401
TDEsuClient::delGroup
int delGroup(const TQCString &group)
Delete all persistent variables in a group.
Definition client.cpp:371
TDEsuClient::getVar
TQCString getVar(const TQCString &key)
Get a persistent variable.
Definition client.cpp:310
TDEsuClient::setPriority
int setPriority(int priority)
Set the desired priority (optional), see StubProcess.
Definition client.cpp:272
TDEsuClient::delCommand
int delCommand(const TQCString &command, const TQCString &user)
Remove a password for a user/command.
Definition client.cpp:286
TDEsuClient::startServer
int startServer()
Try to start up tdesud.
Definition client.cpp:435
TDEsuClient::exitCode
int exitCode()
Wait for the last command to exit and return the exit code.
Definition client.cpp:392
TDEsuClient::setHost
int setHost(const TQCString &host)
Set the target host (optional).
Definition client.cpp:264
TDEsuClient::getKeys
TQValueList< TQCString > getKeys(const TQCString &group)
Gets all the keys that are membes of the given group.
Definition client.cpp:320
TDEsuClient::exec
int exec(const TQCString &command, const TQCString &user, const TQCString &options=0, const QCStringList &env=QCStringList())
Lets tdesud execute a command.
Definition client.cpp:242
TDEsuClient::delVars
int delVars(const TQCString &special_key)
Delete all persistent variables with the given key.
Definition client.cpp:379
TDEsuClient::setVar
int setVar(const TQCString &key, const TQCString &value, int timeout=0, const TQCString &group=0)
Set a persistent variable.
Definition client.cpp:295
TDEsuClient::isServerSGID
bool isServerSGID()
Returns true if the server is safe (installed setgid), false otherwise.
Definition client.cpp:419
TDEsuClient::setScheduler
int setScheduler(int scheduler)
Set the desired scheduler (optional), see StubProcess.
Definition client.cpp:279
TDEsuClient::setPass
int setPass(const char *pass, int timeout)
Set root's password, lasts one session.
Definition client.cpp:232
TDEsuClient::ping
int ping()
Ping tdesud.
Definition client.cpp:387
TDEsuClient::findGroup
bool findGroup(const TQCString &group)
Returns true if the specified group exists is cached.
Definition client.cpp:353

tdesu

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

tdesu

Skip menu "tdesu"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdesu by doxygen 1.15.0
This website is maintained by Timothy Pearson.