Bug 1148395 - Hammer : Uploading content to repository allows to upload text file whereas it should allow only rpms to upload
Summary: Hammer : Uploading content to repository allows to upload text file whereas i...
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer
Version: 6.2.6
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: David Davis
QA Contact: Sanket Jagtap
URL: https://pulp.plan.io/issues/1747
Whiteboard:
Keywords: Triaged
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-01 11:41 UTC by Tazim Kolhar
Modified: 2019-04-01 20:27 UTC (History)
14 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-02-21 16:49:54 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Pulp Redmine 1747 High CLOSED - CURRENTRELEASE Import upload task has unexpected/missing information on error 2016-09-06 16:01 UTC
Foreman Issue Tracker 16451 None None None 2016-09-14 19:24 UTC
Foreman Issue Tracker 16453 None None None 2016-09-14 19:24 UTC
Red Hat Knowledge Base (Solution) 2921261 None None None 2017-02-13 12:51 UTC

Description Tazim Kolhar 2014-10-01 11:41:01 UTC
Description of problem:
Hammer : Uploading content to repository allows to upload text file whereas it should allow only rpms to upload

Version-Release number of selected component (if applicable):
# rpm -qa | grep foreman
ruby193-rubygem-foreman-tasks-0.6.9-1.1.el6sat.noarch
foreman-compute-1.6.0.44-1.el6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.5-2.el6sat.noarch
foreman-postgresql-1.6.0.44-1.el6sat.noarch
foreman-1.6.0.44-1.el6sat.noarch
foreman-vmware-1.6.0.44-1.el6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.0.4-1.el6sat.noarch
rubygem-hammer_cli_foreman-0.1.1-16.el6sat.noarch
cloud-qe-10.idmqe.lab.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-selinux-1.6.0.14-1.el6sat.noarch
foreman-gce-1.6.0.44-1.el6sat.noarch
ruby193-rubygem-foreman_bootdisk-2.0.6-1.1.el6sat.noarch
cloud-qe-10.idmqe.lab.eng.bos.redhat.com-foreman-client-1.0-1.noarch
foreman-ovirt-1.6.0.44-1.el6sat.noarch
ruby193-rubygem-foreman_discovery-1.3.0-2.el6sat.noarch
foreman-proxy-1.6.0.30-1.el6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-3.el6sat.noarch
foreman-libvirt-1.6.0.44-1.el6sat.noarch


How reproducible:
everytime

Steps to Reproduce:

# hammer -v -u admin -p ***  --output csv organization create --name='Rewuql'
Message,Id,Name
Organization created,295,Rewuql



# hammer -v -u admin -p ***  --output csv product create --description='rpczaqPvmgXHRuFsPKBb' --label='WTvTStfTpEbnbnRFjcqD' --organization-id='295' --name='pPGECyrDRMbYRUywnLFq'

Message,Id,Name
Product created,1258,pPGECyrDRMbYRUywnLFq

# hammer -v -u admin -p ***  product info --id='1258' --organization-id='295'

ID:           1258
Name:         pPGECyrDRMbYRUywnLFq
Label:        WTvTStfTpEbnbnRFjcqD
Description:  rpczaqPvmgXHRuFsPKBb
Sync State:   not_synced
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Rewuql
Readonly:     false
Deletable:    
Content:

# hammer -v -u admin -p *****  --output csv repository create --product-id='1258' --name='JWlmECsxUDxBBFn' --publish-via-http='true' --url='http://inecas.fedorapeople.org/fakerepos/zoo3/' --content-type='yum'

Message,Id,Name
Repository created,91,JWlmECsxUDxBBFn


# hammer -v -u admin -p ***  --output csv repository upload-content --path='/tmp/LgrwMkSUAVmCKMl' --product-id='1258' --name='JWlmECsxUDxBBFn' --organization='Rewuql'

Message
Successfully uploaded file 'LgrwMkSUAVmCKMl'.

Actual results:
the file is text file . still it gets uploaded

Expected results:
it should allow to upload normal text files

Additional info:

Comment 1 RHEL Product and Program Management 2014-10-01 11:43:08 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Tazim Kolhar 2014-10-01 11:47:45 UTC
Excpected result

it should not allow to upload normal text files

Comment 4 David Davis 2015-04-09 17:14:51 UTC
I think this applies to the UI as well.

Comment 5 David Davis 2016-03-04 20:00:14 UTC
Created a pulp bug to deal with the problem:

https://pulp.plan.io/issues/1747

Going to look into adding a workaround in Katello as I am not sure this fix will be added to pulp 2.8.

Comment 6 David Davis 2016-03-09 16:54:17 UTC
It sounds like this might be a regression so maybe this'll be fixed in 2.8?

Comment 8 David Davis 2016-09-06 14:08:36 UTC
Confirmed as fixed:

$ hammer repository upload-content --id 2 --path test.txt
Failed to upload file 'test.txt' to repository. Please check the file and try again.

Comment 9 pulp-infra@redhat.com 2016-09-06 16:01:24 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 10 pulp-infra@redhat.com 2016-09-06 16:01:27 UTC
The Pulp upstream bug priority is at High. Updating the external tracker on this bug.

Comment 11 David Davis 2016-09-14 19:23:31 UTC
The pulp change fixes the issue. However, we need two upstream changes to deal with this fix in pulp:

foreman-tasks

https://github.com/theforeman/foreman-tasks/pull/199

katello

https://github.com/Katello/katello/pull/6298

Comment 14 Sanket Jagtap 2016-11-15 08:34:53 UTC
Build: Satellite 6.3 Snap 6

Verified


hammer -u admin -p changeme --output csv repository upload-content --path='/tmp/apple' --product-id='23' --name='JWlmECsxUDxBBFn' --organization='Rewuql'
Message
Failed to upload file 'apple' to repository. Please check the file and try again.

Comment 17 pm-sat@redhat.com 2018-02-21 16:49:54 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


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