1/* vi: ts=8 sts=4 sw=4
2
3 This file is part of the KDE project, module kdesu.
4 SPDX-FileCopyrightText: 1999, 2000 Geert Jansen <jansen@kde.org>
5*/
6
7#ifndef __Secure_h_included__
8#define __Secure_h_included__
9
10#include <sys/socket.h>
11#include <sys/types.h>
12
13/**
14 * The Socket_security class authenticates the peer for you. It provides
15 * the process-id, user-id and group-id plus the MD5 sum of the connected
16 * binary.
17 */
18
19class SocketSecurity
20{
21public:
22 explicit SocketSecurity(int fd);
23
24 /** Returns the peer's process-id. */
25 int peerPid() const
26 {
27 return pid;
28 }
29
30 /** Returns the peer's user-id */
31 int peerUid() const
32 {
33 return uid;
34 }
35
36 /** Returns the peer's group-id */
37 int peerGid() const
38 {
39 return gid;
40 }
41
42private:
43 int pid;
44 int gid;
45 int uid;
46};
47
48#endif
49

source code of kdesu/src/kdesud/secure.h