trusted launcher is not passing environment to local jobs executed as data source

Bug #1254093 reported by Daniel Manrique
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Critical
Zygmunt Krynicki

Bug Description

This happened if plainbox-provider-certification-server and plainbox-autostart-server are used. It can also be reproduced by running 'checkbox sru' using sudo.

- install plainbox plainbox-provider-certification-server
- Prepare minimal whitelist as shown below
- sudo plainbox sru -w /path/to/minimal.whitelist

Expected:
- memory/info passes (it's the most basic memory test)

Actual:
- memory/info fails
- Trace as shown below

When plainbox uses the trusted launcher controller to execute a generated job that runs as root, the trusted launcher does not obtain environment specific to the job generator.

Minimal whitelist:
__memory__
memory/info

Trace:
cat: /jobs/memory.txt?(.in): No such file or directory
Traceback (most recent call last):
  File "/usr/bin/plainbox-trusted-launcher-1", line 9, in <module>
    load_entry_point('plainbox==0.4.dev', 'console_scripts', 'plainbox-trusted-launcher-1')()
  File "/usr/lib/python3/dist-packages/plainbox/impl/secure/launcher1.py", line 168, in main
    launcher.add_job_list(launcher.run_local_job(ns.via))
  File "/usr/lib/python3/dist-packages/plainbox/impl/secure/launcher1.py", line 88, in run_local_job
    output = subprocess.check_output(cmd, universal_newlines=True)
  File "/usr/lib/python3.3/subprocess.py", line 586, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['bash', '-c', 'shopt -s extglob\ncat $CHECKBOX_SHARE/jobs/memory.txt?(.in)']' returned non-zero exit status 1

Tags: plainbox

Related branches

Zygmunt Krynicki (zyga)
summary: - CHECKBOX_SHARE not defined if job run through trusted launcher
+ trusted launcher is not passing environment to local jobs executed as
+ data source
description: updated
Changed in checkbox:
assignee: nobody → Zygmunt Krynicki (zkrynicki)
importance: Undecided → Critical
Zygmunt Krynicki (zyga)
Changed in checkbox:
milestone: none → plainbox-0.4b2
status: New → Triaged
Zygmunt Krynicki (zyga)
Changed in checkbox:
status: Triaged → In Progress
Zygmunt Krynicki (zyga)
Changed in checkbox:
status: In Progress → Fix Committed
Zygmunt Krynicki (zyga)
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.