Revert "Check effective credentials of socket peers"

This reverts commit 8412c867a5.

Just checking the credentials of the peer turns out to be insufficient.
See https://github.com/fish-shell/fish-shell/issues/1436.
This commit is contained in:
David Adam
2014-07-31 16:57:42 +08:00
parent c0989dce2d
commit af14cf8f8b
7 changed files with 5 additions and 137 deletions

View File

@@ -88,8 +88,6 @@ static int try_get_socket_once(void)
wdir = path;
wuname = user;
uid_t seuid;
gid_t segid;
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
{
@@ -137,13 +135,6 @@ static int try_get_socket_once(void)
return -1;
}
if ((getpeereid(s, &seuid, &segid) != 0) || seuid != geteuid())
{
debug(1, L"Wrong credentials for socket %s at fd %d", name.c_str(), s);
close(s);
return -1;
}
if ((make_fd_nonblocking(s) != 0) || (fcntl(s, F_SETFD, FD_CLOEXEC) != 0))
{
wperror(L"fcntl");