From owner-p4-projects@FreeBSD.ORG Tue Aug 12 05:30:59 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 393B6106566C; Tue, 12 Aug 2008 05:30:59 +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 D9DD5106564A for ; Tue, 12 Aug 2008 05:30:58 +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 C424F8FC18 for ; Tue, 12 Aug 2008 05:30:58 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7C5UwNs056320 for ; Tue, 12 Aug 2008 05:30:58 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7C5UweI056318 for perforce@freebsd.org; Tue, 12 Aug 2008 05:30:58 GMT (envelope-from trasz@freebsd.org) Date: Tue, 12 Aug 2008 05:30:58 GMT Message-Id: <200808120530.m7C5UweI056318@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 147209 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: Tue, 12 Aug 2008 05:30:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=147209 Change 147209 by trasz@trasz_traszkan on 2008/08/12 05:30:09 Preserve libc acl_space from being overwritten by the kernel. Remove now useless checks. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_branding.c#6 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_get.c#7 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#5 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_branding.c#6 (text+ko) ==== @@ -54,13 +54,6 @@ return (aclp); } -static void -_acl_check_entry(const acl_entry_t entry) -{ - assert(entry); - assert(entry2acl(entry)->ats_acl.acl_magic == ACL_MAGIC); -} - /* * Return brand of an ACL. */ @@ -73,8 +66,6 @@ int _entry_brand(const acl_entry_t entry) { - _acl_check_entry(entry); - return (_acl_brand(entry2acl(entry))); } @@ -96,8 +87,6 @@ int _entry_brand_may_be(const acl_entry_t entry, int brand) { - _acl_check_entry(entry); - return (_acl_brand_may_be(entry2acl(entry), brand)); } @@ -115,8 +104,6 @@ void _entry_brand_as(const acl_entry_t entry, int brand) { - _acl_check_entry(entry); - _acl_brand_as(entry2acl(entry), brand); } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_get.c#7 (text+ko) ==== @@ -57,13 +57,14 @@ acl_get_file(const char *path_p, acl_type_t type) { acl_t aclp; - int error; + int error, acl_length; aclp = acl_init(ACL_MAX_ENTRIES); if (aclp == NULL) return (NULL); type = _acl_type_unold(type); + acl_length = aclp->ats_acl.acl_length; error = __acl_get_file(path_p, type, &aclp->ats_acl); if (error) { @@ -71,6 +72,7 @@ return (NULL); } + aclp->ats_acl.acl_length = acl_length; _acl_brand_from_type(aclp, type); return (aclp); @@ -80,13 +82,14 @@ acl_get_link_np(const char *path_p, acl_type_t type) { acl_t aclp; - int error; + int error, acl_length; aclp = acl_init(ACL_MAX_ENTRIES); if (aclp == NULL) return (NULL); type = _acl_type_unold(type); + acl_length = aclp->ats_acl.acl_length; error = __acl_get_link(path_p, type, &aclp->ats_acl); if (error) { @@ -94,6 +97,7 @@ return (NULL); } + aclp->ats_acl.acl_length = acl_length; _acl_brand_from_type(aclp, type); return (aclp); @@ -112,13 +116,14 @@ acl_get_fd_np(int fd, acl_type_t type) { acl_t aclp; - int error; + int error, acl_length; aclp = acl_init(ACL_MAX_ENTRIES); if (aclp == NULL) return (NULL); type = _acl_type_unold(type); + acl_length = aclp->ats_acl.acl_length; error = ___acl_get_fd(fd, type, &aclp->ats_acl); if (error) { @@ -126,6 +131,7 @@ return (NULL); } + aclp->ats_acl.acl_length = acl_length; _acl_brand_from_type(aclp, type); return (aclp); ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#5 (text+ko) ==== @@ -58,7 +58,8 @@ } assert(1 << _ACL_T_ALIGNMENT_BITS > sizeof(struct acl_t_struct)); - error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS, sizeof(struct acl_t_struct)); + error = posix_memalign((void *)&acl, 1 << _ACL_T_ALIGNMENT_BITS, + sizeof(struct acl_t_struct)); if (error) return (NULL); @@ -66,6 +67,7 @@ acl->ats_acl.acl_brand = ACL_BRAND_UNKNOWN; acl->ats_acl.acl_magic = ACL_MAGIC; + acl->ats_acl.acl_length = ACL_MAX_ENTRIES; return (acl); }