[Libreoffice-commits] online.git: net/Socket.cpp
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Apr 1 09:57:00 UTC 2019
net/Socket.cpp | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 7b70aab367ccafb82a8b62892df290415b8e18af
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Apr 1 10:56:15 2019 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Apr 1 10:56:15 2019 +0100
peercred: fixup compile issues.
Change-Id: I87d956f5754e7b353776c538b7bb9dfea7f62883
diff --git a/net/Socket.cpp b/net/Socket.cpp
index 441128f16..f4fb12c2b 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -570,16 +570,16 @@ std::shared_ptr<Socket> LocalServerSocket::accept()
// Sanity check this incoming socket
struct ucred creds;
socklen_t credSize = sizeof(struct ucred);
- if (getsockopt(GetFD(), SOL_SOCKET, SO_PEERCRED, &creds, &credSize) < 0)
+ if (getsockopt(getFD(), SOL_SOCKET, SO_PEERCRED, &creds, &credSize) < 0)
{
- LOG_ERR("Failed to get peer creds on " << GetFD() << " " << strerror(errno));
+ LOG_ERR("Failed to get peer creds on " << getFD() << " " << strerror(errno));
::close(rc);
return std::shared_ptr<Socket>(nullptr);
}
- int uid = getuid();
- int gid = getgid();
- if (creds.uid != uid || cred.gid != gid)
+ uid_t uid = getuid();
+ uid_t gid = getgid();
+ if (creds.uid != uid || creds.gid != gid)
{
LOG_ERR("Peercred mis-match on domain socket - closing connection. uid: " <<
creds.uid << "vs." << uid << " gid: " << creds.gid << "vs." << gid);
@@ -590,7 +590,6 @@ std::shared_ptr<Socket> LocalServerSocket::accept()
addr.append(std::to_string(creds.pid));
_socket->setClientAddress(addr);
- std::shared_ptr<Socket> _socket = _sockFactory->create(rc);
LOG_DBG("Accepted socket is UDS - address " << addr <<
" and pid/gid " << creds.pid << "/" << creds.gid);
return _socket;
More information about the Libreoffice-commits
mailing list