fix: Do not run sensible-pager as root if using sudo/pkexec
The apport-cli supports view a crash. These features invoke the default
pager, which is likely to be less, other functions may apply.
It can be used to break out from restricted environments by spawning an
interactive system shell. If the binary is allowed to run as superuser
by sudo, it does not drop the elevated privileges and may be used to
access the file system, escalate or maintain privileged access.
apport-cli should normally not be called with sudo or pkexec. In case it
is called via sudo or pkexec execute `sensible-pager` as the original
user to avoid privilege elevation.
Let apport depend on recent python3-problem-report for recent bug fix
```
Traceback (most recent call last):
File "/usr/share/apport/whoopsie-upload-all", line 29, in <module>
from problem_report import MalformedProblemReport
ImportError: cannot import name 'MalformedProblemReport' from 'problem_report' (/usr/lib/python3/dist-packages/problem_report.py)
```
fix: Catch ValueError: not enough values to unpack
The problem report might be malformed which lets `whoopsie-upload-all`
crash:
```
Traceback (most recent call last):
File "data/whoopsie-upload-all", line 250, in <module>
main()
File "data/whoopsie-upload-all", line 232, in main
stamps = collect_info()
File "data/whoopsie-upload-all", line 163, in collect_info
res = process_report(r)
File "data/whoopsie-upload-all", line 77, in process_report
r.load(f, binary="compressed")
File "problem_report.py", line 173, in load
(key, value) = line.split(b":", 1)
ValueError: not enough values to unpack (expected 2, got 1)
```
Catch the `ValueError` and raise a `MalformedProblemReport` exception
instead (which is catched by `whoopsie-upload-all` and `apport-unpack`).
When passing a core file, `apport-unpack` will crash:
```
Traceback (most recent call last):
File "bin/apport-unpack", line 91, in <module>
main()
File "bin/apport-unpack", line 67, in main
pr = load_report(args.report)
File "bin/apport-unpack", line 47, in load_report
pr.load(f, binary=False)
File "problem_report.py", line 167, in load
key = key.decode("ASCII")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 2: ordinal not in range(128)
```
Wrap `UnicodeDecodeError` in a `MalformedProblemReport` exception and
catch this exception in `apport-unpack` to print nice error message.