Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Honor the user's umask while creating local sockets...



details:   https://anonhg.NetBSD.org/src/rev/4259a420f887
branches:  trunk
changeset: 583931:4259a420f887
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Tue Aug 30 15:03:04 2005 +0000

description:
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@.

diffstat:

 sys/kern/uipc_usrreq.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r de14c9c6c64e -r 4259a420f887 sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c    Tue Aug 30 10:58:33 2005 +0000
+++ b/sys/kern/uipc_usrreq.c    Tue Aug 30 15:03:04 2005 +0000
@@ -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 @@
        }
        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);



Home | Main Index | Thread Index | Old Index