bindat(2)/connectat(2): allow implicit EMPTYPATH for unix domain sockets
path specification. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57370
This commit is contained in:
@@ -612,8 +612,9 @@ uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
|
|||||||
buf[namelen] = 0;
|
buf[namelen] = 0;
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | NOCACHE,
|
NDINIT_ATRIGHTS(&nd, CREATE, NOFOLLOW | LOCKPARENT | NOCACHE |
|
||||||
UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_BINDAT));
|
EMPTYPATH, UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights,
|
||||||
|
CAP_BINDAT));
|
||||||
/* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */
|
/* SHOULD BE ABLE TO ADOPT EXISTING AND wakeup() ALA FIFO's */
|
||||||
error = namei(&nd);
|
error = namei(&nd);
|
||||||
if (error)
|
if (error)
|
||||||
@@ -2921,7 +2922,7 @@ unp_connectat(int fd, struct socket *so, struct sockaddr *nam,
|
|||||||
sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
|
sa = malloc(sizeof(struct sockaddr_un), M_SONAME, M_WAITOK);
|
||||||
else
|
else
|
||||||
sa = NULL;
|
sa = NULL;
|
||||||
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF,
|
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | EMPTYPATH,
|
||||||
UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_CONNECTAT));
|
UIO_SYSSPACE, buf, fd, cap_rights_init_one(&rights, CAP_CONNECTAT));
|
||||||
error = namei(&nd);
|
error = namei(&nd);
|
||||||
if (error)
|
if (error)
|
||||||
|
|||||||
Reference in New Issue
Block a user