Index: sys/ufs/ufs/ufs_acl.c =================================================================== --- sys/ufs/ufs/ufs_acl.c (revision 195259) +++ sys/ufs/ufs/ufs_acl.c (working copy) @@ -218,11 +218,13 @@ ufs_getacl_posix1e(struct vop_getacl_args *ap) */ error = ufs_get_oldacl(ap->a_type, old, ap->a_vp, ap->a_td); switch (error) { + case ENOATTR: /* - * XXX: If ufs_getacl() should work on filesystems - * without the EA configured, add case EOPNOTSUPP here. + * EOPNOTSUPP means that either the extended attributes are not + * enabled, or the filesystem does not support EA for this kind + * of vnode. This happens for e.g. VCHR and VBLK. */ - case ENOATTR: + case EOPNOTSUPP: switch (ap->a_type) { case ACL_TYPE_ACCESS: /* Index: tools/regression/acltools/00.t =================================================================== --- tools/regression/acltools/00.t (revision 195259) +++ tools/regression/acltools/00.t (working copy) @@ -45,7 +45,7 @@ chmod 600 xxx rm xxx echo "ok 2" -perl $TESTDIR/run $TESTDIR/tools-posix.test > /dev/null +perl $TESTDIR/run $TESTDIR/tools-posix.test if [ $? -eq 0 ]; then echo "ok 3" Index: tools/regression/acltools/tools-posix.test =================================================================== --- tools/regression/acltools/tools-posix.test (revision 195296) +++ tools/regression/acltools/tools-posix.test (working copy) @@ -387,3 +387,20 @@ $ ls -l fff | cut -d' ' -f1 $ rm fff +# Test if we deal properly with device files. +$ mknod bbb b 1 1 +$ setfacl -m u:42:r,g:43:w bbb +> setfacl: acl_get_file() failed: Operation not supported +$ ls -l bbb | cut -d' ' -f1 +> brw-r--r-- + +$ rm bbb + +$ mknod ccc c 1 1 +$ setfacl -m u:42:r,g:43:w ccc +> setfacl: acl_get_file() failed: Operation not supported +$ ls -l ccc | cut -d' ' -f1 +> crw-r--r-- + +$ rm ccc +