client.h
/* vi: ts=8 sts=4 sw=4
*
* $Id$
*
* This file is part of the KDE project, module kdesu.
* Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
*
* This is free software; you can use this library under the GNU Library
* General Public License, version 2. See the file "COPYING.LIB" for the
* exact licensing terms.
*
* client.h: client to access kdesud.
*/
#ifndef __KDE_su_Client_h_Included__
#define __KDE_su_Client_h_Included__
#include <qglobal.h>
#include <kdelibs_export.h>
#ifdef Q_OS_UNIX
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <qcstring.h>
#include <qvaluelist.h>
typedef QValueList<QCString> QCStringList;
class KDESU_EXPORT KDEsuClient {
public:
KDEsuClient();
~KDEsuClient();
int exec(const QCString &command, const QCString &user, const QCString &options=0, const QCStringList &env=QCStringList());
int exitCode();
int setPass(const char *pass, int timeout);
int setHost(const QCString &host);
int setPriority(int priority);
int setScheduler(int scheduler);
int delCommand(const QCString &command, const QCString &user);
int setVar(const QCString &key, const QCString &value, int timeout=0, const QCString &group=0);
QCString getVar(const QCString &key);
QValueList<QCString> getKeys(const QCString &group);
bool findGroup(const QCString &group);
int delVar(const QCString &key);
int delVars(const QCString &special_key);
int delGroup(const QCString &group);
int ping();
int stopServer();
int startServer();
bool isServerSGID();
private:
int connect();
int sockfd;
QCString sock;
int command(const QCString &cmd, QCString *result=0L);
QCString escape(const QCString &str);
class KDEsuClientPrivate;
KDEsuClientPrivate *d;
};
#endif //Q_OS_UNIX
#endif //__KDE_su_Client_h_Included__
KDEsuClient
A client class to access kdesud, the KDE su daemon.
Definition: client.h:50

KDE Home | KDE Accessibility Home | Description of Access Keys