History log of /freebsd-current/bin/setfacl/setfacl.c
Revision Date Author Comments
# 8312a902 03-Jan-2024 rilysh <nightquick@proton.me>

bin/setfacl: remove unreachable break after usage()

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/872


# e043f372 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 2dfa4b66 08-Dec-2020 Bryan Drewery <bdrewery@FreeBSD.org>

fts_read: Handle error from a NULL return better.

This is addressing cases such as fts_read(3) encountering an [EIO]
from fchdir(2) when FTS_NOCHDIR is not set. That would otherwise be
seen as a successful traversal in some of these cases while silently
discarding expected work.

As noted in r264201, fts_read() does not set errno to 0 on a successful
EOF so it needs to be set before calling it. Otherwise we might see
a random error from one of the iterations.

gzip is ignoring most errors and could be improved separately.

Reviewed by: vangyzen
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D27184


# 15e59435 26-Oct-2018 Mark Johnston <markj@FreeBSD.org>

Don't set NFSv4 ACL inheritance flags on non-directories.

They only make sense in the context of directory ACLs, and attempting
to set them on regular files results in errors, causing a recursive
setfacl invocation to abort.

This is derived from patches by Shawn Webb <shawn.webb@hardenedbsd.org>
and Mitchell Horne <mhorne063@gmail.com>.

PR: 155163
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15061


# 10cb5344 26-Oct-2018 Mark Johnston <markj@FreeBSD.org>

Don't print pathconf() errors if the target file doesn't exist.

The subsequent acl_get_file(3) call will simply echo the same error.

PR: 229930
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# f024dd3b 26-Oct-2018 Mark Johnston <markj@FreeBSD.org>

Avoid leaking memory in error paths.

CID: 1390906
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# b79f74cc 27-Apr-2018 Ed Maste <emaste@FreeBSD.org>

setfacl: style and break main() into manageable pieces

Submitted by: Mitchell Horne
MFC with: r332396
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D15060


# 0629b152 10-Apr-2018 Ed Maste <emaste@FreeBSD.org>

setfacl: add recursive functionality

Add a -R option to setfacl to operate recursively on directories, along
with the accompanying flags -H, -L, and -P (whose behaviour mimics
chmod).

A patch was submitted with PR 155163, but this is a new implementation
based on comments raised in the Phabricator review for that patch
(review D9096).

PR: 155163
Submitted by: Mitchell Horne <mhorne063@gmail.com>
Reviewed by: jilles
MFC after: 2 weeks
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14934


# ae824d80 18-Oct-2012 Ed Schouten <ed@FreeBSD.org>

Fix warnings found by -Wmising-variable-declarations.

This self-written compiler warning, which is hopefully going to be
committed into LLVM sources soon, warns about potentially missing
`static' keywords, similar to -Wmissing-prototypes.

- bin/pax: Move external declaration of chdname and s_mask into extern.h.
- bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h.
- sbin/mount_fusefs: Remove char *progname; use getprogname().
- others: add `static' where possible.


# 8ed068d3 04-Sep-2012 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make "setfacl -bd" an alias for "setfacl -k". Previously it would crash
on assert.

PR: bin/165807
MFC after: 1 month


# 00b2b3a5 04-Sep-2012 Edward Tomasz Napierala <trasz@FreeBSD.org>

Make setfacl(1) behave properly in situations like "setfacl -kd".

MFC after: 1 month


# b38dc7eb 03-Jan-2011 Jaakko Heinonen <jh@FreeBSD.org>

Increase carried_error if we skip a file due to an error. This ensures
that setfacl(1) exits with proper exit status on failure.

PR: bin/149780
Submitted by: Ævar Arnfjörð Bjarmason (original version)
Reviewed by: trasz
MFC after: 3 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# a303eae7 07-Mar-2010 Joel Dahl <joel@FreeBSD.org>

Switch to our preferred license text.

Approved by: jedgar


# d91f45d6 30-Jan-2010 Edward Tomasz Napierala <trasz@FreeBSD.org>

MFC r196936:

Add NFSv4 support to setfacl(1).


# 3f221878 07-Sep-2009 Edward Tomasz Napierala <trasz@FreeBSD.org>

Add NFSv4 support to setfacl(1).

