From 1b5d4050b1c8eb2c321991197f629744db46aeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 9 Oct 2013 10:40:52 +0200 Subject: [PATCH] Fix #6 - Rename autorun from source key. --- fs/home/kitten/kitten_mount_src | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/home/kitten/kitten_mount_src b/fs/home/kitten/kitten_mount_src index 7842f8b..52dcf18 100755 --- a/fs/home/kitten/kitten_mount_src +++ b/fs/home/kitten/kitten_mount_src @@ -1,10 +1,13 @@ #!/bin/bash set -e -#set -x +set -x if [ $# -eq 2 ]; then - mount -o noexec,nosuid,nodev,ro "${1}" "${2}" + mount -o noexec,nosuid,nodev "${1}" "${2}" + # renaming autorun.inf on the source key. As it it case insensitive, we have to do the following... + ls "${2}" | grep -i autorun.inf | xargs -I {} mv "${2}"/{} "${2}"/DANGEROUS_{}_DANGEROUS || true + mount -o remount,ro "${2}" || true exit 0 else echo 'Invalid number of arguments.'