Bug 676841 - Wrong exit status caused by PackageKit-command-not-found
Summary: Wrong exit status caused by PackageKit-command-not-found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: PackageKit
Version: 17
Hardware: All
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-11 14:04 UTC by Vojtech Vitek
Modified: 2015-03-04 23:57 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-20 15:52:36 UTC
Type: ---


Attachments (Terms of Use)
[PATCH] command-not-found: Make sure we return 127 if we fail (1.20 KB, patch)
2012-09-30 14:50 UTC, Elad Alfassa
no flags Details | Diff

Description Vojtech Vitek 2011-02-11 14:04:05 UTC
Description of problem:
PackageKit-command-not-found cause wrong exit status when executing unknown command.
When I remove the package, bash behaviour is correct.

Version-Release number of selected component (if applicable):
PackageKit-command-not-found-0.6.12-2.fc14.x86_64

How reproducible:
Always.
  
Actual results:
$ whatever
bash: whatever: command not found...
$ echo $?
0

Expected results:
$ whatever
bash: whatever: command not found...
$ echo $?
127

Comment 1 Doncho Gunchev 2012-02-08 22:41:52 UTC
I can confirm this behaviour on f15: PackageKit-command-not-found-0.6.17-1.fc15.x86_64

Comment 2 Miroslav Franc 2012-03-23 13:17:24 UTC
Still broken on f16. Seems to be duplicate of 654204.

Comment 3 Alon Bar-Lev 2012-09-04 19:02:53 UTC
Sorry about the noise.

Still broken on f17.

Comment 4 Alon Bar-Lev 2012-09-04 19:05:47 UTC
Since bug#654204 (2010-11-17) not fixed.
This is a critical issue, the potential of breakage is huge.

Comment 5 Elad Alfassa 2012-09-30 14:50:48 UTC
Created attachment 619445 [details]
[PATCH] command-not-found: Make sure we return 127 if we fail

This patch should fix the problem.

Comment 6 Elad Alfassa 2012-09-30 14:53:44 UTC
The reason this issue is critical is that it could cause scripts to think they succeeded running a command, when they actually failed due to it not being available.

Comment 7 Richard Hughes 2012-10-01 08:52:33 UTC
(In reply to comment #5)
> This patch should fix the problem.

I've pushed this to master:

commit a5f8ba8c9090695ce2042053361893b10a34faf0
Author: Richard Hughes <richard>
Date:   Mon Oct 1 09:55:04 2012 +0100

    cnf: Return with exit code 127 if we cancelled the PackageKit transaction
    
    Inspired from a patch by Elad Alfassa <elad>, many thanks.

Comment 8 Fedora Update System 2012-10-01 13:24:08 UTC
PackageKit-0.8.4-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/PackageKit-0.8.4-1.fc18

Comment 9 Fedora Update System 2012-10-01 20:02:49 UTC
Package PackageKit-0.8.4-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing PackageKit-0.8.4-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-15147/PackageKit-0.8.4-1.fc18
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2012-10-04 11:11:22 UTC
PackageKit-0.8.4-3.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/PackageKit-0.8.4-3.fc18

Comment 11 Alon Bar-Lev 2012-10-04 11:12:55 UTC
Can we have this as an update for fedora 17 as well?

Comment 12 Fedora Update System 2012-12-20 15:52:44 UTC
PackageKit-0.8.4-3.fc18, apper-0.8.0-0.7.20121002git.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.