bad root privilege dropping in apport?

Bug #1133650 reported by Doug Evans
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Apport
New
Undecided
Unassigned

Bug Description

I have a program that purposely crashes to give me a coredump so that I can exercise gdb, but I wasn't getting any core dump.
Checking /var/log/apport.log shows "executable was modified after program start, ignoring",
but this is not in fact true.

The program lives on an NFS partition where root privileges are dropped (->nobody), the directory it lives in has 700 permissions, and thus the os.path.exists test in /usr/share/apport/apport is failing:

    if not os.path.exists(os.readlink('/proc/%s/exe' % pid)) or exe_mtime > process_start:

This code in drop_privileges seems wrong:

    if partial:
        effective_gid = os.getegid()
        effective_uid = os.geteuid()
    else:
        effective_gid = stat.st_gid
        effective_uid = stat.st_uid

apport is running as root, so os.gete[gu]id() will return root.
If you want the e[gu]id of the task, that's what stat.st_[gu]id are.
Question: What partial privileges are intended to be dropped here?
Setting aside when to drop privileges (you need to do some things as root first), it seems like the "partial" parameter to drop_privileges should be deleted.
[It could certainly be that I'm missing something though!]

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.