<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libcasper, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>cap_dns: plug a memory leak</title>
<updated>2026-04-10T10:20:27+00:00</updated>
<author>
<name>Mariusz Zaborski</name>
<email>oshogbo@FreeBSD.org</email>
</author>
<published>2026-04-10T10:19:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9f1be4bfebd08b249877267a1634c249c9f6d221'/>
<id>9f1be4bfebd08b249877267a1634c249c9f6d221</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libcasper: fix warnings when _ALIGN preserves types</title>
<updated>2025-12-10T10:57:45+00:00</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2025-12-10T10:57:45+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cfae62eac076d43bc94c667084018a21ee8a305f'/>
<id>cfae62eac076d43bc94c667084018a21ee8a305f</id>
<content type='text'>
Without the void * casts, the compiler complains about an alignment
requirement increase.

Reviewed by:	kib, markj
Obtained from:	CheriBSD
Effort:		CHERI upstreaming
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D53946
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without the void * casts, the compiler complains about an alignment
requirement increase.

Reviewed by:	kib, markj
Obtained from:	CheriBSD
Effort:		CHERI upstreaming
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D53946
</pre>
</div>
</content>
</entry>
<entry>
<title>libcasper: Move everything to the libcasper package</title>
<updated>2025-11-05T00:38:07+00:00</updated>
<author>
<name>Lexi Winter</name>
<email>ivy@FreeBSD.org</email>
</author>
<published>2025-11-05T00:26:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b8697ac70ebfce2d8e3df6c67bbf37910793b199'/>
<id>b8697ac70ebfce2d8e3df6c67bbf37910793b199</id>
<content type='text'>
The libcasper package exists to contain libcasper, but for some reason
only the libcap_net service was in the package, with libcasper itself
and the rest of the services being in runtime.  Move everything to the
libcasper package, except tests which stay in the tests package.

MFC after:	1 day
Reviewed by:	emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53576
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The libcasper package exists to contain libcasper, but for some reason
only the libcap_net service was in the package, with libcasper itself
and the rest of the services being in runtime.  Move everything to the
libcasper package, except tests which stay in the tests package.

MFC after:	1 day
Reviewed by:	emaste
Sponsored by:	https://www.patreon.com/bsdivy
Differential Revision:	https://reviews.freebsd.org/D53576
</pre>
</div>
</content>
</entry>
<entry>
<title>libcasper: explicit cast in cap_fileargs header</title>
<updated>2025-10-09T17:52:14+00:00</updated>
<author>
<name>Quentin Thébault</name>
<email>quentin.thebault@defenso.fr</email>
</author>
<published>2025-09-26T02:04:07+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=349da4dbff722a58affd13d84729b1d399b41fb3'/>
<id>349da4dbff722a58affd13d84729b1d399b41fb3</id>
<content type='text'>
The implicit cast is incompatible with standard compiler options in a
C++ project, making the library difficult to use.

Signed-off-by: Quentin Thébault &lt;quentin.thebault@defenso.fr&gt;
Sponsored by: Defenso
MFC after: 3 days
Discussed with: kevans
Reviewed by: emaste, vexeduxr
Pull request: https://github.com/freebsd/freebsd-src/pull/1857
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implicit cast is incompatible with standard compiler options in a
C++ project, making the library difficult to use.

Signed-off-by: Quentin Thébault &lt;quentin.thebault@defenso.fr&gt;
Sponsored by: Defenso
MFC after: 3 days
Discussed with: kevans
Reviewed by: emaste, vexeduxr
Pull request: https://github.com/freebsd/freebsd-src/pull/1857
</pre>
</div>
</content>
</entry>
<entry>
<title>cap_fileargs.3: Polish</title>
<updated>2025-08-08T16:08:21+00:00</updated>
<author>
<name>Faraz Vahedi</name>
<email>kfv@kfv.io</email>
</author>
<published>2024-12-14T15:43:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=50dee972977a17d47bd76f52c54461ee8581d1b1'/>
<id>50dee972977a17d47bd76f52c54461ee8581d1b1</id>
<content type='text'>
Extensively revised the manual page with clearer phrasing, better
structure, and corrected grammar throughout. Also fixed typos and
improved overall readability of the documentation.

