From owner-p4-projects@FreeBSD.ORG Thu Sep 24 13:51:05 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7155C106568B; Thu, 24 Sep 2009 13:51:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3615A106566B for ; Thu, 24 Sep 2009 13:51:05 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 251F78FC0C for ; Thu, 24 Sep 2009 13:51:05 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n8ODp5ti032184 for ; Thu, 24 Sep 2009 13:51:05 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n8ODp5ma032182 for perforce@freebsd.org; Thu, 24 Sep 2009 13:51:05 GMT (envelope-from trasz@freebsd.org) Date: Thu, 24 Sep 2009 13:51:05 GMT Message-Id: <200909241351.n8ODp5ma032182@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Cc: Subject: PERFORCE change 168846 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 13:51:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=168846 Change 168846 by trasz@trasz_victim on 2009/09/24 13:50:35 Fix errno - no ACL support at all is EOPNOTSUPP, no support for this particular type of ACL is EINVAL. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_acl.c#21 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_acl.c#21 (text+ko) ==== @@ -147,7 +147,7 @@ struct inode *ip = VTOI(ap->a_vp); if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); len = sizeof(*ap->a_aclp); bzero(ap->a_aclp, len); @@ -265,7 +265,7 @@ * ACLs, remove this check. */ if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); old = malloc(sizeof(*old), M_ACL, M_WAITOK | M_ZERO); @@ -338,6 +338,9 @@ } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + if (ap->a_type == ACL_TYPE_NFS4) return (ufs_getacl_nfs4(ap)); @@ -352,7 +355,7 @@ struct inode *ip = VTOI(ap->a_vp); if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); @@ -438,7 +441,7 @@ struct oldacl *old; if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); /* * If this is a set operation rather than a delete operation, @@ -558,6 +561,8 @@ struct thread *td; } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); if (ap->a_type == ACL_TYPE_NFS4) return (ufs_setacl_nfs4(ap)); @@ -571,7 +576,7 @@ int is_directory = 0; if ((ap->a_vp->v_mount->mnt_flag & MNT_NFS4ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); if (ap->a_vp->v_type == VDIR) is_directory = 1; @@ -584,7 +589,7 @@ { if ((ap->a_vp->v_mount->mnt_flag & MNT_ACLS) == 0) - return (EOPNOTSUPP); + return (EINVAL); /* * Verify we understand this type of ACL, and that it applies @@ -624,6 +629,9 @@ } */ *ap; { + if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) + return (EOPNOTSUPP); + if (ap->a_type == ACL_TYPE_NFS4) return (ufs_aclcheck_nfs4(ap));