VirtualBox shared folders: expect exact match for automation folder name
authorMichael Prokop <mika@grml.org>
Fri, 3 Jul 2020 14:59:32 +0000 (16:59 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 3 Jul 2020 14:59:32 +0000 (16:59 +0200)
The shared folder for automation usage (`automation` by default) should
only be enabled if it matches exactly the expected name. A folder named
'automations' shouldn't trigger automation, so adjust egrep command
line.

This work was funded by Grml-Forensic.

autoconfig.functions

index bf5f52e..3aa9787 100755 (executable)
@@ -1882,7 +1882,7 @@ if $VIRTUALBOX ; then
         vbautomation="$(getbootparam 'vbautomation' 2>>$DEBUG)"
       fi
 
         vbautomation="$(getbootparam 'vbautomation' 2>>$DEBUG)"
       fi
 
-      if ! VBoxControl sharedfolder list | egrep -q "^[0-9]+ - ${vbautomation}\s*" ; then
+      if ! VBoxControl sharedfolder list | egrep -q "^[0-9]+ - ${vbautomation}(\s+|$)" ; then
         ewarn "No automount shared folder '$vbautomation' available"
         eend 0
       else
         ewarn "No automount shared folder '$vbautomation' available"
         eend 0
       else