]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build: warn when libmount udev support is disabled
authorKarel Zak <kzak@redhat.com>
Tue, 2 Jun 2026 10:30:21 +0000 (12:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 9 Jun 2026 08:40:39 +0000 (10:40 +0200)
Non-root tag resolution (LABEL=, UUID=) in mount/umount depends on
udev support in libmount. Without it, suid mount/umount cannot
resolve tags for unprivileged users since direct device probing
is disabled for security reasons.

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
meson.build

index 12ef78a15164d9180f7b9bcb51cf0b5ed725703b..89e05a45d686415598096641c307f6c5e9f1c108 100644 (file)
@@ -2775,6 +2775,9 @@ AS_IF([test "x$enable_libmount_udev_support" != xno && test "x$build_libmount" =
    )
 ])
 AM_CONDITIONAL([USE_LIBMOUNT_UDEV_SUPPORT], [test "x$libmount_udev_support" = xyes])
+AS_IF([test "x$libmount_udev_support" != xyes && test "x$build_libmount" = xyes], [
+  AC_MSG_WARN([libmount udev support is disabled; non-root tag resolution (LABEL=, UUID=) in mount/umount will not work])
+])
 
 AC_ARG_WITH([systemdsystemunitdir],
   AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [directory for systemd unit files (requires systemd support)]),
index d6f2572a0deacb0905a0c35b5e1d913eff10542e..0595aead9c5ba9084be38bc2aa457a4ce994b080 100644 (file)
@@ -421,6 +421,11 @@ have = cc.has_function(
 conf.set('USE_LIBMOUNT_UDEV_SUPPORT',
   get_option('build-libmount-udev-support').allowed() and have ? 1 : false)
 
+if not (get_option('build-libmount-udev-support').allowed() and have)
+  warning('libmount udev support is disabled; non-root tag resolution (LABEL=, UUID=) ' +
+          'in mount/umount will not work')
+endif
+
 lib_udev = dependency(
   'libudev',
   required : get_option('systemd'))