Bug 240606

Summary: Pirut search with ' character instantly crashes
Product: [Fedora] Fedora Reporter: Stefan Orbilt <stefan>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: danny, dgunchev, katzj, mfabry
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2.17-2.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-07-24 02:11:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 236808    
Attachments:
Description Flags
Patch for this one issue.
none
crash dump compare
none
My patched sqlitesack.py
none
Yum crashes searching for quote character
none
Patch for sqlitesack.py none

Description Stefan Orbilt 2007-05-18 18:51:47 UTC
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 19:38:23 UTC
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 16:56:30 UTC
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 20:22:04 UTC
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 22:04:06 UTC
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 20:11:23 UTC
Ok cool, thanks for letting me know Seth! :)

Comment 6 Michal Fabry 2008-02-29 14:18:09 UTC
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 23:53:54 UTC
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 23:56:44 UTC
Created attachment 296431 [details]
My patched sqlitesack.py

Comment 9 Michal Fabry 2008-03-03 08:13:50 UTC
Stefan: ah, I see :( My fault. Sorry.

Comment 10 Stefan Orbilt 2008-03-03 18:55:34 UTC
Well thanks for trying Michal!


Comment 11 Seth Vidal 2008-03-12 14:28:22 UTC
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-14 02:55:02 UTC
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 10:18:31 UTC
Created attachment 307182 [details]
Yum crashes searching for quote character

Comment 14 Danny Smith 2008-05-30 10:20:24 UTC
Created attachment 307185 [details]
Patch for sqlitesack.py

Comment 15 Danny Smith 2008-05-30 10:21:04 UTC
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 19:29:51 UTC
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 21:23:09 UTC
 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 16:12:57 UTC
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 14:51:28 UTC
yum-3.2.17-1.fc9 has been submitted as an update for Fedora 9

Comment 20 Fedora Update System 2008-07-09 21:51:03 UTC
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 17:28:46 UTC
yum-3.2.17-2.fc8 has been submitted as an update for Fedora 8

Comment 22 Fedora Update System 2008-07-24 02:11:13 UTC
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 17:17:14 UTC
yum-3.2.18-1.fc8 has been submitted as an update for Fedora 8

Comment 24 Fedora Update System 2008-08-27 18:02:51 UTC
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 06:59:02 UTC
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.