KDESu

secure.h
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
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
The Socket_security class authenticates the peer for you.
Definition secure.h:20
int peerUid() const
Returns the peer's user-id.
Definition secure.h:31
SocketSecurity(int fd)
Under Linux, Socket_security is supported.
Definition secure.cpp:91
int peerGid() const
Returns the peer's group-id.
Definition secure.h:37
int peerPid() const
Returns the peer's process-id.
Definition secure.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.