11#include <config-kdesud.h>
12#include <ksud_debug.h>
24typedef unsigned ksocklen_t;
39 if (getpeereid(sockfd, &euid, &egid) == 0) {
46#elif HAVE_GETPEERUCRED
57 if (getpeerucred(sockfd, &ucred) == 0) {
58 uid = ucred_geteuid(ucred);
59 gid = ucred_getrgid(ucred);
65#elif defined(SO_PEERCRED)
73 ksocklen_t len =
sizeof(
struct ucred);
74 if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0) {
75 qCCritical(KSUD_LOG) <<
"getsockopt(SO_PEERCRED) " << strerror(errno);
85#warning SocketSecurity support for your platform not implemented/available!
96 static bool warned_him =
false;
99 qCWarning(KSUD_LOG) <<
"Using void socket security. Please add support for your";
100 qCWarning(KSUD_LOG) <<
"platform to src/kdesud/secure.cpp";
SocketSecurity(int fd)
Under Linux, Socket_security is supported.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:38 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.