Proposed fix refined after running it against upstream CI (see PR):
https://github.com/canonical/apport/pull/658

Two findings from the first CI run:

1. upstream's own integration/system tests deliberately create their crashing
   executables and scripts under /var/tmp and assert that reports ARE produced
   (the choice dates back to 2012, LP: the suite moved scratch files out of
   /var/crash). So /var/tmp is treated as "likely packaged" by design, not by
   accident.

2. Rather than move the test scratch to /var/cache (root-owned; would break
   non-root test runs and lose the world-writable scratch property), the PR
   now excludes /var/tmp but keeps one carve-out: /var/tmp/apport-tests/ stays
   packaged. The tests use that directory via a new
   tests/helper.py:get_test_executables_dir() helper which creates it and
   makes it world-writable (like /var/tmp itself).

End result:
- likely_packaged("/var/tmp/foo") -> False (development scratch, LP#2174521)
- likely_packaged("/var/tmp/apport-tests/foo") -> True (test suite location)
- likely_packaged("/usr/bin/ls") -> True (unchanged)
- likely_packaged("/usr/local/bin/foo"), ("/var/lib/foo") -> False (unchanged)

The False-is-definitive docstring guarantee still holds: no archive package
ships executables in /var/tmp, and /var/tmp/apport-tests only contains
apport's own test artefacts.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174521

Title:
  apport writes crash reports for development binaries in /var/tmp;
  likely_packaged() treats all of /var as packaged

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2174521/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to