From owner-dev-commits-src-main@freebsd.org Fri Aug 27 08:52:46 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EAD865B601; Fri, 27 Aug 2021 08:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GwtlL2bzmz4rB8; Fri, 27 Aug 2021 08:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 191A32081F; Fri, 27 Aug 2021 08:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 17R8qjK6051131; Fri, 27 Aug 2021 08:52:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 17R8qjmr051130; Fri, 27 Aug 2021 08:52:45 GMT (envelope-from git) Date: Fri, 27 Aug 2021 08:52:45 GMT Message-Id: <202108270852.17R8qjmr051130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Popov Subject: git: fcef0684f108 - main - Fix build of bin/getfacl after libc changes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fcef0684f1084aeacae556adc5d4d5853b7e748e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2021 08:52:46 -0000 The branch main has been updated by arrowd (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fcef0684f1084aeacae556adc5d4d5853b7e748e commit fcef0684f1084aeacae556adc5d4d5853b7e748e Author: Gleb Popov AuthorDate: 2021-01-20 09:47:44 +0000 Commit: Gleb Popov CommitDate: 2021-08-27 08:52:18 +0000 Fix build of bin/getfacl after libc changes. Reviewed by: kib, debdrup, gbe Approved by: kib Differential Revision: https://reviews.freebsd.org/D28255 --- bin/getfacl/getfacl.c | 93 +-------------------------------------------------- 1 file changed, 1 insertion(+), 92 deletions(-) diff --git a/bin/getfacl/getfacl.c b/bin/getfacl/getfacl.c index d59ddbcfc871..ecdc73f74fbc 100644 --- a/bin/getfacl/getfacl.c +++ b/bin/getfacl/getfacl.c @@ -83,97 +83,6 @@ getgname(gid_t gid) return (gr->gr_name); } -/* - * return an ACL corresponding to the permissions - * contained in mode_t - */ -static acl_t -acl_from_mode(const mode_t mode) -{ - acl_t acl; - acl_entry_t entry; - acl_permset_t perms; - - /* create the ACL */ - acl = acl_init(3); - if (!acl) - return NULL; - - /* First entry: ACL_USER_OBJ */ - if (acl_create_entry(&acl, &entry) == -1) - return NULL; - if (acl_set_tag_type(entry, ACL_USER_OBJ) == -1) - return NULL; - - if (acl_get_permset(entry, &perms) == -1) - return NULL; - if (acl_clear_perms(perms) == -1) - return NULL; - - /* calculate user mode */ - if (mode & S_IRUSR) - if (acl_add_perm(perms, ACL_READ) == -1) - return NULL; - if (mode & S_IWUSR) - if (acl_add_perm(perms, ACL_WRITE) == -1) - return NULL; - if (mode & S_IXUSR) - if (acl_add_perm(perms, ACL_EXECUTE) == -1) - return NULL; - if (acl_set_permset(entry, perms) == -1) - return NULL; - - /* Second entry: ACL_GROUP_OBJ */ - if (acl_create_entry(&acl, &entry) == -1) - return NULL; - if (acl_set_tag_type(entry, ACL_GROUP_OBJ) == -1) - return NULL; - - if (acl_get_permset(entry, &perms) == -1) - return NULL; - if (acl_clear_perms(perms) == -1) - return NULL; - - /* calculate group mode */ - if (mode & S_IRGRP) - if (acl_add_perm(perms, ACL_READ) == -1) - return NULL; - if (mode & S_IWGRP) - if (acl_add_perm(perms, ACL_WRITE) == -1) - return NULL; - if (mode & S_IXGRP) - if (acl_add_perm(perms, ACL_EXECUTE) == -1) - return NULL; - if (acl_set_permset(entry, perms) == -1) - return NULL; - - /* Third entry: ACL_OTHER */ - if (acl_create_entry(&acl, &entry) == -1) - return NULL; - if (acl_set_tag_type(entry, ACL_OTHER) == -1) - return NULL; - - if (acl_get_permset(entry, &perms) == -1) - return NULL; - if (acl_clear_perms(perms) == -1) - return NULL; - - /* calculate other mode */ - if (mode & S_IROTH) - if (acl_add_perm(perms, ACL_READ) == -1) - return NULL; - if (mode & S_IWOTH) - if (acl_add_perm(perms, ACL_WRITE) == -1) - return NULL; - if (mode & S_IXOTH) - if (acl_add_perm(perms, ACL_EXECUTE) == -1) - return NULL; - if (acl_set_permset(entry, perms) == -1) - return NULL; - - return(acl); -} - static int print_acl(char *path, acl_type_t type, int hflag, int iflag, int nflag, int qflag, int vflag) @@ -229,7 +138,7 @@ print_acl(char *path, acl_type_t type, int hflag, int iflag, int nflag, errno = 0; if (type == ACL_TYPE_DEFAULT) return(0); - acl = acl_from_mode(sb.st_mode); + acl = acl_from_mode_np(sb.st_mode); if (!acl) { warn("%s: acl_from_mode() failed", path); return(-1);