Hi Jesus

Many thanks for this info as I've now got this working.  I did, however, have 
to wrap the call to 'configchannel.createOrUpdatePath' in an eval as I get the 
error:
---
not well-formed (invalid token) at line 11, column 0, byte 885 at 
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/Parser.pm line 
187
---
Otherwise.

Lastly, I noticed some time ago that any text files uploaded using this API 
call have the trailing newline character removed.  I briefly mentioned this in 
SR #1824676.  Is this intentional behavior?

It's not a really big deal, it just means that any text file uploaded using my 
Perl API scripts are reported as modified by 'rhncfg-client verify'.

Thanks

CC


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Jesus M. Rodriguez
> Sent: Friday, 17 October 2008 12:54 AM
> To: Coe, Colin C. (Unix Engineer)
> Cc: [email protected]
> Subject: Re: [Spacewalk-devel] API call
> 'configchannel.createOrUpdatePath'
>
> 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/Front
> ier/Client.pm
>
> Sorry it too me so long to respond.
>
> jesus
>

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