Bug 659364 - packages.listFiles() does not list objects without checksums (directories, links)
packages.listFiles() does not list objects without checksums (directories, li...
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
540
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Milan Zazrivec
Šimon Lukašík
: Regression
Depends On:
Blocks: sat54-errata
  Show dependency treegraph
 
Reported: 2010-12-02 11:19 EST by Milan Zazrivec
Modified: 2010-12-16 11:35 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The API call packages.listFiles() did not list package objects which have by definition no checksums (directories, symbolic links). This update ensures all package objects are returned, including those without checksums.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-16 10:44:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milan Zazrivec 2010-12-02 11:19:11 EST
Description of problem:
API call packages.listFiles() would not return package objects which
have (by definition) no checksum (directories, symbolic links).

Version-Release number of selected component (if applicable):
spacewalk-java-1.2.39-29 / stock Satellite 5.4

How reproducible:
Always

Steps to Reproduce:
1. Satellite 5.4, some content imported
2. Find a package id of a package which is known to contain directory
   in its file list
3. Use following script to see whether or not are the package directories
   contained in the file list returned by packages.listFiles():
...
#!/usr/bin/perl

use strict;
use warnings;

use Frontier::Client;
use Data::Dumper;

my $HOST = 'satellite.domain.com';
my $user = 'user';
my $pass = 'password';
my $pid = 0;

my $client = new Frontier::Client(url => "https://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);
my $pkglist = $client->call('packages.list_files', $session, $pid);
print Dumper($pkglist);
$client->call('auth.logout', $session);
...
  
Actual results:
packages.listFiles() does not return package objects without checksums.

Expected results:
packages.listFiles() will return package objects without checksums.

Additional info:
From com/redhat/rhn/common/db/datasource/xml/Package_queries.xml:

<mode name="package_files">
  <query params="pid">
SELECT C.name,
       F.file_size,
       CS.checksum,
       CS.checksum_type checksumtype,
       F.file_mode,
       F.linkto,
       TO_CHAR(F.mtime, 'YYYY-MM-DD HH24:MI:SS') AS MTIME
  FROM rhnPackageFile F, rhnPackageCapability C,
       rhnChecksumView CS
 WHERE F.package_id = :pid
   AND F.capability_id = C.id
   AND F.checksum_id = CS.id
ORDER BY UPPER(C.name)
  </query>
</mode>

Use of the inner join in the above statement is incorrect.
Comment 4 Milan Zazrivec 2010-12-05 13:01:55 EST
spacewalk.git master: 2ae1c1a73d332736e652cb9e2927d3d35aaa6f92
Comment 7 Šimon Lukašík 2010-12-09 08:27:51 EST
Changing to VERIFIED:

Testing procedure:
Automated script.

Verified against:
spacewalk-java-1.2.39-33.el5sat
Comment 9 errata-xmlrpc 2010-12-16 10:44:36 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0991.html
Comment 10 Jaromir Hradilek 2010-12-16 11:35:49 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The API call packages.listFiles() did not list package objects which have by definition no checksums (directories, symbolic links). This update ensures all package objects are returned, including those without checksums.

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