# HG changeset patch # User prabahar # Date 1189987103 25200 # Node ID 97ac9f0ef0f932ac5bc7ab601ed1f8fc550ca914 # Parent 816fab2599c380a94113a5994294f33f2502727e 6519314 acl not being set properly diff -r 816fab2599c3 -r 97ac9f0ef0f9 usr/src/uts/common/fs/ufs/ufs_acl.c --- a/usr/src/uts/common/fs/ufs/ufs_acl.c Sat Sep 15 09:46:21 2007 -0700 +++ b/usr/src/uts/common/fs/ufs/ufs_acl.c Sun Sep 16 16:58:23 2007 -0700 @@ -137,8 +137,7 @@ ip->i_flag |= IMOD | IACC; ip->i_mode = (ip->i_smode & ~0777) | ((sp->aowner->acl_ic_perm & 07) << 6) | - (((sp->aclass.acl_ismask ? sp->aclass.acl_maskbits : - sp->agroup->acl_ic_perm) & 07) << 3) | + (MASK2MODE(sp)) | (sp->aother->acl_ic_perm & 07); TRANS_INODE(ip->i_ufsvfs, ip); ufs_iupdat(ip, 1); @@ -318,7 +317,7 @@ if (sp->agroup) { /* Group */ ip->i_mode &= ~0070; /* clear Group */ - ip->i_mode |= (sp->agroup->acl_ic_perm & 07) << 3; + ip->i_mode |= MASK2MODE(sp); /* apply mask */ ip->i_gid = sp->agroup->acl_ic_who; } diff -r 816fab2599c3 -r 97ac9f0ef0f9 usr/src/uts/common/sys/fs/ufs_acl.h --- a/usr/src/uts/common/sys/fs/ufs_acl.h Sat Sep 15 09:46:21 2007 -0700 +++ b/usr/src/uts/common/sys/fs/ufs_acl.h Sun Sep 16 16:58:23 2007 -0700 @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 1992,1997-2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -173,6 +172,16 @@ ((MODE) == IFIFO) || ((MODE) == IFCHR) || \ ((MODE) == IFBLK) || ((MODE) == IFATTRDIR)) +/* + * Get ACL group permissions if the mask is not present, and the ACL + * group permission intersected with the mask if the mask is present + */ +#define MASK2MODE(ACL) \ + ((ACL)->aclass.acl_ismask ? \ + ((((ACL)->aclass.acl_maskbits & \ + (ACL)->agroup->acl_ic_perm) & 07) << 3) : \ + (((ACL)->agroup->acl_ic_perm & 07) << 3)) + #define MODE2ACL(P, MODE, CRED) \ ASSERT((P)); \ (P)->acl_ic_next = NULL; \