This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/19557] New: recvmsg fails retrieving SCM_CREDENTIALS with error EOPNOTSUPP
- From: "alan.griffiths at canonical dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 02 Feb 2016 13:00:33 +0000
- Subject: [Bug libc/19557] New: recvmsg fails retrieving SCM_CREDENTIALS with error EOPNOTSUPP
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19557
Bug ID: 19557
Summary: recvmsg fails retrieving SCM_CREDENTIALS with error
EOPNOTSUPP
Product: glibc
Version: 2.21
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: alan.griffiths at canonical dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
Following update on Ubuntu Xenial, the following test case fails:
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <sys/socket.h>
#include <sys/stat.h>
TEST(IsItBroken, recvmsg)
{
using namespace testing;
enum { server, client, size };
int socket_fd[size];
int const opt = 1;
ASSERT_THAT(socketpair(AF_LOCAL, SOCK_STREAM, 0, socket_fd), Eq(0));
auto const msg = "A random message";
send(socket_fd[client], msg, sizeof msg, MSG_DONTWAIT | MSG_NOSIGNAL);
ASSERT_THAT(setsockopt(socket_fd[server], SOL_SOCKET, SO_PASSCRED, &opt,
sizeof(opt)), Ne(-1));
union {
struct cmsghdr cmh;
char control[CMSG_SPACE(sizeof(ucred))];
} control_un;
control_un.cmh.cmsg_len = CMSG_LEN(sizeof(ucred));
control_un.cmh.cmsg_level = SOL_SOCKET;
control_un.cmh.cmsg_type = SCM_CREDENTIALS;
msghdr msgh;
msgh.msg_name = nullptr;
msgh.msg_namelen = 0;
msgh.msg_iov = nullptr;
msgh.msg_iovlen = 0;
msgh.msg_control = control_un.control;
msgh.msg_controllen = sizeof(control_un.control);
errno = 0;
EXPECT_THAT(recvmsg(socket_fd[server], &msgh, MSG_PEEK), Ne(-1))
<< "Error: " << strerror(errno);
for (auto socket : socket_fd) close(socket);
}
--
You are receiving this mail because:
You are on the CC list for the bug.