On Wed, Oct 1, 2008 at 11:18 AM, Jesus Rodriguez <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 01, 2008 at 01:57:04PM +0800, Coe, Colin C. (Unix Engineer) wrote:
>>
>> 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?
>
> I'll look into this. I maintain the redstone-xmlrpc package.
>
> jesus
>

Colin,

I tried your script and could generate an error. But when I turned
debug logging on the client I noticed that the
binary ssh_host_key file was being sent as a STRING.

<member><name>contents</name><value><string>SSH PRIVATE KEY FILE FORMAT 1.1
�Lh��Č.ey&gt;
              
��3)p��ɉ��KՏ���9�nEX�0sp�L�lM�b��P#�\�&amp;|��H��&amp;�f,������؂�E
...

The Spacewalk server then parses this as a String which causes it to
throw an "invalid XML character element" error.
The file needs to be encoded as base64. Either Frontier RPC client
should do it OR you'd have to encode it before sending it to the
server.

For the binary file I did this:

use MIME::Base64;
$fileinfo{'contents'} = $client->base64(encode_base64($fileinfo{'contents'}));

then I made the $client->call('configchannel.createOrUpdatePath'...

The Frontier Client page talks about base64:
http://search.cpan.org/~kmacleod/Frontier-RPC-0.07b4/lib/Frontier/Client.pm

Sorry it too me so long to respond.

jesus

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

Reply via email to