Hi all

This API call (configchannel.createOrUpdatePath) barfs when uploading binary 
files, especially on the file '/etc/ssh/ssh_host_key'.

I logged this as SR 1824676 for Sat v5.1 which became 
https://bugzilla.redhat.com/show_bug.cgi?id=445767.

Spacewalk v0.2 is also affected.  I've looked through the code and I think the 
problem is in 'redstone.xmlrpc.XmlRpcDispatcher', well, that's where the barf 
seems to happen.  I notice that redstone XMRPC library is nearly a year old and 
the latest update on SF is dated 6 weeks ago.

The below Perl script reliably reproduces the problem.

Could this be looked at?

Thanks

CC

---
#!/usr/bin/perl

use strict;
use warnings;

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

use constant MAX_TRIES => 10;

my ($client, $session) = RHNSession::Session;

my $systems   = $client->call('system.list_user_systems', $session);

my @ssh_files = qw(/etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_dsa_key.pub 
/etc/ssh/ssh_host_key /etc/ssh/ssh_host_key.pub /etc/ssh/ssh_host_rsa_key 
/etc/ssh/ssh_host_rsa_key.pub);
for my $filename (@ssh_files) {
    chomp $filename;
    my $filetype = 0; # Assume the file is not a directory
    my %fileinfo;
    my $uid = (stat($filename))[4];
    my $gid = (stat($filename))[5];
    $fileinfo{'contents'}    = do { local( *ARGV, $/ );  @ARGV= $filename; <> };
    $fileinfo{'owner'}       = $client->string(getpwuid($uid));
    $fileinfo{'group'}       = $client->string(getgrgid($gid));
    $fileinfo{'permissions'} = $client->string(sprintf "%04o", 
(stat($filename))[2] & 07777);

    $client->call('configchannel.createOrUpdatePath', $session, "cc-vm1", 
$filename, $client->string($filetype), \%fileinfo);
}
---

NOTICE: This email and any attachments are confidential. 
They may contain legally privileged information or 
copyright material. You must not read, copy, use or 
disclose them without authorisation. If you are not an 
intended recipient, please contact us at once by return 
email and then delete both messages and all attachments.


_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to