From owner-svn-src-head@FreeBSD.ORG Thu Jul 2 20:05:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F92D106566C; Thu, 2 Jul 2009 20:05:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33B058FC15; Thu, 2 Jul 2009 20:05:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n62K5MqE053615; Thu, 2 Jul 2009 20:05:22 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n62K5LXo053614; Thu, 2 Jul 2009 20:05:21 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200907022005.n62K5LXo053614@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 2 Jul 2009 20:05:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195296 - in head: sys/ufs/ufs tools/regression/acltools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 20:05:22 -0000 Author: trasz Date: Thu Jul 2 20:05:21 2009 New Revision: 195296 URL: http://svn.freebsd.org/changeset/base/195296 Log: Fix fpathconf(3) on fifos, in effect making ls(1) properly display '+' on them. Taken from kern/125613, with cosmetic changes. PR: kern/125613 Submitted by: Jaakko Heinonen Approved by: re (kib) Modified: head/sys/ufs/ufs/ufs_vnops.c head/tools/regression/acltools/tools-posix.test Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Thu Jul 2 18:24:37 2009 (r195295) +++ head/sys/ufs/ufs/ufs_vnops.c Thu Jul 2 20:05:21 2009 (r195296) @@ -112,6 +112,7 @@ static vop_symlink_t ufs_symlink; static vop_whiteout_t ufs_whiteout; static vop_close_t ufsfifo_close; static vop_kqfilter_t ufsfifo_kqfilter; +static vop_pathconf_t ufsfifo_pathconf; /* * A virgin directory (no blushing please). @@ -2101,6 +2102,29 @@ ufsfifo_kqfilter(ap) } /* + * Return POSIX pathconf information applicable to fifos. + */ +static int +ufsfifo_pathconf(ap) + struct vop_pathconf_args /* { + struct vnode *a_vp; + int a_name; + int *a_retval; + } */ *ap; +{ + + switch (ap->a_name) { + case _PC_ACL_EXTENDED: + case _PC_ACL_PATH_MAX: + case _PC_MAC_PRESENT: + return (ufs_pathconf(ap)); + default: + return (fifo_specops.vop_pathconf(ap)); + } + /* NOTREACHED */ +} + +/* * Return POSIX pathconf information applicable to ufs filesystems. */ static int @@ -2520,6 +2544,7 @@ struct vop_vector ufs_fifoops = { .vop_inactive = ufs_inactive, .vop_kqfilter = ufsfifo_kqfilter, .vop_markatime = ufs_markatime, + .vop_pathconf = ufsfifo_pathconf, .vop_print = ufs_print, .vop_read = VOP_PANIC, .vop_reclaim = ufs_reclaim, Modified: head/tools/regression/acltools/tools-posix.test ============================================================================== --- head/tools/regression/acltools/tools-posix.test Thu Jul 2 18:24:37 2009 (r195295) +++ head/tools/regression/acltools/tools-posix.test Thu Jul 2 20:05:21 2009 (r195296) @@ -353,3 +353,37 @@ $ rmdir ddd/ddd $ rm ddd/xxx $ rmdir ddd +# Test if we deal properly with fifos. +$ mkfifo fff +$ ls -l fff | cut -d' ' -f1 +> prw-r--r-- + +$ setfacl -m u:42:r,g:43:w fff +$ getfacl fff +> # file: fff +> # owner: root +> # group: wheel +> user::rw- +> user:42:r-- +> group::r-- +> group:43:-w- +> mask::rw- +> other::r-- + +$ ls -l fff | cut -d' ' -f1 +> prw-rw-r--+ + +$ setfacl -bn fff +$ getfacl fff +> # file: fff +> # owner: root +> # group: wheel +> user::rw- +> group::r-- +> other::r-- + +$ ls -l fff | cut -d' ' -f1 +> prw-r--r-- + +$ rm fff +