provide ability for apport to detect modified conffiles reliably when not running as root

Bug #1154536 reported by James Hunt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

Apport currently provides a very useful attach_conffiles() function that "Attaches information about any modified or deleted conffiles" for a specified package.

However, if this function is called by an apport hook as a non-root user and if the package being queried contains any conffiles which are not readable by a non-root user, an IOError exception is generated.

This can be dealt with by catching the exception in the apport hook, but it has the side-effect of stopping an apport hook detecting reliably whether any of a packages conffiles have been modified whereas it should be possible to atleast check those conffiles the user does have read permission for.

Ideally, get_modified_conffiles() would handle the IOError exception and mark the unreadable conffiles in some way, but crucially handle the conffiles the user can read as expected.

Martin Pitt (pitti)
Changed in apport:
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Low
status: New → Triaged
Revision history for this message
James Hunt (jamesodhunt) wrote :

I guess an alternative solution to this would be to catch the IOError and have apport invoke pkexec to read the files?

Revision history for this message
Martin Pitt (pitti) wrote :

There is an apport.hookutils.attach_root_command_outputs() which you can use for running commands as root, yes.

Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in trunk r2616.

Changed in apport:
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

apport (2.9.2-0ubuntu4) raring; urgency=low

  * data/general-hooks/ubuntu-gnome.py: Add "gnome3-ppa" tag if any dependency
    is from the gnome3 PPA.
  * Merge from trunk:
    - hookutils.attach_conffiles(): Fix IOError crash on inaccessible
      conffiles; mark them as '[inaccessible: <reason>]' instead.
      (LP: #1154536)
    - hookutils.in_session_of_problem(): Fix crash when the current locale is
      invalid. (LP: #1154896)

 -- Martin Pitt <email address hidden> Mon, 25 Mar 2013 15:34:02 +0100

affects: apport → apport (Ubuntu)
Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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