summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2018-11-11 14:44:24 +0100
committerintrigeri <intrigeri@boum.org>2018-11-27 11:20:35 +0000
commit45a1248be92e69c7adfe1e51c26470d3875f7510 (patch)
tree4a3720a610489ce62746a93a75e0173e22055b68
parent211c3a4155a5e7ae9f817e6071fe740e6adcc3f7 (diff)
Only use pkexec if we are not already root (refs: #15984)
Drop pkexec dependencies from build dependencies (we run live-boot as root during the build).
-rwxr-xr-xauto/scripts/create-usb-image-from-iso10
-rwxr-xr-xvagrant/definitions/tails-builder/postinstall.sh1
2 files changed, 6 insertions, 5 deletions
diff --git a/auto/scripts/create-usb-image-from-iso b/auto/scripts/create-usb-image-from-iso
index da1352b..ac906f3 100755
--- a/auto/scripts/create-usb-image-from-iso
+++ b/auto/scripts/create-usb-image-from-iso
@@ -332,19 +332,21 @@ class ImageCreator(object):
# device would cause this issue:
# https://bugs.chromium.org/p/chromium/issues/detail?id=508713#c8
execute([
- # XXX: Why does this only work as root?
- 'pkexec',
'syslinux',
'--offset', str(self.partition.props.partition.props.offset),
'--directory', '/syslinux/',
'--install', self.image
- ])
+ ],
+ as_root=True # XXX: Why does this only work as root?
+ )
def set_guid(self):
execute(["/sbin/sgdisk", "--disk-guid", "17B81DA0-8B1E-4269-9C39-FE5C7B9B58A3", self.image])
-def execute(cmd: list):
+def execute(cmd: list, as_root=False):
+ if as_root and os.geteuid() != 0:
+ cmd = ['pkexec'] + cmd
logger.info("Executing '%s'" % ' '.join(cmd))
subprocess.check_call(cmd)
diff --git a/vagrant/definitions/tails-builder/postinstall.sh b/vagrant/definitions/tails-builder/postinstall.sh
index d01b235..4127768 100755
--- a/vagrant/definitions/tails-builder/postinstall.sh
+++ b/vagrant/definitions/tails-builder/postinstall.sh
@@ -98,7 +98,6 @@ apt-get -y install \
lsof \
p7zip-full \
perlmagick \
- policykit-1 \
psmisc \
python3 \
python3-gi \