jobs running as root can't use ${CHECKBOX_DATA}
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Checkbox |
Fix Released
|
Medium
|
Brendan Donegan |
Bug Description
A couple of jobs including cpu/scaling_test and stress/graphics build their log path with CHECKBOX_DATA, e.g:
graphics_
fwts_test -c -l ${CHECKBOX_
But as they are executed with the root user, these logs are not created as expected in ~.checkbox or ~.cache/checkbox but at the root of the filesystem: /
drwxr-xr-x 24 root 4096 Sep 12 12:19 ./
drwxr-xr-x 24 root 4096 Sep 12 12:19 ../
drwxr-xr-x 2 root 4096 Aug 3 08:53 bin/
drwxr-xr-x 3 root 4096 Sep 11 09:16 boot/
drwxr-xr-x 2 root 4096 May 27 14:20 cdrom/
-rw-r--r-- 1 root 4090 Jun 20 09:10 cpu_scaling_
drwxr-xr-x 17 root 4560 Sep 12 10:09 dev/
drwxr-xr-x 153 root 12288 Sep 12 10:11 etc/
-rw-r--r-- 1 root 72 Sep 12 12:11 graphics-
[...]
lrwxrwxrwx 1 root 33 Sep 11 09:15 initrd.img -> /boot/initrd.
lrwxrwxrwx 1 root 33 Aug 10 09:19 initrd.img.old -> /boot/initrd.
[...]
-rw-r--r-- 1 root 4243 Sep 12 12:21 scaling_test.log
[...]
lrwxrwxrwx 1 root 29 Sep 11 09:15 vmlinuz -> boot/vmlinuz-
lrwxrwxrwx 1 root 29 Aug 10 09:19 vmlinuz.old -> boot/vmlinuz-
These files are also use for attachments and we expect to find them in CHECKBOX_DATA, the user env var.
Related branches
- Zygmunt Krynicki (community): Approve
-
Diff: 37 lines (+5/-0)3 files modifieddebian/changelog (+3/-0)
jobs/cpu.txt.in (+1/-0)
jobs/stress.txt.in (+1/-0)
- Daniel Holbach (community): Approve
- Micah Gersten (community): Needs Fixing
- Ubuntu branches: Pending requested
-
Diff: 4032 lines (+691/-1663)52 files modifiedbackend (+7/-3)
checkbox/parsers/udevadm.py (+8/-1)
data/whitelists/default.whitelist (+1/-0)
debian/changelog (+56/-0)
debian/control (+7/-2)
debian/po/ast.po (+2/-2)
debian/po/cs.po (+2/-2)
debian/po/de.po (+2/-2)
debian/po/en_AU.po (+2/-2)
debian/po/en_GB.po (+2/-2)
debian/po/es.po (+4/-3)
debian/po/fr.po (+13/-13)
debian/po/he.po (+2/-2)
debian/po/hu.po (+2/-2)
debian/po/id.po (+2/-2)
debian/po/it.po (+2/-2)
debian/po/ja.po (+2/-2)
debian/po/nl.po (+2/-2)
debian/po/oc.po (+2/-2)
debian/po/pl.po (+2/-2)
debian/po/pt_BR.po (+2/-2)
debian/po/ro.po (+2/-2)
debian/po/ru.po (+2/-2)
debian/po/tr.po (+2/-2)
debian/po/uk.po (+2/-2)
debian/po/zh_CN.po (+2/-2)
debian/po/zh_TW.po (+2/-2)
jobs/cpu.txt.in (+1/-0)
jobs/esata.txt.in (+0/-6)
jobs/firewire.txt.in (+0/-6)
jobs/mediacard.txt.in (+0/-48)
jobs/optical.txt.in (+90/-52)
jobs/resource.txt.in (+1/-1)
jobs/usb.txt.in (+7/-19)
jobs/wireless.txt.in (+17/-3)
plugins/apport_prompt.py (+0/-280)
plugins/backend_info.py (+60/-21)
plugins/suites_prompt.py (+8/-1)
po/POTFILES.in (+0/-1)
po/ar.po (+13/-12)
po/fi.po (+28/-14)
po/fr.po (+131/-109)
po/pt_BR.po (+5/-5)
qt/checkbox-qt.ui (+0/-935)
qt/frontend/qtfront.cpp (+2/-1)
qt/frontend/qtfront.ui (+8/-5)
scripts/display_resource (+84/-0)
scripts/graphics_driver (+81/-50)
scripts/network_info (+15/-2)
scripts/network_wireless_test (+0/-25)
scripts/optical_write_test (+3/-4)
setup.py (+1/-1)
description: | updated |
Changed in checkbox: | |
status: | In Progress → Fix Committed |
Changed in checkbox: | |
status: | Fix Committed → Fix Released |
Probably related to how we use sudo. The fix is probably sudo -E or explicit whitelist of the CHECKBOX_ variables by shipping appropriate entry in /etc/sudoers.d/