/just/in/case:-)

Bug #1399916 reported by Roman Odaisky
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

Just in case process name in /proc/%s/stat contains the right parenthesis character.

Tags: patch vivid

Related branches

Revision history for this message
Roman Odaisky (rdaysky) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "DistUpgrade.utils.py.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in ubuntu-release-upgrader (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
tags: added: vivid
Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote :

It is not clear to me how switching from partition to rpartition is functionally different. Could you explain the need to switch from one to the other?

description: updated
Revision history for this message
Roman Odaisky (rdaysky) wrote :

In case there’s another right parenthesis from the process name. str.partition would get the first parenthesis while rpartition would get the last one, which is guaranteed to be the right one (no pun intended :−). Unlikely but why not play it safe when possible. ps does the same.

See for yourself:

ln -s /usr/bin/python xyzzy:-\)plugh
./xyzzy:-\)plugh <<E
statline = open("/proc/self/stat").read()
print(statline)
print("Parent PID is not " + statline.partition(")")[2].split()[1])
print("But rather " + statline.rpartition(")")[2].split()[1])
E

Changed in ubuntu-release-upgrader (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

utils.py actually comes from update-manager, so I've switched the package.

affects: ubuntu-release-upgrader (Ubuntu) → update-manager (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:15.04.2

---------------
update-manager (1:15.04.2) vivid; urgency=medium

  * UpdateManager/Core/utils.py: use rpartition in case the process name
    contains the right parenthesis character. Thanks to Roman Odaisky for the
    patch. (LP: #1399916)
  * UpdateManager/Dialogs.py: set the focus to "Restart Later" instead of
    "Restart Now", so people don't accidentally reboot. (LP: #1421044)
 -- Brian Murray <email address hidden> Wed, 18 Feb 2015 11:38:56 -0800

Changed in update-manager (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.