Honor the user's umask while creating local sockets. Several other systems

do already this (such as FreeBSD, OpenBSD and Linux), so it will improve
portability of some third-party programs.  No objections in tech-kern@.
This commit is contained in:
jmmv 2005-08-30 15:03:04 +00:00
parent f851540ac2
commit b077bb7f72
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_usrreq.c,v 1.83 2005/06/16 14:36:42 yamt Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.84 2005/08/30 15:03:04 jmmv Exp $ */
/*-
* Copyright (c) 1998, 2000, 2004 The NetBSD Foundation, Inc.
@ -103,7 +103,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.83 2005/06/16 14:36:42 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.84 2005/08/30 15:03:04 jmmv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -638,7 +638,7 @@ restart:
}
VATTR_NULL(&vattr);
vattr.va_type = VSOCK;
vattr.va_mode = ACCESSPERMS;
vattr.va_mode = ACCESSPERMS & ~(p->p_cwdi->cwdi_cmask);
VOP_LEASE(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr);
vn_finished_write(mp, 0);