mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 06:41:14 -03:00
Merge branch 'master' into death_of_fishd
Conflicts: configure.ac
This commit is contained in:
@@ -89,6 +89,8 @@ 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)
|
||||
{
|
||||
@@ -142,6 +144,13 @@ 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");
|
||||
|
||||
Reference in New Issue
Block a user