mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 14:25:41 +02:00
A nicer way to isolate config files created during the build process
This commit is contained in:
parent
15cbf73fc5
commit
21e1c5842b
1 changed files with 7 additions and 3 deletions
|
|
@ -122,10 +122,14 @@ def pre_sub_commands(self, opts):
|
|||
raise SystemExit(1)
|
||||
|
||||
if os.geteuid() == 0:
|
||||
# We drop privileges for security, regaining them when installing
|
||||
# files. Also ensures that any config files created as a side
|
||||
# effect of the build process are not owned by root.
|
||||
self.drop_privileges()
|
||||
# Ensure any calibre config files are created as correct user
|
||||
import calibre.utils.config as c
|
||||
c
|
||||
|
||||
# Ensure any config files created as a side effect of importing calibre
|
||||
# during the build process are in /tmp
|
||||
os.environ['CALIBRE_CONFIG_DIRECTORY'] = os.environ.get('CALIBRE_CONFIG_DIRECTORY', '/tmp/calibre-install-config')
|
||||
|
||||
def run(self, opts):
|
||||
self.manifest = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue