From owner-p4-projects@FreeBSD.ORG Sat May 23 08:29:41 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 02AC9106566C; Sat, 23 May 2009 08:29:41 +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 B61C1106566B for ; Sat, 23 May 2009 08:29:40 +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 6CB7E8FC18 for ; Sat, 23 May 2009 08:29:40 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n4N8TeMO092676 for ; Sat, 23 May 2009 08:29:40 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n4N8Tetw092674 for perforce@freebsd.org; Sat, 23 May 2009 08:29:40 GMT (envelope-from trasz@freebsd.org) Date: Sat, 23 May 2009 08:29:40 GMT Message-Id: <200905230829.n4N8Tetw092674@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 162561 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: Sat, 23 May 2009 08:29:42 -0000 http://perforce.freebsd.org/chv.cgi?CH=162561 Change 162561 by trasz@trasz_victim on 2009/05/23 08:28:39 MFC. Merging 'struct acl' changes to the head required some modifications; this commit adapts the rest of the sources to stay consistent. Among other things, acl_{set,get}_extended_np(3) became acl_{set,get}_entry_type_np(3). This breaks with Darwin API compatibility for good and makes naming closer to the RFC instead. It compiles, mostly. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/bin/cp/Makefile#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/Makefile#2 edit .. //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/merge.c#10 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/Makefile.inc#12 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/Symbol.map#9 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl.3#3 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_copy.c#5 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_delete.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_delete_entry.c#8 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_entry.c#5 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_from_text_nfs4.c#8 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_get.c#9 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_get_entry_type_np.3#1 add .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_get_extended_np.3#3 delete .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#7 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_set.c#6 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_set_entry_type_np.3#1 add .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_set_extended_np.3#3 delete .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_support.c#7 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_support.h#10 integrate .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_to_text_nfs4.c#11 edit .. //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_valid.c#4 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sbin/restore/Makefile#2 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/acl_compat.c#9 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/nfs/nfs_commonacl.c#2 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/fs/nfsserver/nfs_nfsdstate.c#3 integrate .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_nfs4.c#41 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_posix1e.c#13 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/kern/vfs_acl.c#16 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/sys/acl.h#34 edit .. //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_acl.c#17 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/bin/cp/Makefile#2 (text+ko) ==== @@ -1,8 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 -# $FreeBSD: src/bin/cp/Makefile,v 1.11 2002/07/15 12:08:21 sheldonh Exp $ +# $FreeBSD: src/bin/cp/Makefile,v 1.12 2009/05/22 15:56:43 trasz Exp $ PROG= cp SRCS= cp.c utils.c -CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED +CFLAGS+= -DVM_AND_BUFFER_CACHE_SYNCHRONIZED -D_ACL_PRIVATE .include ==== //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/Makefile#2 (text+ko) ==== @@ -1,6 +1,7 @@ # $FreeBSD: src/bin/setfacl/Makefile,v 1.8 2004/06/13 19:22:53 obrien Exp $ PROG= setfacl +CFLAGS+=-D_ACL_PRIVATE SRCS= file.c mask.c merge.c remove.c setfacl.c util.c .include ==== //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/merge.c#10 (text+ko) ==== @@ -43,7 +43,7 @@ merge_user_group(acl_entry_t *entry, acl_entry_t *entry_new, int acl_brand) { acl_permset_t permset; - acl_extended_t extended; + acl_entry_type_t entry_type; acl_flagset_t flagset; int have_entry; uid_t *id, *id_new; @@ -64,10 +64,10 @@ err(1, "acl_set_permset() failed"); if (acl_brand == ACL_BRAND_NFS4) { - if (acl_get_extended_np(*entry, &extended)) - err(1, "acl_get_extended_np() failed"); - if (acl_set_extended_np(*entry_new, extended)) - err(1, "acl_set_extended_np() failed"); + if (acl_get_entry_type_np(*entry, &entry_type)) + err(1, "acl_get_entry_type_np() failed"); + if (acl_set_entry_type_np(*entry_new, entry_type)) + err(1, "acl_set_entry_type_np() failed"); if (acl_get_flagset_np(*entry, &flagset)) err(1, "acl_get_flagset_np() failed"); if (acl_set_flagset_np(*entry_new, flagset)) @@ -92,7 +92,7 @@ acl_permset_t permset; acl_t acl_new; acl_tag_t tag, tag_new; - acl_extended_t extended, extended_new; + acl_entry_type_t entry_type, entry_type_new; acl_flagset_t flagset; int entry_id, entry_id_new, have_entry, entry_number = 0; int acl_brand, prev_acl_brand; @@ -141,16 +141,16 @@ /* * For NFS4, in addition to "tag" and "id" we also - * compare "extended". + * compare "entry_type". */ if (acl_brand == ACL_BRAND_NFS4) { - if (acl_get_extended_np(entry, &extended)) - err(1, "%s: acl_get_extended_np() " + if (acl_get_entry_type_np(entry, &entry_type)) + err(1, "%s: acl_get_entry_type_np() " "failed", filename); - if (acl_get_extended_np(entry_new, &extended_new)) - err(1, "%s: acl_get_extended_np() " + if (acl_get_entry_type_np(entry_new, &entry_type_new)) + err(1, "%s: acl_get_entry_type_np() " "failed", filename); - if (extended != extended_new) + if (entry_type != entry_type_new) continue; } @@ -175,11 +175,11 @@ filename); if (acl_brand == ACL_BRAND_NFS4) { - if (acl_get_extended_np(entry, &extended)) - err(1, "%s: acl_get_extended_np() failed", + if (acl_get_entry_type_np(entry, &entry_type)) + err(1, "%s: acl_get_entry_type_np() failed", filename); - if (acl_set_extended_np(entry_new, extended)) - err(1, "%s: acl_set_extended_np() failed", + if (acl_set_entry_type_np(entry_new, entry_type)) + err(1, "%s: acl_set_entry_type_np() failed", filename); if (acl_get_flagset_np(entry, &flagset)) err(1, "%s: acl_get_flagset_np() failed", @@ -269,7 +269,7 @@ entry_id = ACL_NEXT_ENTRY; if (acl_create_entry_np(&acl_new, &entry_new, entry_number) == -1) { - if (entry_number >= (uint)acl_new->ats_acl.acl_cnt) + if (entry_number >= acl_new->ats_acl.acl_cnt) warnx("%s: invalid entry number", filename); else warn("%s: acl_create_entry_np() failed", filename); ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/Makefile.inc#12 (text+ko) ==== @@ -1,7 +1,9 @@ -# $FreeBSD: src/lib/libc/posix1e/Makefile.inc,v 1.19 2006/07/07 14:02:17 rwatson Exp $ +# $FreeBSD: src/lib/libc/posix1e/Makefile.inc,v 1.20 2009/05/22 15:56:43 trasz Exp $ .PATH: ${.CURDIR}/posix1e +CFLAGS+=-D_ACL_PRIVATE + # Copy kern/subr_acl_nfs4.c to the libc object directory. subr_acl_nfs4.c: ${.CURDIR}/../../sys/kern/subr_acl_nfs4.c cat ${.ALLSRC} > ${.TARGET} @@ -54,7 +56,7 @@ acl_get.3 \ acl_get_brand_np.3 \ acl_get_entry.3 \ - acl_get_extended_np.3 \ + acl_get_entry_type_np.3 \ acl_get_flagset_np.3 \ acl_get_flag_np.3 \ acl_get_permset.3 \ @@ -64,7 +66,7 @@ acl_init.3 \ acl_is_trivial_np.3 \ acl_set.3 \ - acl_set_extended_np.3 \ + acl_set_entry_type_np.3 \ acl_set_flagset_np.3 \ acl_set_permset.3 \ acl_set_qualifier.3 \ ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/Symbol.map#9 (text) ==== @@ -1,5 +1,5 @@ /* - * $FreeBSD: src/lib/libc/posix1e/Symbol.map,v 1.3 2007/05/31 13:01:33 deischen Exp $ + * $FreeBSD: src/lib/libc/posix1e/Symbol.map,v 1.4 2009/05/22 15:56:43 trasz Exp $ */ FBSD_1.0 { @@ -74,12 +74,12 @@ acl_delete_flag_np; acl_delete_perm; acl_get_brand_np; - acl_get_extended_np; + acl_get_entry_type_np; acl_get_flag_np; acl_get_flagset_np; acl_get_perm_np; acl_is_trivial_np; - acl_set_extended_np; + acl_set_entry_type_np; acl_set_flagset_np; acl_strip_np; acl_to_text_np; ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl.3#3 (text+ko) ==== @@ -144,9 +144,9 @@ These functions are described in .Xr acl_get 3 , and may be used to retrieve ACLs from file system objects. -.It Fn acl_get_extended_np +.It Fn acl_get_entry_type_np This function is described in -.Xr acl_get_extended_np 3 , +.Xr acl_get_entry_type_np 3 , and may be used to retrieve an ACL type from an ACL entry. .It Fn acl_get_flagset_np This function is described in @@ -181,9 +181,9 @@ These functions are described in .Xr acl_set 3 , and may be used to assign an ACL to a file system object. -.It Fn acl_set_extended_np +.It Fn acl_set_entry_type_np This function is described in -.Xr acl_set_extended_np 3 , +.Xr acl_set_entry_type_np 3 , and may be used to set the ACL type of an ACL entry. .It Fn acl_set_flagset_np This function is described in @@ -248,7 +248,7 @@ .Xr acl_free 3 , .Xr acl_from_text 3 , .Xr acl_get 3 , -.Xr acl_get_extended_np 3 , +.Xr acl_get_entry_type_np 3 , .Xr acl_get_flagset_np 3 , .Xr acl_get_permset 3 , .Xr acl_get_qualifier 3 , @@ -256,7 +256,7 @@ .Xr acl_init 3 , .Xr acl_is_trivial_np 3 , .Xr acl_set 3 , -.Xr acl_set_extended_np 3 , +.Xr acl_set_entry_type_np 3 , .Xr acl_set_flagset_np 3 , .Xr acl_set_permset 3 , .Xr acl_set_qualifier 3 , ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_copy.c#5 (text+ko) ==== @@ -63,7 +63,7 @@ dest_d->ae_tag = src_d->ae_tag; dest_d->ae_id = src_d->ae_id; dest_d->ae_perm = src_d->ae_perm; - dest_d->ae_extended = src_d->ae_extended; + dest_d->ae_entry_type = src_d->ae_entry_type; dest_d->ae_flags = src_d->ae_flags; return (0); ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_delete.c#3 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_delete.c,v 1.8 2002/12/29 20:47:05 rwatson Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_delete.c,v 1.9 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -72,7 +72,6 @@ return (__acl_delete_link(path_p, type)); } - int acl_delete_fd_np(int filedes, acl_type_t type) { ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_delete_entry.c#8 (text+ko) ==== @@ -48,7 +48,7 @@ */ switch (_entry_brand(a)) { case ACL_BRAND_NFS4: - if (a->ae_tag != b->ae_tag || a->ae_extended != b->ae_extended) + if (a->ae_tag != b->ae_tag || a->ae_entry_type != b->ae_entry_type) return (0); /* If ae_ids matter, compare them as well. */ ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_entry.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_entry.c,v 1.7 2002/03/22 21:52:38 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_entry.c,v 1.8 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -62,7 +62,8 @@ (**entry_p).ae_tag = ACL_UNDEFINED_TAG; (**entry_p).ae_id = ACL_UNDEFINED_ID; (**entry_p).ae_perm = ACL_PERM_NONE; - (**entry_p).ae_flags= 0; + (**entry_p).ae_entry_type = 0; + (**entry_p).ae_flags = 0; (*acl_p)->ats_cur_entry = 0; @@ -103,6 +104,7 @@ (**entry_p).ae_tag = ACL_UNDEFINED_TAG; (**entry_p).ae_id = ACL_UNDEFINED_ID; (**entry_p).ae_perm = ACL_PERM_NONE; + (**entry_p).ae_entry_type = 0; (**entry_p).ae_flags= 0; (*acl_p)->ats_cur_entry = 0; ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_from_text_nfs4.c#8 (text+ko) ==== @@ -172,19 +172,19 @@ } static int -parse_extended(const char *str, acl_entry_t entry) +parse_entry_type(const char *str, acl_entry_t entry) { if (strcmp(str, "allow") == 0) - return (acl_set_extended_np(entry, ACL_EXTENDED_ALLOW)); + return (acl_set_entry_type_np(entry, ACL_ENTRY_TYPE_ALLOW)); if (strcmp(str, "deny") == 0) - return (acl_set_extended_np(entry, ACL_EXTENDED_DENY)); + return (acl_set_entry_type_np(entry, ACL_ENTRY_TYPE_DENY)); if (strcmp(str, "audit") == 0) - return (acl_set_extended_np(entry, ACL_EXTENDED_AUDIT)); + return (acl_set_entry_type_np(entry, ACL_ENTRY_TYPE_AUDIT)); if (strcmp(str, "alarm") == 0) - return (acl_set_extended_np(entry, ACL_EXTENDED_ALARM)); + return (acl_set_entry_type_np(entry, ACL_ENTRY_TYPE_ALARM)); warnx("malformed ACL: invalid \"type\" field"); @@ -288,7 +288,7 @@ if (str == NULL) goto truncated_entry; field = strsep(&str, ":"); - error = parse_extended(field, entry); + error = parse_entry_type(field, entry); if (error) goto malformed_field; ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_get.c#9 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_get.c,v 1.12 2002/12/29 20:47:05 rwatson Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_get.c,v 1.13 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -57,14 +57,13 @@ acl_get_file(const char *path_p, acl_type_t type) { acl_t aclp; - int error, acl_length; + int error; 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) { @@ -72,7 +71,7 @@ return (NULL); } - aclp->ats_acl.acl_length = acl_length; + aclp->ats_acl.acl_maxcnt = ACL_MAX_ENTRIES; _acl_brand_from_type(aclp, type); return (aclp); @@ -82,14 +81,13 @@ acl_get_link_np(const char *path_p, acl_type_t type) { acl_t aclp; - int error, acl_length; + int error; 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) { @@ -97,7 +95,7 @@ return (NULL); } - aclp->ats_acl.acl_length = acl_length; + aclp->ats_acl.acl_maxcnt = ACL_MAX_ENTRIES; _acl_brand_from_type(aclp, type); return (aclp); @@ -116,14 +114,13 @@ acl_get_fd_np(int fd, acl_type_t type) { acl_t aclp; - int error, acl_length; + int error; 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) { @@ -131,7 +128,7 @@ return (NULL); } - aclp->ats_acl.acl_length = acl_length; + aclp->ats_acl.acl_maxcnt = ACL_MAX_ENTRIES; _acl_brand_from_type(aclp, type); return (aclp); @@ -226,9 +223,9 @@ } int -acl_get_extended_np(acl_entry_t entry_d, acl_extended_t *extended_p) +acl_get_entry_type_np(acl_entry_t entry_d, acl_entry_type_t *entry_type_p) { - if (entry_d == NULL || extended_p == NULL) { + if (entry_d == NULL || entry_type_p == NULL) { errno = EINVAL; return (-1); } @@ -238,7 +235,7 @@ return (-1); } - *extended_p = entry_d->ae_extended; + *entry_type_p = entry_d->ae_entry_type; return (0); } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_init.c#7 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_init.c,v 1.10 2002/03/22 21:52:38 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_init.c,v 1.11 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -64,10 +64,8 @@ return (NULL); bzero(acl, sizeof(struct acl_t_struct)); - acl->ats_brand = ACL_BRAND_UNKNOWN; - acl->ats_acl.acl_magic = ACL_MAGIC; - acl->ats_acl.acl_length = ACL_MAX_ENTRIES; + acl->ats_acl.acl_maxcnt = ACL_MAX_ENTRIES; return (acl); } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_set.c#6 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_set.c,v 1.12 2002/12/29 20:47:05 rwatson Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_set.c,v 1.13 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -60,9 +60,7 @@ return (-1); } - /* This is for old binaries using new libc. */ type = _acl_type_unold(type); - if (_acl_type_not_valid_for_acl(acl, type)) { errno = EINVAL; return (-1); @@ -92,7 +90,6 @@ } type = _acl_type_unold(type); - if (_acl_type_not_valid_for_acl(acl, type)) { errno = EINVAL; return (-1); @@ -131,7 +128,6 @@ } type = _acl_type_unold(type); - if (_acl_type_not_valid_for_acl(acl, type)) { errno = EINVAL; return (-1); @@ -259,7 +255,7 @@ } int -acl_set_extended_np(acl_entry_t entry_d, acl_extended_t extended) +acl_set_entry_type_np(acl_entry_t entry_d, acl_entry_type_t entry_type) { if (entry_d == NULL) { errno = EINVAL; @@ -273,13 +269,13 @@ _entry_brand_as(entry_d, ACL_BRAND_NFS4); - switch (extended) { - case ACL_EXTENDED_ALLOW: - case ACL_EXTENDED_DENY: - case ACL_EXTENDED_AUDIT: - case ACL_EXTENDED_ALARM: + switch (entry_type) { + case ACL_ENTRY_TYPE_ALLOW: + case ACL_ENTRY_TYPE_DENY: + case ACL_ENTRY_TYPE_AUDIT: + case ACL_ENTRY_TYPE_ALARM: - entry_d->ae_extended = extended; + entry_d->ae_entry_type = entry_type; return (0); } ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_support.c#7 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_support.c,v 1.15 2008/07/13 16:37:51 rwatson Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_support.c,v 1.16 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -51,24 +51,6 @@ #define ACL_STRING_PERM_NONE '-' /* - * Convert "old" type - ACL_TYPE_{ACCESS,DEFAULT}_OLD - into its "new" - * counterpart. It's neccessary for the old (pre-NFS4 ACLs) binaries - * to work with new libc and kernel. Fixing "type" for old binaries with - * old libc and new kernel is being done by kern/vfs_acl.c:type_unold(). - */ -int -_acl_type_unold(acl_type_t type) -{ - if (type == ACL_TYPE_ACCESS_OLD) - return (ACL_TYPE_ACCESS); - - if (type == ACL_TYPE_DEFAULT_OLD) - return (ACL_TYPE_DEFAULT); - - return (type); -} - -/* * Return 0, if both ACLs are identical. */ int @@ -91,7 +73,7 @@ if (entrya->ae_tag != entryb->ae_tag || entrya->ae_id != entryb->ae_id || entrya->ae_perm != entryb->ae_perm || - entrya->ae_extended != entryb->ae_extended || + entrya->ae_entry_type != entryb->ae_entry_type || entrya->ae_flags != entryb->ae_flags) return (1); } @@ -440,6 +422,27 @@ return (0); } +/* + * Convert "old" type - ACL_TYPE_{ACCESS,DEFAULT}_OLD - into its "new" + * counterpart. It's neccessary for the old (pre-NFS4 ACLs) binaries + * to work with new libc and kernel. Fixing 'type' for old binaries with + * old libc and new kernel is being done by kern/vfs_acl.c:type_unold(). + */ +int +_acl_type_unold(acl_type_t type) +{ + switch (type) { + case ACL_TYPE_ACCESS_OLD: + return (ACL_TYPE_ACCESS); + + case ACL_TYPE_DEFAULT_OLD: + return (ACL_TYPE_DEFAULT); + + default: + return (type); + } +} + char * string_skip_whitespace(char *string) { @@ -471,5 +474,3 @@ return; } - - ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_support.h#10 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libc/posix1e/acl_support.h,v 1.5 2007/02/26 02:07:02 kientzle Exp $ + * $FreeBSD: src/lib/libc/posix1e/acl_support.h,v 1.6 2009/05/22 15:56:43 trasz Exp $ */ /* * Support functionality for the POSIX.1e ACL interface ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_to_text_nfs4.c#11 (text+ko) ==== @@ -105,29 +105,29 @@ } static int -format_extended(char *str, size_t size, const acl_entry_t entry) +format_entry_type(char *str, size_t size, const acl_entry_t entry) { int error; - acl_extended_t extended; + acl_entry_type_t entry_type; - error = acl_get_extended_np(entry, &extended); + error = acl_get_entry_type_np(entry, &entry_type); if (error) return (error); - switch (extended) { - case ACL_EXTENDED_ALLOW: + switch (entry_type) { + case ACL_ENTRY_TYPE_ALLOW: snprintf(str, size, "allow"); break; - case ACL_EXTENDED_DENY: + case ACL_ENTRY_TYPE_DENY: snprintf(str, size, "deny"); break; - case ACL_EXTENDED_AUDIT: + case ACL_ENTRY_TYPE_AUDIT: snprintf(str, size, "audit"); break; - case ACL_EXTENDED_ALARM: + case ACL_ENTRY_TYPE_ALARM: snprintf(str, size, "alarm"); break; @@ -209,7 +209,7 @@ return (error); off += snprintf(str + off, size - off, "%s:", buf); - error = format_extended(buf, sizeof(buf), entry); + error = format_entry_type(buf, sizeof(buf), entry); if (error) return (error); off += snprintf(str + off, size - off, "%s", buf); ==== //depot/projects/soc2008/trasz_nfs4acl/lib/libc/posix1e/acl_valid.c#4 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_valid.c,v 1.10 2002/12/29 20:47:05 rwatson Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/posix1e/acl_valid.c,v 1.11 2009/05/22 15:56:43 trasz Exp $"); #include #include "namespace.h" @@ -89,7 +89,6 @@ } type = _acl_type_unold(type); - if (_posix1e_acl(acl, type)) { error = _posix1e_acl_sort(acl); if (error) { @@ -112,7 +111,6 @@ } type = _acl_type_unold(type); - if (_posix1e_acl(acl, type)) { error = _posix1e_acl_sort(acl); if (error) { @@ -135,7 +133,6 @@ } type = _acl_type_unold(type); - if (_posix1e_acl(acl, type)) { error = _posix1e_acl_sort(acl); if (error) { @@ -146,6 +143,5 @@ acl->ats_cur_entry = 0; - return (___acl_aclcheck_fd(fd, type, &acl->ats_acl)); } ==== //depot/projects/soc2008/trasz_nfs4acl/sbin/restore/Makefile#2 (text+ko) ==== @@ -1,11 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/5/93 -# $FreeBSD: src/sbin/restore/Makefile,v 1.24 2005/03/25 17:30:20 imp Exp $ +# $FreeBSD: src/sbin/restore/Makefile,v 1.25 2009/05/22 15:56:43 trasz Exp $ .PATH: ${.CURDIR}/../dump PROG= restore LINKS= ${BINDIR}/restore ${BINDIR}/rrestore -CFLAGS+=-DRRESTORE +CFLAGS+=-DRRESTORE -D_ACL_PRIVATE WARNS?= 0 SRCS= main.c interactive.c restore.c dirs.c symtab.c tape.c utilities.c \ dumprmt.c ==== //depot/projects/soc2008/trasz_nfs4acl/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/acl_compat.c#9 (text+ko) ==== @@ -136,7 +136,7 @@ bzero(aclp, sizeof(*aclp)); aclp->acl_cnt = nentries; - aclp->acl_magic = ACL_MAGIC; + aclp->acl_maxcnt = ACL_MAX_ENTRIES; for (i = 0; i < nentries; i++) { entry = &(aclp->acl_entry[i]); @@ -163,16 +163,16 @@ switch (ace->a_type) { case ACE_ACCESS_ALLOWED_ACE_TYPE: - entry->ae_extended = ACL_EXTENDED_ALLOW; + entry->ae_entry_type = ACL_ENTRY_TYPE_ALLOW; break; case ACE_ACCESS_DENIED_ACE_TYPE: - entry->ae_extended = ACL_EXTENDED_DENY; + entry->ae_entry_type = ACL_ENTRY_TYPE_DENY; break; case ACE_SYSTEM_AUDIT_ACE_TYPE: - entry->ae_extended = ACL_EXTENDED_AUDIT; + entry->ae_entry_type = ACL_ENTRY_TYPE_AUDIT; break; case ACE_SYSTEM_ALARM_ACE_TYPE: - entry->ae_extended = ACL_EXTENDED_ALARM; + entry->ae_entry_type = ACL_ENTRY_TYPE_ALARM; break; default: panic("_acl_from_aces: a_type is 0x%x", ace->a_type); @@ -213,21 +213,21 @@ ace->a_access_mask = _zfs_from_bsd(entry->ae_perm, perms); ace->a_flags |= _zfs_from_bsd(entry->ae_flags, flags); - switch (entry->ae_extended) { - case ACL_EXTENDED_ALLOW: + switch (entry->ae_entry_type) { + case ACL_ENTRY_TYPE_ALLOW: ace->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE; break; - case ACL_EXTENDED_DENY: + case ACL_ENTRY_TYPE_DENY: ace->a_type = ACE_ACCESS_DENIED_ACE_TYPE; break; - case ACL_EXTENDED_ALARM: + case ACL_ENTRY_TYPE_ALARM: ace->a_type = ACE_SYSTEM_ALARM_ACE_TYPE; break; - case ACL_EXTENDED_AUDIT: + case ACL_ENTRY_TYPE_AUDIT: ace->a_type = ACE_SYSTEM_AUDIT_ACE_TYPE; break; default: - panic("_aces_from_acl: ae_extended is 0x%x", entry->ae_extended); + panic("_aces_from_acl: ae_entry_type is 0x%x", entry->ae_entry_type); } } ==== //depot/projects/soc2008/trasz_nfs4acl/sys/fs/nfs/nfs_commonacl.c#2 (text+ko) ==== @@ -66,7 +66,7 @@ acep->ae_tag = ACL_UNDEFINED_TAG; acep->ae_id = ACL_UNDEFINED_ID; acep->ae_perm = (acl_perm_t)0; - acep->ae_extended = ACL_EXTENDED_DENY; + acep->ae_entry_type = ACL_ENTRY_TYPE_DENY; if (acesizep) *acesizep = 4 * NFSX_UNSIGNED; return (0); @@ -143,16 +143,16 @@ acep->ae_flags |= ACL_ENTRY_FAILED_ACCESS; } /* - * Set ae_extended. + * Set ae_entry_type. */ if (acetype == NFSV4ACE_ALLOWEDTYPE) - acep->ae_extended = ACL_EXTENDED_ALLOW; + acep->ae_entry_type = ACL_ENTRY_TYPE_ALLOW; else if (acetype == NFSV4ACE_DENIEDTYPE) - acep->ae_extended = ACL_EXTENDED_DENY; + acep->ae_entry_type = ACL_ENTRY_TYPE_DENY; else if (acetype == NFSV4ACE_AUDITTYPE) - acep->ae_extended = ACL_EXTENDED_AUDIT; + acep->ae_entry_type = ACL_ENTRY_TYPE_AUDIT; else if (acetype == NFSV4ACE_ALARMTYPE) - acep->ae_extended = ACL_EXTENDED_ALARM; + acep->ae_entry_type = ACL_ENTRY_TYPE_ALARM; else aceerr = NFSERR_ATTRNOTSUPP; } @@ -466,11 +466,11 @@ /* * Fill in the ace type. */ - if (ace->ae_extended & ACL_EXTENDED_ALLOW) + if (ace->ae_entry_type & ACL_ENTRY_TYPE_ALLOW) acetype = NFSV4ACE_ALLOWEDTYPE; - else if (ace->ae_extended & ACL_EXTENDED_DENY) + else if (ace->ae_entry_type & ACL_ENTRY_TYPE_DENY) acetype = NFSV4ACE_DENIEDTYPE; - else if (ace->ae_extended & ACL_EXTENDED_AUDIT) + else if (ace->ae_entry_type & ACL_ENTRY_TYPE_AUDIT) acetype = NFSV4ACE_AUDITTYPE; else acetype = NFSV4ACE_ALARMTYPE; ==== //depot/projects/soc2008/trasz_nfs4acl/sys/fs/nfsserver/nfs_nfsdstate.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/fs/nfsserver/nfs_nfsdstate.c,v 1.4 2009/05/21 14:52:36 rmacklem Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/nfsserver/nfs_nfsdstate.c,v 1.7 2009/05/22 18:10:39 rmacklem Exp $"); #ifndef APPLEKEXT #include @@ -3691,8 +3691,8 @@ /* * Return the next index# for a clientid. Mostly just increment and return * the next one, but... if the 32bit unsigned does actually wrap around, - * reboot. This is here more for fun than practical purposes. At an - * average rate of one new client per second, it will wrap around in + * it should be rebooted. + * At an average rate of one new client per second, it will wrap around in * approximately 136 years. (I think the server will have been shut * down or rebooted before then.) */ @@ -3705,12 +3705,8 @@ if (client_index != 0) return (client_index); - /* - * In practice we'll never get here, but the panic is here - * just for fun. (client_index will not wrap around on any real server) - */ - panic("nfsv4 server out of clientids"); - return (0); /* Just to shut the compiler up */ + printf("out of clientids\n"); + return (client_index); } /* ==== //depot/projects/soc2008/trasz_nfs4acl/sys/kern/subr_acl_nfs4.c#41 (text+ko) ==== @@ -106,8 +106,8 @@ for (i = 0; i < aclp->acl_cnt; i++) { entry = &(aclp->acl_entry[i]); - if (entry->ae_extended != ACL_EXTENDED_ALLOW && - entry->ae_extended != ACL_EXTENDED_DENY) + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW && + entry->ae_entry_type != ACL_ENTRY_TYPE_DENY) continue; if (entry->ae_flags & ACL_ENTRY_ONLY_INHERIT) @@ -139,7 +139,7 @@ ("entry->ae_tag == ACL_EVERYONE")); } - if (entry->ae_extended == ACL_EXTENDED_DENY) { + if (entry->ae_entry_type == ACL_ENTRY_TYPE_DENY) { if (entry->ae_perm & access_mask) { if (denied_explicitly != NULL) *denied_explicitly = 1; @@ -270,7 +270,7 @@ static int _entry_does_not_match(struct acl_entry *entry, acl_tag_t tag, acl_perm_t perm, - acl_extended_t extended) + acl_entry_type_t entry_type) { if (entry->ae_tag != tag) return (1); @@ -281,7 +281,7 @@ if (entry->ae_perm != perm) return (1); - if (entry->ae_extended != extended) + if (entry->ae_entry_type != entry_type) return (1); if (entry->ae_flags != 0) @@ -292,7 +292,7 @@ static struct acl_entry * _acl_append(struct acl *aclp, acl_tag_t tag, acl_perm_t perm, - acl_extended_t extended) + acl_entry_type_t entry_type) { struct acl_entry *entry; @@ -305,7 +305,7 @@ entry->ae_tag = tag; entry->ae_id = ACL_UNDEFINED_ID; entry->ae_perm = perm; - entry->ae_extended = extended; + entry->ae_entry_type = entry_type; entry->ae_flags = 0; return (entry); @@ -357,8 +357,8 @@ /* * 1.1. If the type is neither ALLOW or DENY - skip. */ - if (entry->ae_extended != ACL_EXTENDED_ALLOW && - entry->ae_extended != ACL_EXTENDED_DENY) + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW && + entry->ae_entry_type != ACL_ENTRY_TYPE_DENY) continue; /* @@ -424,7 +424,7 @@ * 1.5.1. If the type is ALLOW, check the preceding ACE. * If it does not meet all of the following criteria: */ - if (entry->ae_extended != ACL_EXTENDED_ALLOW) + if (entry->ae_entry_type != ACL_ENTRY_TYPE_ALLOW) continue; meets = 0; @@ -435,7 +435,7 @@ /* * 1.5.1.1. The type field is DENY, */ >>> TRUNCATED FOR MAIL (1000 lines) <<<