From 96109db4bd08ffc1e1dcca6f87994761642ce413 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Thu, 29 Jun 2017 18:44:31 +0100 Subject: Check for write permissions on destination path --- src/virtBootstrap/virt_bootstrap.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/virtBootstrap/virt_bootstrap.py') diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py index bef5e88..90379cc 100755 --- a/src/virtBootstrap/virt_bootstrap.py +++ b/src/virtBootstrap/virt_bootstrap.py @@ -96,6 +96,9 @@ def bootstrap(args): elif not os.path.isdir(args.dest): # Show error if not directory error("Destination path '%s' is not directory.", args.dest) sys.exit(1) + elif not os.access(args.dest, os.W_OK): # Check write permissions + error("No write permissions on destination path '%s'", args.dest) + sys.exit(1) source.unpack(args.dest) -- cgit