Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1248271

Summary: Task search not properly validating input, throws SQL error
Product: Red Hat Satellite Reporter: Corey Welton <cwelton>
Component: Tasks PluginAssignee: Shimon Shtein <sshtein>
Status: CLOSED DEFERRED QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: bbuckingham, bkearney
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 21:12:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Welton 2015-07-30 01:34:14 UTC
Description of problem:

Depending on expected inputs, user can get a SQL error thrown on Tasks when providing wrong input type.

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


How reproducible:


Steps to Reproduce:
1.  Create admin user named 'mmccune'
2.  Using 'mmccune', perform a variety of tasks.
3.  Monitor > Tasks
4.  in search filter, search for owner.id = mmccune (note that this is incorrect; id is expecting an integer)

View results

Actual results:


PGError: ERROR: invalid input syntax for integer: "mmccune" LINE 4: ...) WHERE ((foreman_tasks_locks_owner.resource_id = 'mmccune')... ^ : SELECT "foreman_tasks_tasks".* FROM "foreman_tasks_tasks" INNER JOIN foreman_tasks_locks AS foreman_tasks_locks_owner ON (foreman_tasks_locks_owner.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_owner.resource_type = 'User' AND foreman_tasks_locks_owner.name = 'task_owner') WHERE ((foreman_tasks_locks_owner.resource_id = 'mmccune')) ORDER BY "foreman_tasks_tasks"."started_at" DESC NULLS LAST LIMIT 20 OFFSET 0

Expected results:


Proper handling of incorrect inputs.

Additional info:

Comment 2 Ivan Necas 2016-08-01 06:50:53 UTC
Created redmine issue http://projects.theforeman.org/issues/15922 from this bug

Comment 4 Bryan Kearney 2016-08-04 20:18:14 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 5 Bryan Kearney 2016-08-29 14:08:54 UTC
Upstream bug assigned to sshtein

Comment 6 Bryan Kearney 2016-08-29 14:08:58 UTC
Upstream bug assigned to sshtein

Comment 7 Bryan Kearney 2017-03-21 21:12:35 UTC
There is a an upstream issue opened for this. We will no longer be tracking this downstream. If you believe this was closed in error please feel free to re-open with additional information.