]> rtime.felk.cvut.cz Git - pisa/qemu-utils.git/commitdiff
qemu-run-trick: Do not allow to be run as root, it is too dangerous.
authorPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 21 Jan 2016 23:52:56 +0000 (00:52 +0100)
committerPavel Pisa <pisa@cmp.felk.cvut.cz>
Thu, 21 Jan 2016 23:52:56 +0000 (00:52 +0100)
If overlay operation fails then following setup can lead
to seriously breaking host system.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
qemu-run-trick/qemu-setup-and-run

index e67046bfaa0de6c16fbae02f8f3e3cebcb170dbf..dfdfe3dc0ac4458121ce58ac9b0d8b3e9cf61538 100755 (executable)
@@ -240,6 +240,11 @@ function clean_setup()
   rm -rf ${RAMDISK_ARCHIVE} filelist ${INITRD_DIR_ABS}
 }
 
+if [ "$(whoami)" == "root" ] ; then
+  echo "$0: !!! TOO DANGEROUS TO RUN AS ROOT !!!"
+  exit 1;
+fi
+
 clean_setup || exit 1
 echo "=== setup_initrd_content ==="
 setup_initrd_content || exit 1