Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 2009 13:51:05 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 168846 for review
Message-ID:  <200909241351.n8ODp5ma032182@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909241351.n8ODp5ma032182>