Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1162840 - channel.software.listSusbcribedSystems uses Hibernate query that does not take into account Trusted Relationships
Summary: channel.software.listSusbcribedSystems uses Hibernate query that does not tak...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 2.2
Hardware: All
OS: Linux
urgent
high
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 1140341 (view as bug list)
Depends On:
Blocks: sat560-triage 1140341 space23
TreeView+ depends on / blocked
 
Reported: 2014-11-11 20:14 UTC by Stephen Herr
Modified: 2016-03-21 12:15 UTC (History)
5 users (show)

Fixed In Version: spacewalk-java-2.3.76
Doc Type: Bug Fix
Doc Text:
Clone Of: 1149829
Environment:
Last Closed: 2015-04-14 19:03:31 UTC


Attachments (Terms of Use)

Description Stephen Herr 2014-11-11 20:14:43 UTC
+++ This bug was initially created as a clone of Bug #1149829 +++

Description of problem:
When you have a suborg using a channel shared by trust from the parent org, you're not able to use the channel.software.listSubscribedSystems api method.

Version-Release number of selected component (if applicable):
spacewalk-java-2.0.2-85.el6sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. In the parent org, create a sub org
2. In the parent org, create a trust to the sub org
3. In the sub org, register a system and give it the channel shared by trust from the parent
4. Use the api script to try to list it:
$ perl 00920875.pl 
channel id: 101 and label: rhel-x86_64-server-5
channel id: 102 and label: rhel-x86_64-server-6
channel id: 112 and label: rhel-i386-server-5.5
channel id: 109 and label: rhel-i386-as-4
channel id: 110 and label: clone-rhel-x86_64-server-6
channel id: 111 and label: mycustomchan
channel id: 113 and label: parentorgchannel
Fault returned from XML RPC Server, fault code -210: redstone.xmlrpc.XmlRpcFault: No such channel: parentorgchannel
$ cat 00920875.pl
#!/usr/bin/perl
use Frontier::Client;

my $HOST = 'spacewalk.example.com';
my $user = 'suborgadmin';
my $pass = 'redhat';
my $chanlabel = 'parentorgchannel';

my $client = new Frontier::Client(url => "http://$HOST/rpc/api");#, debug=>1);
my $session = $client->call('auth.login',$user, $pass);

my $channels = $client->call('channel.listAllChannels', $session);

# dereference (@) the perl array to loop
for (@{$channels}) {
      print "channel id: " . $_->{'id'};
      print " and label: " . $_->{'label'} . "\n";
}


my $systems = $client->call('channel.software.listSubscribedSystems', $session, $chanlabel);
 
# dereference (@) the perl array to loop
for (@{$systems}) {
  print "system id: " . $_->{'id'};
  print " and name: " . $_->{'name'} . "\n";
}

$client->call('auth.logout', $session);   

Actual results:
Fault returned from XML RPC Server, fault code -210: redstone.xmlrpc.XmlRpcFault: No such channel: parentorgchannel

Expected results:
To have the system returned like
system id: 1000010002 and name: gss-rhel6u3-64.usersys.redhat.com

Additional info:

--- Additional comment from Stephen Herr on 2014-11-11 14:33:38 EST ---

This error exactly as described (for listSubscribedSystems) is fixed already in Spacewalk 2.2, however the same problem still exists for 

channel.software.isUserSubscribable
channel.software.isUserManageable
channel.software.setGloballySubscribable
channel.software.addPackages
channel.software.removePackages
channel.software.clone
channel.software.subscribeSystem (deprecated)

Obviously the ones that involve modifying the channel should return an exception if the channel is not owned by the org of the logged in user, but it should make sense and not be a "no such channel" error.

Comment 1 Stephen Herr 2014-11-11 20:20:29 UTC
Committing to Spacewalk master:
655808b14be60c172f2fae12546846fb33759251

Comment 2 Grant Gainey 2015-03-23 16:59:17 UTC
Moving bugs to ON_QA as we move to release Spacewalk 2.3

Comment 3 Grant Gainey 2015-04-14 19:03:31 UTC
Spacewalk 2.3 has been released. See

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes23

Comment 4 Gennadii Altukhov 2016-03-16 09:44:57 UTC
*** Bug 1140340 has been marked as a duplicate of this bug. ***

Comment 5 Jan Dobes 2016-03-21 12:15:57 UTC
*** Bug 1140341 has been marked as a duplicate of this bug. ***


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