Signed-off-by: Faraz Vahedi &lt;kfv@kfv.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extensively revised the manual page with clearer phrasing, better
structure, and corrected grammar throughout. Also fixed typos and
improved overall readability of the documentation.

Signed-off-by: Faraz Vahedi &lt;kfv@kfv.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cap_net/net_test: require 'allow_network_access'</title>
<updated>2025-07-24T20:25:47+00:00</updated>
<author>
<name>Siva Mahadevan</name>
<email>me@svmhdvn.name</email>
</author>
<published>2025-07-18T13:20:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=df88c711a26c04192761e96dc08a6f3f9e42afed'/>
<id>df88c711a26c04192761e96dc08a6f3f9e42afed</id>
<content type='text'>
Signed-off-by: Siva Mahadevan &lt;me@svmhdvn.name&gt;

Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1779
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Siva Mahadevan &lt;me@svmhdvn.name&gt;

Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1779
</pre>
</div>
</content>
</entry>
<entry>
<title>cap_dns/tests/dns_test: mark tests as needing network access</title>
<updated>2025-07-08T12:55:30+00:00</updated>
<author>
<name>Siva Mahadevan</name>
<email>me@svmhdvn.name</email>
</author>
<published>2025-06-22T01:02:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1e570722dced7a3afc0a35b10af047b835e51567'/>
<id>1e570722dced7a3afc0a35b10af047b835e51567</id>
<content type='text'>
Signed-off-by: Siva Mahadevan &lt;me@svmhdvn.name&gt;

Reviewed by:	markj
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1738
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Siva Mahadevan &lt;me@svmhdvn.name&gt;

Reviewed by:	markj
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1738
</pre>
</div>
</content>
</entry>
<entry>
<title>libcasper: Fix inconsistent error codes of cap_get{addr,name}info()</title>
<updated>2025-06-12T18:16:49+00:00</updated>
<author>
<name>Hiroki Sato</name>
<email>hrs@FreeBSD.org</email>
</author>
<published>2025-06-12T18:16:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b60053fde1726ea047aadfbc0354b79e99d4a668'/>
<id>b60053fde1726ea047aadfbc0354b79e99d4a668</id>
<content type='text'>
The get{addr,name}info(3) API is designed to return an API-specific error
code that is independent of errno.  The cap_get{addr,name}info() functions
returned either an errno or API-specific error code inconsistently.
This change fixes this mismatch.

