xdiagnose needs root privilege to create /etc/default/grub.bak

Bug #769419 reported by Fabio Marconi
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
xdiagnose
Fix Released
Medium
Unassigned
xdiagnose (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
Medium
Unassigned
Quantal
Fix Released
High
Unassigned
Raring
Fix Released
Medium
Unassigned

Bug Description

[Impact]
xdiagnose requires root permission to run, otherwise it crashes when it tries to update the grub configuration.

This is showing up in the automatically collected errors:
https://errors.ubuntu.com/bucket/?id=%2Fusr%2Fbin%2Fxdiagnose%3AIOError%3Amove%3Ahandle_enable_apport%3Amove%3Acopy2%3Acopyfile

This shows the issue affects precise, quantal, and raring users, with quantal being the most heavily affected.

[Testcase]
1. Open xterm window
2. Run `xdiagnose` as a non-root user
3. Change some grub settings
4. Click apply

Expected behavior: At step 2, remind user to run app as superuser.
Actual behavior: Crashes at step 4

[Fix]
A partial fix was added to the .desktop file, which made xdiagnose use gksu/pkexec to request root permissions when run from the menus. However, xdiagnose can also be run directly from X terminals. To address this case it needs to check if it's run as root at startup, and if not print an error so the user knows to run it with sudo or similar.

[Regression Risk]
The patch is very trivial and non-invasive so not likely to cause regressions. Also, the application is for diagnostic purposes so the impact of a regression in this tool is pretty minor.

[Original Report]
Hello
Launching the xdiagnose gui from the icon, it start, accept the checkboxes variation but when i click apply it don't require me the password to read the grub file.
Launching it from terminal it return the permission denied error.
Thanks
Fabio

Bryce Harrington (bryce)
Changed in xdiagnose:
status: New → Confirmed
Revision history for this message
Bryce Harrington (bryce) wrote :

Agreed this is annoying from a usability standpoint. I'm thinking I should investigate policykit for this.

Changed in xdiagnose:
status: Confirmed → Triaged
importance: Undecided → Medium
Bryce Harrington (bryce)
Changed in xdiagnose (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Jon Bailey (hobart) wrote :

Suggest renaming the bug as xdiagnose appears to require root privileges for several things, and silently fails when launched from the default Ubuntu menus, doing nothing. Seems like it may be a simple fix to have it prompt for privileges on launch like a few other apps.

Revision history for this message
Bryce Harrington (bryce) wrote :

prepending gksu to the menu command would be trivial (and in fact is a relatively simple workaround) but I don't think it's the right way to fix this. PolicyKit provides finer grained administrative permissions and would allow xdiagnose to be started without permissions and only request authentication if an operation required it. Due to that and other reasons policykit would also be more secure than gksu. It's more work to implement it though.

Bryce Harrington (bryce)
Changed in xdiagnose (Ubuntu Quantal):
importance: Medium → High
Revision history for this message
Bryce Harrington (bryce) wrote :

I hoped to get a proper fix for Q but ran out of time. For Q will just do the gksudo trick, and will do a proper fix later as time permits.

Changed in xdiagnose (Ubuntu Quantal):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdiagnose - 3.1

---------------
xdiagnose (3.1) quantal; urgency=low

  * control: Move intel-gpu-tools to recommends to fix FTBS
  * Force Xorg.0.log encoding to bytes to work around UTF-8 issues
    (LP: #1041104)
  * Drop unused and undefined i18n calls
    (LP: #1046991)
  * Use gksudo to gain elevated permissions required by xdiagnose
    (LP: #769419)
 -- Bryce Harrington <email address hidden> Tue, 28 Aug 2012 15:39:01 -0700

Changed in xdiagnose (Ubuntu Quantal):
status: Fix Committed → Fix Released
Colin Watson (cjwatson)
summary: - xdiagnose need root previlege to create /etc/default/grub.bak
+ xdiagnose needs root privilege to create /etc/default/grub.bak
Revision history for this message
Bryce Harrington (bryce) wrote :

https://errors.ubuntu.com/bucket/?id=%2Fusr%2Fbin%2Fxdiagnose%3AIOError%3Amove%3Ahandle_enable_apport%3Amove%3Acopy2%3Acopyfile

This indicates people are still running into problems using xdiagnose on 12.10 due to not running it as root, so reopening task.

Changed in xdiagnose (Ubuntu Quantal):
status: Fix Released → Triaged
Bryce Harrington (bryce)
description: updated
Bryce Harrington (bryce)
description: updated
Bryce Harrington (bryce)
Changed in xdiagnose (Ubuntu Precise):
status: New → Fix Committed
Changed in xdiagnose (Ubuntu Quantal):
status: Triaged → Fix Committed
Changed in xdiagnose (Ubuntu Raring):
status: Triaged → Fix Committed
Changed in xdiagnose (Ubuntu Precise):
importance: Undecided → Medium
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdiagnose - 3.5.1

---------------
xdiagnose (3.5.1) raring-proposed; urgency=low

  * bin/xdiagnose: Exit with error if run as non-root. Otherwise, the
    program will crash when it tries to write a new grub configuration.
    (LP: #769419)
 -- Bryce Harrington <email address hidden> Tue, 23 Apr 2013 14:15:03 -0700

Changed in xdiagnose (Ubuntu Raring):
status: Fix Committed → Fix Released
Changed in xdiagnose (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Fabio, or anyone else affected,

Accepted xdiagnose into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/xdiagnose/2.5.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Fabio, or anyone else affected,

Accepted xdiagnose into quantal-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/xdiagnose/3.2.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

njin@njin-VirtualBox:~$ xdiagnose
Error: Must run as superuser
njin@njin-VirtualBox:~$ apt-cache policy xdiagnose
xdiagnose:
  Installed: 2.5.3
  Candidate: 2.5.3

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

njin@njin-VirtualBox:~$ xdiagnose
Error: Must run as superuser
njin@njin-VirtualBox:~$ apt-cache policy xdiagnose
xdiagnose:
  Installed: 3.2.4
  Candidate: 3.2.4

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdiagnose - 2.5.3

---------------
xdiagnose (2.5.3) precise-proposed; urgency=low

  * bin/xdiagnose: Exit with error if run as non-root. Otherwise, the
    program will crash when it tries to write a new grub configuration.
    (LP: #769419)
 -- Bryce Harrington <email address hidden> Tue, 23 Apr 2013 15:13:13 -0700

Changed in xdiagnose (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xdiagnose - 3.2.4

---------------
xdiagnose (3.2.4) quantal-proposed; urgency=low

  * bin/xdiagnose: Exit with error if run as non-root. Otherwise, the
    program will crash when it tries to write a new grub configuration.
    (LP: #769419)
 -- Bryce Harrington <email address hidden> Tue, 23 Apr 2013 13:42:40 -0700

Changed in xdiagnose (Ubuntu Quantal):
status: Fix Committed → Fix Released
piotr zimoch (ebytyes)
Changed in xdiagnose:
status: Triaged → New
status: New → Incomplete
status: Incomplete → Opinion
status: Opinion → Invalid
status: Invalid → Confirmed
status: Confirmed → In Progress
status: In Progress → Fix Committed
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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