Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2024 18:31:26 +0000
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        David Chisnall <theraven@freebsd.org>
Cc:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   Re: Is anyone using libzfs_core on 15-CURRENT?
Message-ID:  <luthdqzdmaqxpicmrm2sto5wl2nuu4pmlw7zkcoch4foz66vej@5p4ar5ufht3i>
In-Reply-To: <FDAB0752-6D63-4A69-9162-5ACCE90BDACA@FreeBSD.org>
References:  <FDAB0752-6D63-4A69-9162-5ACCE90BDACA@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Jun 19, 2024 at 06:34:24PM +0100, David Chisnall wrote:
> Hi all,
> 
> I have some code using libzfs_core that works fine on 13, but seems not to on 15-CURRENT.  The lzc_snapshot function is failing with exactly the same nv list argument.  It is failing with errno 2 (ENOENT) from the ZFS ioctl (and not returning an nvlist of errors).
> 
> My understanding is that the zfs command-line tool wraps libzfs_core and so it must be working somehow.  Has anything changed in between 13 and 14 that would be expected to cause incompatibilities?  The fact that we don’t install usable headers for these libraries makes it quite difficult to be sure that I haven’t done anything wrong, but stepping through the libzfs_core bits in a debugger, everything looks correct up to the ioctl call.

I have a little wrapper around libzfs{,_core}:
https://git.hardenedbsd.org/shawn.webb/liblattzfs

It kinda sucks, but fills a need. We imported that into HardenedBSD
base.

We don't link against libzfs_core, but we do reference a header:
https://git.hardenedbsd.org/shawn.webb/liblattzfs/-/blob/main/src/liblattzfs.c?ref_type=heads#L40

liblattzfs mainly serves to get the status of a pool. We use it in
another utility, hbsdmon:
https://git.hardenedbsd.org/hardenedbsd/hbsdmon

hbsdmon is a simple HardenedBSD system monitoring tool. It can monitor
a ZFS pool, sending a Pushover message if the pool is unhealthy:
https://git.hardenedbsd.org/hardenedbsd/hbsdmon/-/blob/master/usr.bin/hbsdmon/zfs.c?ref_type=heads

So to answer your question of whether there are any libzfs_core
consumers: yes, but only the C headers. My use case seems quite
different than yours, so the information presented in this email might
not be applicable.

Thanks,

-- 
Shawn Webb
Cofounder / Security Engineer
HardenedBSD

Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50
https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmZzI/cACgkQ/y5nonf4
4frZmQ//TgOOpBGjWmKyYeUs/1IdbtLoDZzzbhZKZtNgcNTxoA6DxuYTFX+dS9nD
aSf4sSteJIoUe3YsqrsKAP56Le13dc1/1AtZcnaStlS+Ie2MixW4nJAWaD7YnDtd
qL3s/skjC/0H/mM9iaNtLww7i6Sttt9zqhHJDfRY0NmAPyMX9VIS3V+H4+d6QbLL
Roij0feXNTxYE7cLlKtdKm8G/P2MRhwjBdf1Eivi0okYXzsH/wIQn7vWDgA1p7qV
dlfPq4W5AnVMw6lupVhcVH0t9exx09Rqn3CLBhWaz1dsHViTf9owCqSyp3LvX5cD
RES2zzSnxEmfU6W9dW01ZfbxD/A3QbXo5wWYZgEpJWRjsFJDUSpFGza85XXo0azP
je8wlasJL5UVz0/IiBomZg4tMmhHD8fE7effgJVFjKtEzVnOC3R/n9pD5DbHjui6
VUo3bRVpI6Cw6oXNgCk6E0x0PH9EAvk6lAUvV4javbM7tKGNaNhwkBMCBsU8TvlM
Uzvky1/nMYCmEkY2ujvUHVTahP3Hm35NohQkzVJlYpmsrNqthPB46EGuQoI0XbL0
LLwKu12V023cthCgqA8hz257K86gu/IWdP20DygrQIypLojuQU5XIR4+yQqK4GdU
Li9QnfyXKIs9ic5wzWCe6C+ELws6N+Fpm1fF3lCU0guPCybCf4E=
=Uw5m
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?luthdqzdmaqxpicmrm2sto5wl2nuu4pmlw7zkcoch4foz66vej>