When the API returns an errno, the return value itself is set to
EAI_SYSTEM and errno is set depending on the actual error.  So, usually
this API is called in the following form:

    error = getnameinfo(...);
    if (error == EAI_SYSTEM)
        perror("getnameinfo");
    else if (error)
        errx(1, "getnameinfo: %s", gai_strerror(error);

If the above getnameinfo() call is replaced with cap_getnameinfo(),
it breaks the error handling.  For example, the cap_get{addr,name}info()
functions can return ENOTCAPABLE.

This change simply adds "errno", in addition to "error", to the nvlout and
cap_get{addr,name}info() restores the errno if the error code is EAI_SYSTEM.

Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D45859
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The get{addr,name}info(3) API is designed to return an API-specific error
code that is independent of errno.  The cap_get{addr,name}info() functions
returned either an errno or API-specific error code inconsistently.
This change fixes this mismatch.

When the API returns an errno, the return value itself is set to
EAI_SYSTEM and errno is set depending on the actual error.  So, usually
this API is called in the following form:

    error = getnameinfo(...);
    if (error == EAI_SYSTEM)
        perror("getnameinfo");
    else if (error)
        errx(1, "getnameinfo: %s", gai_strerror(error);

If the above getnameinfo() call is replaced with cap_getnameinfo(),
it breaks the error handling.  For example, the cap_get{addr,name}info()
functions can return ENOTCAPABLE.

This change simply adds "errno", in addition to "error", to the nvlout and
cap_get{addr,name}info() restores the errno if the error code is EAI_SYSTEM.

Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D45859
</pre>
</div>
</content>
</entry>
<entry>
<title>libcasper: Use __VA_ARGS__ for function-like macros</title>
<updated>2025-06-12T18:04:21+00:00</updated>
<author>
<name>Hiroki Sato</name>
<email>hrs@FreeBSD.org</email>
</author>
<published>2025-06-12T18:04:21+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6501b68ffba7f4414b3818fcc3ee945e70918772'/>
<id>6501b68ffba7f4414b3818fcc3ee945e70918772</id>
<content type='text'>
cap_net.h uses "#define cap_f(chan, a) f(a)" to call the conventional
service function with the first argument of cap_f() dropped for
compatibility with the environment where the casper service is
unavailable.  However, this function-like macro does not work when the
arguments contains C99 compound literals, such as f(chan, (int[]){1,2,3}).
The following is a typical example:

    error = cap_getaddrinfo(capnet, "192.168.0.1", "100",
        &amp;(struct addrinfo){
            .ai_family = AF_INET,
            .ai_flags = AI_NUMERICHOST
    }, &amp;res);

Using cap_f(chan, ...) and __VA_ARGS__ in C99 seems a reasonable solution
for this problem.  While there is a workaround using parenthesis around
the compound literal like f(chan, ((int[]){1,2,3})), it is not intuitive
and the above example works when the cap_net is available and f() is
defined as a function.

A possible moot point is that __VA_ARGS__ cannot control how many
arguments are passed at the macro level, and "chan" is not protected.
However, "chan" is less likely to be written in compound literal, and
the function prototype should check the remaining arguments.

Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D45858
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cap_net.h uses "#define cap_f(chan, a) f(a)" to call the conventional
service function with the first argument of cap_f() dropped for
compatibility with the environment where the casper service is
unavailable.  However, this function-like macro does not work when the
arguments contains C99 compound literals, such as f(chan, (int[]){1,2,3}).
The following is a typical example:

    error = cap_getaddrinfo(capnet, "192.168.0.1", "100",
        &amp;(struct addrinfo){
            .ai_family = AF_INET,
            .ai_flags = AI_NUMERICHOST
    }, &amp;res);

Using cap_f(chan, ...) and __VA_ARGS__ in C99 seems a reasonable solution
for this problem.  While there is a workaround using parenthesis around
the compound literal like f(chan, ((int[]){1,2,3})), it is not intuitive
and the above example works when the cap_net is available and f() is
defined as a function.

A possible moot point is that __VA_ARGS__ cannot control how many
arguments are passed at the macro level, and "chan" is not protected.
However, "chan" is less likely to be written in compound literal, and
the function prototype should check the remaining arguments.

Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D45858
</pre>
</div>
</content>
</entry>
<entry>
<title>manuals: Misc syntax fixes</title>
<updated>2024-10-07T18:41:14+00:00</updated>
<author>
<name>Graham Percival</name>
<email>gperciva@tarsnap.com</email>
</author>
<published>2024-10-04T03:40:23+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c8b31033c3971b2b7349804ffda0cea5e4835b40'/>
<id>c8b31033c3971b2b7349804ffda0cea5e4835b40</id>
<content type='text'>
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Additional clarification: there was a non-breaking space in
lib/libcasper/services/cap_grp/cap_grp.3.

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1449
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Additional clarification: there was a non-breaking space in
lib/libcasper/services/cap_grp/cap_grp.3.

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1449
</pre>
</div>
</content>
</entry>
</feed>
