connectat(2): do not enable EMPTYPATH for AT_FDCWD
This restores existing error code for connect(2) over unix domain socket when the empty string is specified as socket address. Reported by: eduardo Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57509
This commit is contained in:
@@ -2921,8 +2921,9 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam,
|
||||
sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
|
||||
else
|
||||
sa = NULL;
|
||||
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | EMPTYPATH,
|
||||
UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_CONNECTAT));
|
||||
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF |
|
||||
(fd == AT_FDCWD ? 0 : EMPTYPATH), UIO_SYSSPACE, buf, fd,
|
||||
cap_rights_init_one(&rights, CAP_CONNECTAT));
|
||||
error = namei(&nd);
|
||||
if (error)
|
||||
vp = NULL;
|
||||
|
||||
Reference in New Issue
Block a user