mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
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.
This commit is contained in:
parent
f6a487eee4
commit
1e8fd01c1e
1 changed files with 9 additions and 8 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue