From nobody Mon Apr 21 03:58:05 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Zgs662VKfz5sqcj; Mon, 21 Apr 2025 03:58:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Zgs656S9fz3RjF; Mon, 21 Apr 2025 03:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745207885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=70nYSkgpsHLHAidZd+yIhmLynWgAmkJMoCDsReKdCns=; b=bHAz6n0OiRJh4WpI6gGpC2eBxh0PVAhXQMtzCZnydCkea5/5nZkLjDEBmmhejzt57ZovvY 6ya6jVeCLjaINKKRpeTfZjkaV37cWeFIDvqVn8R/6CIU1QYd2hOHTGv6PE+thdz7n2PygO ZYBw59AZx4/y7gr4VRHvvouNCvJPZ1TsHx+9Z1UQcm2n7cAiq1zgR6PJ5FWyMeLt8nFbpv eZIz5mDs20lwfejlOmrsvdS0yfwiN0xUtAXGEt7fp4ykUozuEEGtCE/JyEvGQQITWD5qbF NWleo/+Hclhn6g/4aaguiKXPPlscDeJFsQSbNoEv780K5Qe8CwLpeekjNjhznA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1745207885; a=rsa-sha256; cv=none; b=fHSUtpan1wlCAuI2Z5IfbV1zlgK9Qp0c4OOFCQgzhRBfrYHBqizWC4KG+CjpFRc06Pks7v 6sYGLXJJ2FElVlMS4UbboNu6UXpaqawIlwXPQgz1nB9jlRkgsWSTUnzYmI4r8Xn5rGqLkO bMp6E9X1TSPNZyGY3gF1cWxB6t1zgvJdF+hQQ9ouzsu6wu6cB0UXUKyrOb8oXI2do7+m2n OgqoJOTKWGl6nVqRkNJXhu2XUss+9pS5akVWK7i9zLYHDGHwyJvNOjFOU3eTKaRCe4CiRq LiVaqhqcUIjlfUR3FNwZnlSbiQaCzTRcm4+ZQ+rOU6ovYE3JRPHfiRcDMRJLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1745207885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=70nYSkgpsHLHAidZd+yIhmLynWgAmkJMoCDsReKdCns=; b=doF+qflZJt0LTRqRBNNpyYU6BpCAsH0MCYfN2wS14x1qGLUlnOnHSZ7NqXPRw134y07ftv DhPVJftjX8e4mQF2PHdJdbaR+ceUASAiJPl+XRnNhtbA7qe7sloS5EVETjMxFZs7lvk30n b5QwNtoduVlhaCigZHgkHfu1PPRdslbDtcXsUqGBhndsfA+kraPZEGX7ypD+GOn9/2xkvX Um0yUfeS/P+gO+YfqwnK/OrQdYROieNQlsYXiDDcMtsasUD1Q42H/pdMVbI/JJiIVRkc2b z9i3WXI0sT6R2BaCFwQtBQAjEoPv0KxYfTWkbno4ESoc0nnK4O6c25qA/4BNdQ== 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 4Zgs655dGqzZhX; Mon, 21 Apr 2025 03:58:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 53L3w58X080662; Mon, 21 Apr 2025 03:58:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 53L3w5pa080659; Mon, 21 Apr 2025 03:58:05 GMT (envelope-from git) Date: Mon, 21 Apr 2025 03:58:05 GMT Message-Id: <202504210358.53L3w5pa080659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: ec8e79c4e4cf - main - getfacl: add some long options for Linux compatibility List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec8e79c4e4cfb786fdb7eb00bea2ad32660bf878 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=ec8e79c4e4cfb786fdb7eb00bea2ad32660bf878 commit ec8e79c4e4cfb786fdb7eb00bea2ad32660bf878 Author: Kyle Evans AuthorDate: 2025-04-21 03:57:44 +0000 Commit: Kyle Evans CommitDate: 2025-04-21 03:57:44 +0000 getfacl: add some long options for Linux compatibility Only three of our options have compatible looking long options, w.r.t. the commonly provided getfacl(1) on Linux systems. Of particular interest is --omit-header, which is -c on !FreeBSD and -q on FreeBSD. Reviewed by: imp, markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D40602 --- bin/getfacl/getfacl.1 | 8 ++++---- bin/getfacl/getfacl.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bin/getfacl/getfacl.1 b/bin/getfacl/getfacl.1 index f8ff3df432a1..b2b6294c46de 100644 --- a/bin/getfacl/getfacl.1 +++ b/bin/getfacl/getfacl.1 @@ -28,7 +28,7 @@ .\" Developed by the TrustedBSD Project. .\" Support for POSIX.1e access control lists. .\" -.Dd September 4, 2009 +.Dd June 19, 2023 .Dt GETFACL 1 .Os .Sh NAME @@ -54,7 +54,7 @@ an ACL containing only the required ACL entries. .Pp The following option is available: .Bl -tag -width indent -.It Fl d +.It Fl d , Fl -default The operation applies to the default ACL of a directory instead of the access ACL. An error is generated if a default ACL cannot be associated with @@ -67,11 +67,11 @@ the symbolic link itself rather than following the link. For NFSv4 ACLs, append numerical ID at the end of each entry containing user or group name. Ignored for POSIX.1e ACLs. -.It Fl n +.It Fl n , Fl -numeric Display user and group IDs numerically rather than converting to a user or group name. Ignored for POSIX.1e ACLs. -.It Fl q +.It Fl q , Fl -omit-header Do not write commented information about file name and ownership. This is useful when dealing with filenames with unprintable characters. diff --git a/bin/getfacl/getfacl.c b/bin/getfacl/getfacl.c index 3ac9e61555de..2b98f923d618 100644 --- a/bin/getfacl/getfacl.c +++ b/bin/getfacl/getfacl.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,14 @@ static int more_than_one = 0; +static const struct option long_options[] = +{ + { "default", no_argument, NULL, 'd' }, + { "numeric", no_argument, NULL, 'n' }, + { "omit-header", no_argument, NULL, 'q' }, + { NULL, no_argument, NULL, 0 }, +}; + static void usage(void) { @@ -197,7 +206,8 @@ main(int argc, char *argv[]) qflag = 0; nflag = 0; vflag = 0; - while ((ch = getopt(argc, argv, "dhinqv")) != -1) + while ((ch = getopt_long(argc, argv, "+dhinqv", long_options, + NULL)) != -1) switch(ch) { case 'd': type = ACL_TYPE_DEFAULT;