• Bug#1108691: pmount silently skips fstype autodetect with blkid when ra

    From Nikolas Kyx@1:229/2 to All on Thu Jul 3 09:20:01 2025
    From: [email protected]

    Package: pmount
    Version: 0.9.23-9
    Severity: normal

    1) Mount smth with command /usr/bin/pmount --debug PART
    2) Look at pmount output and see no evidence of HAVE_BLKID code executed
    3) Check ldd and package dependency and indeed there is libblkid
    4) Look at the HAVE_BLKID code in src/pmount.c. Suspect that
    tp = blkid_get_tag_value(c, "TYPE", device) is NULL.
    pmount don't have a message for this case, sadly.
    5) Now run (already SUID) /usr/bin/pmount --debug as root (e.g. with
    sudo) and see that:
    blkid gave FS vfat for '/dev/sdb1'

    Interesting why tp is NULL in SUID case but not NULL when run as root.
    Tried with ext4 and vfat/fat32 partitions.
    lsblk -f detects fs types both without sudo and suid.

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Nikolas Kyx@1:229/2 to All on Fri Jul 4 09:50:01 2025
    From: [email protected]

    It looks like openat() syscall is failing with EACCESS somewhere in
    the blkid_get_tag_value(). So get_root() is needed to run this
    function. Not sure whether it's safe.

    lsblk implements a whole internal library to gather info about block
    devices, it supports multiple data gathering methods (e.g. from udev).
    So lsblk-way is not applicable here :(

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)