Reviewed by: rwatson


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 23f80af2 06-Sep-2008 Edward Tomasz Napierala <trasz@FreeBSD.org>

Fix double free in setfacl(1). Description from the author:

Initially, 'acl' (an 'acl_t *') is allocated, and its ACCESS_ACL and
DEFAULT_ACL fields are passed to the 'libc' ACL routines for subsequent
allocation. If the '-m' option (merge existing ACL with a new one) is
specified, then 'set_acl_mask()' will be called and passed one of the
two ACLs. This function, in turn, replaces this given ACL structure by
another, freshly allocated. However, the pointer in the 'acl' variable
in the caller is not updated. The caller then proceeds to free the ACL,
incurring in a double free condition.

Submitted by: Pedro Martelletto <pedro at ambientworks.net>
Approved by: rwatson (mentor)


# b5ea8f4c 25-Feb-2007 Kirk McKusick <mckusick@FreeBSD.org>

Implement the -h flag (set an ACL on a symbolic link).
Before this fix the -h flag was ignored (i.e. setfacl
always set the ACL on the file pointed to by the symbolic
link even when the -h flag requested that the ACL be set
on the symbolic link itself).


# 410572a1 09-Jun-2006 Konstantin Belousov <kib@FreeBSD.org>

Copy filename read from the stdin into the private buffer. Otherwise,
next read filename overwrite previous one, resulting in acl being
applied only to the last name in the list.

Submitted by: Oleg Lomaka <oleg.lomaka at gmail com>
MFC after: 1 week
Approved by: kan (mentor)


# a89237ae 09-Feb-2005 Ruslan Ermilov <ru@FreeBSD.org>

Sync program's usage() with manpage's SYNOPSIS.


# 9ddb49cb 10-Jan-2005 Warner Losh <imp@FreeBSD.org>

/*- or .\"- or #- to begin license clauses.


# 95e36726 07-Aug-2003 Robert Watson <rwatson@FreeBSD.org>

-v no longer a valid argument to setfacl(1) -- remove from usage().

PR: 55318
Submitted by: Grzegorz Czaplinski <G.Czaplinski@prioris.mini.pw.edu.pl>


# 4615eb20 18-Jul-2003 Robert Watson <rwatson@FreeBSD.org>

When reporting an error internalizing an ACL string, print out the
ACL that generated the error, rather than the function, which is
more user-friendly.

Obtained from: TrustedBSD Project
Product of: France


# 8051fdde 30-Dec-2002 Robert Watson <rwatson@FreeBSD.org>

Add "-h" arguments to getfacl and setfacl, which behave in a manner
similar to "-h" on chown, chmod, etc, causing the operation to occur
on a final symlink in the provided path, rather than its target.

Obtained from: TrustedBSD Project


# 2749b141 29-Jun-2002 David E. O'Brien <obrien@FreeBSD.org>

Consistently use FBSDID


# 993f5df6 02-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

Add defines for access and default ACLs (ACCESS_ACL/DEFAULT_ACL)
to enhance readability.

Obtained from: TrustedBSD Project


# a043a09d 02-Dec-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

style(9) cleanups mostly consisting of:
o explicitly check return values and variables against a value
o return x; -> return (x);
o fix inconsistent sysexits usage by nuking it (partially
suggested by bde)

Obtained from: TrustedBSD Project


# 0a26b6bb 19-May-2001 Kris Kennaway <kris@FreeBSD.org>

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC After: 1 week


# 0f626307 24-Apr-2001 Chris D. Faulhaber <jedgar@FreeBSD.org>

o Separate acl_t into internal and external representations as
required by POSIX.1e. This maintains the current 'struct acl'
in the kernel while providing the generic external acl_t
interface required to complete the ACL editing library.
o Add the acl_get_entry() function.
o Convert the existing ACL utilities, getfacl and setfacl, to
fully make use of the ACL editing library.

Obtained from: TrustedBSD Project


# 43960f15 19-Mar-2001 Robert Watson <rwatson@FreeBSD.org>

o POSIX.2c Userland tool support for POSIX.1e ACLs -- getfacl retrieves ACLs
from files and directories, and setfacl sets ACLs on files and directories.

Submitted by: jedgar
Obtained from: TrustedBSD Project