kde-workspace/kdesu/kdesud/secure.h
2014-11-15 03:25:12 +02:00

38 lines
788 B
C++

/* vi: ts=8 sts=4 sw=4
*
* This file is part of the KDE project, module kdesu.
* Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
*/
#ifndef __Secure_h_included__
#define __Secure_h_included__
#include <sys/types.h>
#include <sys/socket.h>
/**
* The Socket_security class autheticates the peer for you. It provides
* the process-id, user-id and group-id plus the MD5 sum of the connected
* binary.
*/
class SocketSecurity {
public:
explicit SocketSecurity(int fd);
/** Returns the peer's process-id. */
int peerPid() const { return pid; }
/** Returns the peer's user-id */
int peerUid() const { return uid; }
/** Returns the peer's group-id */
int peerGid() const { return gid; }
private:
int pid;
int gid;
int uid;
};
#endif