History log of /freebsd-current/usr.sbin/extattr/rmextattr.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# a5aa07dd 02-Mar-2023 Elyes Haouas <ehaouas@noos.fr>

extattr: Remove useless return at the end of void function

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656


# 1137d1a7 16-Jan-2020 Alan Somers <asomers@FreeBSD.org>

setextattr: Increase stdin buffer size to 4096

Extended attribute values can potentially be quite large. One test for ZFS
is supposed to set a 200MB xattr. However, the buffer size for reading
values from stdin with setextattr -i is so small that the test times out
waiting for tiny chunks of data to be buffered and appended to an sbuf.

Increasing the buffer size should help alleviate some of the burden of
reallocating larger sbufs when writing large extended attributes.

Submitted by: Ryan Moeller <ryan@freqlabs.com>
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D23211


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# 79e29f95 04-May-2016 Alan Somers <asomers@FreeBSD.org>

Fix "getextattr -x" with non-ascii attribute values

extattr/rmextattr.c
When printing hex output, treat all attribute values as unsigned
char arrays instead of sign extending them to 32 bit values.

extattr/tests/extattr_test.sh
Add a regression test

PR: 209039
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp


# c29930cf 04-May-2016 Alan Somers <asomers@FreeBSD.org>

Allow setextattr(8) to take attribute values from stdin

Add the -i option to setextattr. This option allow extended attribute data
to be provided via stdin. Add a -qq option to getextattr, which omits the
trailing newline. Together these options can be used to work with extended
attributes whose values are large and/or binary.

usr.sbin/extattr/Makefile:
Link against libsbuf which is used for processing stdin data.

usr.sbin/extattr/rmextattr.8:
Document setextattr's -i option, getextattr's -qq option, and remove
the BUG about setextattr only being useful for strings.

usr.sbin/extattr/rmextattr.c:
For setextattr operations, buffer attribute data in an sbuf. If -i
is specified, pull the data from stdin, otherwise from the
appropriate argurment.

Update usage text and argument validation code for setextattr's -i
option.

usr.sbin/extattr/tests/extattr_test.sh
Add tests for -q and -i.

Reviewed by: wblock (manpage)
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6090


# e324bf91 01-Apr-2013 Matthew D Fleming <mdf@FreeBSD.org>

Fix return type of extattr_set_* and fix rmextattr(8) utility.

extattr_set_{fd,file,link} is logically a write(2)-like operation and
should return ssize_t, just like extattr_get_*. Also, the user-space
utility was using an int for the return value of extattr_get_* and
extattr_list_*, both of which return an ssize_t.

MFC after: 1 week


# 081b42f9 22-Feb-2013 Pawel Jakub Dawidek <pjd@FreeBSD.org>

Don't print an empty line for files with no attributes when -q is given for
lsextattr(8).


# 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.


# 07c19910 12-May-2010 Zachary Loafman <zml@FreeBSD.org>

extattr: Fix a signed/unsigned issue

Submitted by: Matthew Fleming <matthew.fleming@isilon.com>
Reviewed by: zml, dfr


# 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.


# deccdf0e 20-Jan-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Fix a bug when printing attributes from multiple files: buflen could be
longer than the length of the current attribute if the buffer were reused
and previously longer, so bits of the previous, longer attribute would be
written. Fix this by using the actual attribute length.


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

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


# b689e6a8 15-Jul-2008 Robert Watson <rwatson@FreeBSD.org>

Invoke err() with a format string rather than directly with a passed
command line argument.

Submitted by: Alfredo Ortega <alfredo at coresecurity dot com>
Thanks to: Core Security Technologies
MFC after: 3 days


# 52271f82 04-Jun-2003 Robert Watson <rwatson@FreeBSD.org>

Update lsextattr(8) to use the new extattr_list_*() APIs, rather than
using the somewhat more hackish variant on extattr_get_*() to retrieve
the attribute list on an object.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


# cb0187a0 10-Oct-2002 Brian Feldman <green@FreeBSD.org>

Add an -n option to write the trailing nul byte to the extattr when
using setextattr(8) to write a string.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


# 878382fa 10-Oct-2002 Brian Feldman <green@FreeBSD.org>

Correct argc verification (don't crash).

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


# 6c3fb112 10-Oct-2002 Robert Watson <rwatson@FreeBSD.org>

Add -h flags to each of the *extattr(8) commands, indicating that
the command should not follow the symlink if the target file is a
symlink. Invoke the extattr_*_link(2) version of the system call
in that situation, instead of extattr_*_file(2). This is
consistent with other attribute management tools in the system.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


# 7522ecb3 10-Oct-2002 Robert Watson <rwatson@FreeBSD.org>

Use basename(3) to derive the name of the binary from argv[0].

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Submitted by: green


# a068c194 30-Aug-2002 Poul-Henning Kamp <phk@FreeBSD.org>

Add the new userland tool for manipulating extended attributes.

This will replace the existing getextattr(8) and setextattr(8) with
a single binary responding to the names getextattr, setextattr,
rmextattr and lsextattr.

This program is not yet connected to the build.

Sponsored by: DARPA and NAI Labs.