Comparison of exit_status in run_custom_command is wrong

Bug #1339244 reported by unrud
30
This bug affects 9 people
Affects Status Importance Assigned to Milestone
GNOME Settings Daemon
Fix Released
Medium
gnome-settings-daemon (Ubuntu)
Fix Released
Medium
Unassigned
Trusty
Triaged
Medium
Unassigned
unity-settings-daemon (Ubuntu)
Triaged
Medium
Unassigned
Trusty
Triaged
Medium
Unassigned

Bug Description

In file /plugins/common/gsd-input-helper.c in function run_custom_command the variable exit_status doesn't contain the exit status of the process, so the statement "return (exit_status == 1);" is wrong.

The documentation (https://developer.gnome.org/glib/stable/glib-Spawning-Processes.html#g-spawn-sync) says:
exit_status return location for child exit status, as returned by waitpid(), or NULL.

And in the documentation of waitpid (http://linux.die.net/man/2/waitpid) exit_status is described.

You have to do something like this:
if (WIFEXITED(exit_status) == FALSE) {
    return FALSE;
}
return (WEXITSTATUS(exit_status) == 1);

Related branches

Revision history for this message
Tim Lunn (darkxst) wrote :
Changed in gnome-settings-daemon (Ubuntu):
status: New → Triaged
Revision history for this message
unrud (unrud) wrote :

Any chance that this gets fixed in Trusty?

Due to this bug it's impossible to let Gnome Settings Daemon ignore specific devices.
For example GSD regularly overrides custom touchpad settings and instead of letting GSD ignore the device, you have to disable the mouse plugin.

Revision history for this message
Tim Lunn (darkxst) wrote :

unrud

Revision history for this message
Tim Lunn (darkxst) wrote :

unrud, please add SRU paperwork to ensure that it gets into trusty as well
https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Michael Vogt (mvo)
Changed in gnome-settings-daemon (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-settings-daemon - 3.8.6.1-0ubuntu15

---------------
gnome-settings-daemon (3.8.6.1-0ubuntu15) utopic; urgency=low

  * debian/patches/git_lp1339244.patch:
    - fix exit status check in gsd-input-helper.c (LP: #1339244)
 -- Michael Vogt <email address hidden> Thu, 10 Jul 2014 11:05:00 +0200

Changed in gnome-settings-daemon (Ubuntu):
status: In Progress → Fix Released
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Medium
Changed in gnome-settings-daemon (Ubuntu Trusty):
importance: Undecided → Medium
Changed in unity-settings-daemon (Ubuntu Trusty):
importance: Undecided → Medium
status: New → Triaged
Changed in unity-settings-daemon (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in gnome-settings-daemon (Ubuntu Trusty):
status: New → Triaged
Changed in gnome-settings-daemon:
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

unsubscribing sponsors, seems there is nothing to sponsor there

Revision history for this message
Fadi Mouqayed (smfadi+uo) wrote :

Considering the fact that this bug makes it difficult to use a custom input device configuration in Ubuntu 14.04, I will try to make the case for a Trusty SRU. I normally use the hotplug-command facility to configure touchpad parameters that aren't exposed by the GNOME UI. FWIW, I can confirm that the Utopic package (Which includes the fix) works without issues.

[Impact]

* Due to this bug, using a custom input device configuration is made unnecessarily difficult out-of-the-box with 14.04. The GNOME documentation asserts that the "official" way of doing persistent custom persistent device configurations is by using the hotplug-command GSettings Entry combined with a shell script. This, however, does not work at the time of writing.

* As a result, a user who wishes to use a custom input device configuration is forced to use less-than-optimal workarounds such as disabling the GSettings "mouse" plugin altogether, which also has the potentially unwanted side-effect of disabling the Mouse/Touchpad configuration UI as well.

[Test Case]

* A simple test program is included within the description of the upstream GNOME Bug: https://bugzilla.gnome.org/show_bug.cgi?id=710791 and can be used to confirm that GSD is getting the correct exit code.

[Regression Potential]

* Minimal. The proposed patch only fixes the extraction/comparison of the exit status and has been proven to work on 14.10.

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.