Differential D38165 Diff 118368 www/qt5-webengine/files/patch-src_3rdparty_chromium_base_posix_unix__domain__socket.cc
Changeset View
Changeset View
Standalone View
Standalone View
www/qt5-webengine/files/patch-src_3rdparty_chromium_base_posix_unix__domain__socket.cc
--- src/3rdparty/chromium/base/posix/unix_domain_socket.cc.orig 2018-11-13 18:25:11 UTC | --- src/3rdparty/chromium/base/posix/unix_domain_socket.cc.orig 2021-12-15 16:12:54 UTC | ||||
+++ src/3rdparty/chromium/base/posix/unix_domain_socket.cc | +++ src/3rdparty/chromium/base/posix/unix_domain_socket.cc | ||||
@@ -5,7 +5,10 @@ | @@ -5,7 +5,10 @@ | ||||
#include "base/posix/unix_domain_socket.h" | #include "base/posix/unix_domain_socket.h" | ||||
#include <errno.h> | #include <errno.h> | ||||
+#include <sys/param.h> | +#include <sys/param.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
+#include <sys/types.h> | +#include <sys/types.h> | ||||
+#include <sys/ucred.h> | +#include <sys/ucred.h>a | ||||
#if !defined(OS_NACL_NONSFI) | #if !defined(OS_NACL_NONSFI) | ||||
#include <sys/un.h> | #include <sys/un.h> | ||||
#endif | #endif | ||||
@@ -28,6 +31,14 @@ namespace base { | @@ -29,6 +32,14 @@ const size_t UnixDomainSocket::kMaxFileDescriptors = 1 | ||||
const size_t UnixDomainSocket::kMaxFileDescriptors = 16; | const size_t UnixDomainSocket::kMaxFileDescriptors = 16; | ||||
+#ifndef SCM_CREDENTIALS | +#ifndef SCM_CREDENTIALS | ||||
+# define SCM_CREDENTIALS 0x9001 | +# define SCM_CREDENTIALS 0x9001 | ||||
+#endif | +#endif | ||||
+ | + | ||||
+#ifndef SO_PASSCRED | +#ifndef SO_PASSCRED | ||||
+# define SO_PASSCRED 0x9002 | +# define SO_PASSCRED 0x9002 | ||||
+#endif | +#endif | ||||
+ | + | ||||
#if !defined(OS_NACL_NONSFI) | #if !defined(OS_NACL_NONSFI) | ||||
bool CreateSocketPair(ScopedFD* one, ScopedFD* two) { | bool CreateSocketPair(ScopedFD* one, ScopedFD* two) { | ||||
int raw_socks[2]; | int raw_socks[2]; | ||||
@@ -150,7 +161,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, | @@ -151,7 +162,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, | ||||
#if !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX) | #if !defined(OS_NACL_NONSFI) && !defined(OS_APPLE) | ||||
// The PNaCl toolchain for Non-SFI binary build and macOS do not support | // The PNaCl toolchain for Non-SFI binary build and macOS do not support | ||||
// ucred. macOS supports xucred, but this structure is insufficient. | // ucred. macOS supports xucred, but this structure is insufficient. | ||||
- + CMSG_SPACE(sizeof(struct ucred)) | - + CMSG_SPACE(sizeof(struct ucred)) | ||||
+ + CMSG_SPACE(sizeof(struct cmsgcred)) | + + CMSG_SPACE(sizeof(struct cmsgcred)) | ||||
#endif // OS_NACL_NONSFI or OS_MACOSX | #endif // !defined(OS_NACL_NONSFI) && !defined(OS_APPLE) | ||||
; | ; | ||||
char control_buffer[kControlBufferSize]; | char control_buffer[kControlBufferSize]; | ||||
@@ -180,9 +191,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, | @@ -181,9 +192,9 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, | ||||
// SCM_CREDENTIALS. | // SCM_CREDENTIALS. | ||||
if (cmsg->cmsg_level == SOL_SOCKET && | if (cmsg->cmsg_level == SOL_SOCKET && | ||||
cmsg->cmsg_type == SCM_CREDENTIALS) { | cmsg->cmsg_type == SCM_CREDENTIALS) { | ||||
- DCHECK_EQ(payload_len, sizeof(struct ucred)); | - DCHECK_EQ(payload_len, sizeof(struct ucred)); | ||||
+ DCHECK_EQ(payload_len, sizeof(struct cmsgcred)); | + DCHECK_EQ(payload_len, sizeof(struct cmsgcred)); | ||||
DCHECK_EQ(pid, -1); | DCHECK_EQ(pid, -1); | ||||
- pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid; | - pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid; | ||||
+ pid = getpid(); | + pid = getpid(); | ||||
} | } | ||||
#endif // !defined(OS_NACL_NONSFI) && !defined(OS_MACOSX) | #endif // !defined(OS_NACL_NONSFI) && !defined(OS_APPLE) | ||||
} | } |