/usr/sbin/fatdog-drive-icon-action-handler
function :
do_umount
Propose extending the code to also close the relevant /dev/mapper folder when the desktop bottom left drive icons x close corner is clicked.
If you create a cryptsetup encrypted image file and open that, then the mount point appears in the bottom left drive icons along with its x close corner showing.
When closed using the commands
umount /mnt/data
cryptsetup close data
that desktop drive icon disappears. But if instead closed using the rox-app (clicking the x close icon in the drive icons top corner), its only umounted, the /dev/mapper remains ... so the desktop drive icon remains
If that closed drive icon is clicked again, then rox reopens the folder again, with the content visible. I'd suggest that isn't the intended/desired action, it should be fully closed and the drive icon removed, so you have to go back through entering a password again to reopen it. i.e. the /dev/mapper/xxx name should also be closed
Which requires changing the do_umount function to something like ...
Code: Select all
do_umount() {
ISCRYPT=$(df -h | grep $2 | grep /dev/mapper | awk '{print $1}')
case "$2" in
$AUFS_ROOT*)
Xdialog --title "Error" --infobox "${1##*/} is used by system, it cannot be un-mounted." 0 0 10000
return ;;
esac
# close all rox folders
rox -D "$2"
# umount - escalate to root if we are not root
if [ $(id -u) -ne 0 ]; then
gtksu "Unmounting ${1##*/}" umount "$2"
RC=$?
if [ ! -z "$ISCRYPT" ]; then
cryptsetup close $ISCRYPT
fi
else
umount "$2"
RC=$?
if [ ! -z "$ISCRYPT" ]; then
cryptsetup close $ISCRYPT
fi
fi
# prompt user if fails
if [ $RC -ne 0 ]; then
if Xdialog --title "Error" --yesno "Unable to unmount ${1##*/}, it is currently used by the following process:
$(fuser -m $2 | xargs ps -o cmd -p | sed 's/CMD//')\n\n
Do you want me to stop them and try again?" 0 0; then
fuser -m -k $2
do_umount $1 "$2"
fi
fi
}
Code: Select all
dd if=/dev/zero of=data.img bs=1M count=20
cryptsetup -y luksFormat data.img
#... needs uppercase YES and enter password ... twice
cryptsetup luksOpen data.img data
#... enter password
mkfs.ext2 /dev/mapper/data
cryptsetup close data
Code: Select all
cryptsetup luksOpen data.img data
mkdir /mnt/data
mount /dev/mapper/data /mnt/data
Code: Select all
umount /mnt/data
cryptsetup close data