From: Hans-Christoph Steiner Date: Fri, 23 Sep 2016 13:19:15 +0000 (+0200) Subject: buildserver: only check cache permissions when using libvirt X-Git-Tag: 0.8~158^2~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=1e8fd01c1e5209e5bffb1c88a5b4641c3b1d4ea5;p=fdroidserver.git 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. --- 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'