From b529f046c9a64ac5fcfa60747af940cf972b3ebc Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 6 Nov 2011 15:56:34 -0600 Subject: Actually move the kde files that were renamed in the last commit --- kdesu/kdesud/secure.cpp | 80 ------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 kdesu/kdesud/secure.cpp (limited to 'kdesu/kdesud/secure.cpp') diff --git a/kdesu/kdesud/secure.cpp b/kdesu/kdesud/secure.cpp deleted file mode 100644 index 9b30ab4ee..000000000 --- a/kdesu/kdesud/secure.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* vi: ts=8 sts=4 sw=4 - * - * This file is part of the KDE project, module tdesu. - * Copyright (C) 1999,2000 Geert Jansen - * - * secure.cpp: Peer credentials for a UNIX socket. - */ - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include "secure.h" - - -/** - * Under Linux, Socket_security is supported. - */ - -#if defined(SO_PEERCRED) - -SocketSecurity::SocketSecurity(int sockfd) -{ - ksocklen_t len = sizeof(struct ucred); - if (getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0) { - kdError() << "getsockopt(SO_PEERCRED) " << perror << endl; - return; - } - - ok = true; -} - -#else -# if defined(HAVE_GETPEEREID) -SocketSecurity::SocketSecurity(int sockfd) -{ - uid_t euid; - gid_t egid; - if (getpeereid(sockfd, &euid, &egid) == 0) { - cred.uid = euid; - cred.gid = egid; - cred.pid = -1; - ok = true; - } -} - -# else - - -/** - * The default version does nothing. - */ - -SocketSecurity::SocketSecurity(int sockfd) -{ - static bool warned_him = FALSE; - - if (!warned_him) { - kdWarning() << "Using void socket security. Please add support for your" << endl; - kdWarning() << "platform to tdesu/tdesud/secure.cpp" << endl; - warned_him = TRUE; - } - - // This passes the test made in handler.cpp - cred.uid = getuid(); - ok = true; -} - -# endif -#endif -- cgit v1.2.1