Skip to content
Snippets Groups Projects
Commit 5bcd32e6 authored by Leon Dietrich's avatar Leon Dietrich
Browse files

fix: typo

parent 98a178af
No related branches found
No related tags found
No related merge requests found
Pipeline #10075 failed
......@@ -23,7 +23,7 @@ static std::string get_unix_socket_path(const socketaddr& addr) {
return std::string(((sockaddr_un*) addr.ptr())->sun_path);
}
static auto_fd construct_server_fd(const socketaddr& addr) {
static auto_fd construct_server_fd(const socketaddr& addr, bool use_explicit_authentication) {
if (addr.family() != AF_UNIX) {
throw netio_exception("Expected a UNIX socket file path.");
}
......@@ -59,7 +59,7 @@ static auto_fd construct_server_fd(const socketaddr& addr) {
// FIXME SO_PASSCRED is platform specific (linux). For *BSD there are other APIs
int optval = 1;
if(setsockopt(socket_fd.get(), SOL_SOCKET, SO_PEERCRED, &optval, sizeof(optval)) == -1) {
unlink(get_usocket_path(addr).c_str());
unlink(get_unix_socket_path(addr).c_str());
throw netio_exception("Unable to enable password authentication for file socket. REASON: " + std::string(errno == EINVAL ? "EINVAL" : (errno == ENOPROTOOPT ? "ENOPROTOOPT" : "unexpected")));
// TODO might fail as not created with socketpair(). Check man2 socketpair
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment