Bug 240606 - Pirut search with ' character instantly crashes
Pirut search with ' character instantly crashes
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: James Antill
:
Depends On:
Blocks: F7Update
  Show dependency treegraph
 
Reported: 2007-05-18 14:51 EDT by Stefan Orbilt
Modified: 2014-01-21 17:58 EST (History)
4 users (show)

See Also:
Fixed In Version: 3.2.17-2.fc9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-23 22:11:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch for this one issue. (861 bytes, patch)
2008-02-29 09:18 EST, Michal Fabry
no flags Details | Diff
crash dump compare (1.08 KB, text/plain)
2008-02-29 18:53 EST, Stefan Orbilt
no flags Details
My patched sqlitesack.py (32.82 KB, text/x-python)
2008-02-29 18:56 EST, Stefan Orbilt
no flags Details
Yum crashes searching for quote character (1.03 KB, text/plain)
2008-05-30 06:18 EDT, Danny Smith
no flags Details
Patch for sqlitesack.py (460 bytes, patch)
2008-05-30 06:20 EDT, Danny Smith
no flags Details | Diff

  None (edit)
Description Stefan Orbilt 2007-05-18 14:51:47 EDT
Description of problem:
Pirut crashes if one single ' is included somewhere in the text string in the
Search field.

Version-Release number of selected component (if applicable):
1.3.7.1

How reproducible:
Every time.

Steps to Reproduce:
Open up Pirut and type in a Search for a package and use a ' anywhere in the
search string. Then hit the Search-button.
  
Actual results:
Crash.

Expected results:
Search.

Additional info:
Comment 1 Jeremy Katz 2007-05-22 15:38:23 EDT
Weird.  Reproducible, but I can't see why this would happen from pirut but not
from yum on the command line
Comment 2 Jeremy Katz 2007-06-05 12:56:30 EDT
Okay, figured it out.  This is a bug in yum and we're just getting lucky on the
command line
Comment 3 Stefan Orbilt 2007-12-09 15:22:04 EST
Hi Jeremy, I was just wondering if you forgot about this bug? It still appears
in Fedora 8. I noticed that you fixed like 10 other crash bugs that were
included in an update today but not this one... Not that the other fixes weren't
important as well :)
Comment 4 Seth Vidal 2007-12-09 17:04:06 EST
Jeremy didn't forget, this one is on me it's not a pirut bug it's a yum bug - we
just happen to escape it in yum for completely arbitrary reasons. :)

I'll take care of it soon.
thanks
Comment 5 Stefan Orbilt 2007-12-10 15:11:23 EST
Ok cool, thanks for letting me know Seth! :)
Comment 6 Michal Fabry 2008-02-29 09:18:09 EST
Created attachment 296354 [details]
Patch for this one issue.

Maybe this will solve this one issue. But I think, there is the same problem
with escaping through all yum :-/
Comment 7 Stefan Orbilt 2008-02-29 18:53:54 EST
Created attachment 296430 [details]
crash dump compare

Thanks Michal but it doesn't seem to solve the issue here. I have:

yum-3.2.8-2.fc8
pirut-1.3.28-1.fc8

I manually added your code fix to
/usr/lib/python2.5/site-packages/yum/sqlitesack.py but pirut still crashes, and
now it says "unrecognized token" as well. The attachment contains the
comparison of two crash logs, one with the patch applied and one without.
Comment 8 Stefan Orbilt 2008-02-29 18:56:44 EST
Created attachment 296431 [details]
My patched sqlitesack.py
Comment 9 Michal Fabry 2008-03-03 03:13:50 EST
Stefan: ah, I see :( My fault. Sorry.
Comment 10 Stefan Orbilt 2008-03-03 13:55:34 EST
Well thanks for trying Michal!
Comment 11 Seth Vidal 2008-03-12 10:28:22 EDT
Okay tested under 3.2.12 - same problem but I do know where to go to solve it,
now, I think. Just posting an update to the bug.
Comment 12 Bug Zapper 2008-05-13 22:55:02 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 13 Danny Smith 2008-05-30 06:18:31 EDT
Created attachment 307182 [details]
Yum crashes searching for quote character
Comment 14 Danny Smith 2008-05-30 06:20:24 EDT
Created attachment 307185 [details]
Patch for sqlitesack.py
Comment 15 Danny Smith 2008-05-30 06:21:04 EDT
Yum can be made to exhibit the same problem on the command line, as per the
attachment (yum search "'test'" - obviously the quotes are important).

Normally the shell will strip quotes for you, so this doesn't normally show up.

The attached patch for seems to fix the problem for both Pirut and Yum, but I'm
not certain it will cover all cases.
Comment 16 Seth Vidal 2008-05-30 15:29:51 EDT
I get the same behavior with or without your patch. It outputs:
yum search "'test'"
Error: near "test": syntax error

Comment 17 James Antill 2008-05-31 17:23:09 EDT
 My bad I'd tested using "'" ... which works!

 The patch is correct, in theory, it just misses a couple of places. I've now
tested for "a'" and "'s" which both work and find something. "'test'" doesn't
have any results, but doesn't error. commit af9243770367e8337969738e30ec20bb5a2b7ea0

 We should. probably escape more chars (search '%', fails), or move to ? subst.
Comment 18 Danny Smith 2008-06-02 12:12:57 EDT
Sorry, I've been testing of Fedora 8 rather than the latest release - the '%'
issue doesn't show there. I'll take a proper look at the current code later -
apologies.
Comment 19 Fedora Update System 2008-07-09 10:51:28 EDT
yum-3.2.17-1.fc9 has been submitted as an update for Fedora 9
Comment 20 Fedora Update System 2008-07-09 17:51:03 EDT
yum-3.2.17-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-6301
Comment 21 Fedora Update System 2008-07-22 13:28:46 EDT
yum-3.2.17-2.fc8 has been submitted as an update for Fedora 8
Comment 22 Fedora Update System 2008-07-23 22:11:13 EDT
yum-3.2.17-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 23 Fedora Update System 2008-08-07 13:17:14 EDT
yum-3.2.18-1.fc8 has been submitted as an update for Fedora 8
Comment 24 Fedora Update System 2008-08-27 14:02:51 EDT
yum-3.2.19-1.fc8 has been submitted as an update for Fedora 8.
http://admin.fedoraproject.org/updates/yum-3.2.19-1.fc8
Comment 25 Fedora Update System 2008-09-10 02:59:02 EDT
yum-3.2.19-3.fc8 has been pushed to the Fedora 8 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.