Skip to contentSkip to conversation

udev-extraconf: fix unmount directories containing octal-escaped chars

PATCH New Jonathan GUILLOT 1 participant 1 message Jan 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udev-extraconf: fix unmount directories containing octal-escaped chars

USB devices are auto-mounted in a directory named like theirs labels. Special characters like whitespace are octal-escaped in /proc/mounts output. Using directly this output file as an argument for umount failed and the mount directory can't be removed as still busy. Using printf allows these special characters to be unescaped.

---
 meta/recipes-core/udev/udev-extraconf/mount.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/udev/udev-extraconf/mount.sh +1 -1
index 0cd51fcde8..c19e2aa68a 100644
@@ -211,7 +211,7 @@ if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [
         logger "mount.sh/remove" "cleaning up $DEVNAME, was mounted by the auto-mounter"
         for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
         do
-                $UMOUNT $mnt
+                $UMOUNT "`printf $mnt`"
         done
         # Remove mount directory created by the auto-mounter
         # and clean up our tmp cache file

base-commit: a0b236c52dd7ef702a367c6d3e544f21b416ecf2

Signature · 1 line
2.43.0