From b077bb7f720ae43bc8d26c1ccb7b93bbc0fb9931 Mon Sep 17 00:00:00 2001 From: jmmv Date: Tue, 30 Aug 2005 15:03:04 +0000 Subject: [PATCH] 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@. --- sys/kern/uipc_usrreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 950bc509668f..399bd19dff32 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -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 -__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 #include @@ -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);