From 1e8fd01c1e5209e5bffb1c88a5b4641c3b1d4ea5 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 23 Sep 2016 15:19:15 +0200 Subject: [PATCH] buildserver: only check cache permissions when using libvirt VirtualBox runs as the same user as `fdroid`, so the cache does not need to be accessible by the world. On libvirt, libvirtd runs the VMs as its own user, so in that case, the cache dirs must have permissions to let that user access them. --- makebuildserver | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/makebuildserver b/makebuildserver index 5c29fbd9..a5328f87 100755 --- a/makebuildserver +++ b/makebuildserver @@ -105,14 +105,15 @@ cachedir = config['cachedir'] if not os.path.exists(cachedir): os.makedirs(cachedir, 0o755) -tmp = cachedir -while tmp != '/': - mode = os.stat(tmp).st_mode - if not (stat.S_IXUSR & mode and stat.S_IXGRP & mode and stat.S_IXOTH & mode): - print('ERROR:', tmp, 'will not be accessible to the VM! To fix, run:') - print(' chmod a+X', tmp) - sys.exit(1) - tmp = os.path.dirname(tmp) +if config['vm_provider'] == 'libvirt': + tmp = cachedir + while tmp != '/': + mode = os.stat(tmp).st_mode + if not (stat.S_IXUSR & mode and stat.S_IXGRP & mode and stat.S_IXOTH & mode): + print('ERROR:', tmp, 'will not be accessible to the VM! To fix, run:') + print(' chmod a+X', tmp) + sys.exit(1) + tmp = os.path.dirname(tmp) if config['apt_package_cache']: config['aptcachedir'] = cachedir + '/apt/archives'