convert holdsock() to fget(). Add XXX reminder for future socket locking.
This commit is contained in:
parent
560d91adcd
commit
7b3d73bcc9
@ -99,10 +99,13 @@ portal_mount(mp, path, data, ndp, td)
|
|||||||
if (error)
|
if (error)
|
||||||
return (error);
|
return (error);
|
||||||
|
|
||||||
error = holdsock(td->td_proc->p_fd, args.pa_socket, &fp);
|
if ((error = fget(td, args.pa_socket, &fp)) != 0)
|
||||||
if (error)
|
|
||||||
return (error);
|
return (error);
|
||||||
so = (struct socket *) fp->f_data;
|
if (fp->f_type != DTYPE_SOCKET) {
|
||||||
|
fdrop(fp, td);
|
||||||
|
return(ENOTSOCK);
|
||||||
|
}
|
||||||
|
so = (struct socket *) fp->f_data; /* XXX race against userland */
|
||||||
if (so->so_proto->pr_domain->dom_family != AF_UNIX) {
|
if (so->so_proto->pr_domain->dom_family != AF_UNIX) {
|
||||||
fdrop(fp, td);
|
fdrop(fp, td);
|
||||||
return (ESOCKTNOSUPPORT);
|
return (ESOCKTNOSUPPORT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user