Hello community, here is the log from the commit of package suseRegister for openSUSE:Factory checked in at Thu Jul 16 17:34:20 CEST 2009. -------- --- suseRegister/suseRegister.changes 2009-06-26 13:01:01.000000000 +0200 +++ suseRegister/suseRegister.changes 2009-07-15 16:45:17.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Jul 15 16:32:28 CEST 2009 - mc@suse.de + +- version 1.4 +- use WWW::Curl::Easy instead of LWP::UserAgent to make + registration work in an IPv6 enviroment (FATE#306441) + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- suseRegister-1.3.tar.bz2 New: ---- suseRegister-1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ suseRegister.spec ++++++ --- /var/tmp/diff_new_pack.H5JA9t/_old 2009-07-16 17:33:57.000000000 +0200 +++ /var/tmp/diff_new_pack.H5JA9t/_new 2009-07-16 17:33:57.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package suseRegister (Version 1.3) +# spec file for package suseRegister (Version 1.4) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,8 +19,8 @@ Name: suseRegister -Version: 1.3 -Release: 18 +Version: 1.4 +Release: 1 Summary: Registration Tool Group: Productivity/Other License: GPL v2 or later @@ -32,8 +32,7 @@ Requires: perl-XML-Parser Requires: perl-XML-Writer Requires: perl-URI -Requires: perl-libwww-perl -Requires: perl-Crypt-SSLeay +Requires: perl-WWW-Curl Requires: uuid-runtime Requires: coreutils Requires: util-linux ++++++ suseRegister-1.3.tar.bz2 -> suseRegister-1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suseRegister-1.3/Makefile new/suseRegister-1.4/Makefile --- old/suseRegister-1.3/Makefile 2009-05-14 16:49:24.000000000 +0200 +++ new/suseRegister-1.4/Makefile 2009-07-15 16:29:01.000000000 +0200 @@ -1,4 +1,4 @@ -VERSION = 1.3 +VERSION = 1.4 PERL ?= perl DESTDIR = / diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suseRegister-1.3/SRPrivate.pm new/suseRegister-1.4/SRPrivate.pm --- old/suseRegister-1.3/SRPrivate.pm 2009-05-14 16:49:24.000000000 +0200 +++ new/suseRegister-1.4/SRPrivate.pm 2009-07-15 16:29:01.000000000 +0200 @@ -18,13 +18,12 @@ use SUSE::Parser::Product; use SUSE::Parser::Pattern; -use LWP::UserAgent; -use Crypt::SSLeay; +use WWW::Curl::Easy; use English; # client version number -our $SRversion = "1.3.0"; +our $SRversion = "1.4.0"; our @ISA = qw(Exporter); our @EXPORT = qw(printLog); @@ -921,6 +920,7 @@ my $mess = ""; my $content = ""; + my $header = ""; if (! defined $url) { @@ -953,142 +953,109 @@ return; } - my $user = undef; - my $pass = undef; - my ($httpProxy, $httpsProxy, $proxyUser) = getProxySettings(); + + $ctx->{curlobj} = WWW::Curl::Easy->new(); + + $ctx->{curlobj}->setopt(CURLOPT_HEADER,0); + $ctx->{curlobj}->setopt(CURLOPT_VERBOSE, 1); - if(defined $proxyUser) - { - ($user, $pass) = split(/:/, $proxyUser, 2); - } - - if(defined $httpsProxy) - { - # required for Crypt::SSLeay HTTPS Proxy support - $ENV{HTTPS_PROXY} = $httpsProxy; - - if(defined $user && defined $pass) - { - $ENV{HTTPS_PROXY_USERNAME} = $user; - $ENV{HTTPS_PROXY_PASSWORD} = $pass; - } - elsif(exists $ENV{HTTPS_PROXY_USERNAME} && exists $ENV{HTTPS_PROXY_PASSWORD}) - { - delete $ENV{HTTPS_PROXY_USERNAME}; - delete $ENV{HTTPS_PROXY_PASSWORD}; + $ctx->{curlobj}->setopt(CURLOPT_DEBUGFUNCTION, sub { + my $text = shift; + my $unknown = shift; + my $type = shift; + + if($type == 0) + { + chomp($text); + printLog($ctx, "debug2", "$text" ); + } + #else + #elsif($type != 5 && $type != 6) + #{ + # chomp($text); + # printLog($ctx, "debug3", "d3>$text" ); + #} + return 0; + }); + + $ctx->{curlobj}->setopt(CURLOPT_URL, "$url"); + $ctx->{curlobj}->setopt(CURLOPT_PROTOCOLS, 2); + + if(defined $httpsProxy && $httpsProxy ne "") + { + $ctx->{curlobj}->setopt(CURLOPT_PROXY, $httpsProxy); + $ctx->{curlobj}->setopt(CURLOPT_PROXY_TRANSFER_MODE, 1); + + if(defined $proxyUser && $proxyUser ne "") + { + $ctx->{curlobj}->setopt(CURLOPT_PROXYAUTH, 1); + $ctx->{curlobj}->setopt(CURLOPT_PROXYUSERPWD, $proxyUser); } } + + $ctx->{curlobj}->setopt(CURLOPT_POSTFIELDS, $data); + $ctx->{curlobj}->setopt(CURLOPT_POSTFIELDSIZE, length($data)); + $ctx->{curlobj}->setopt(CURLOPT_POST, 1); + $ctx->{curlobj}->setopt(CURLOPT_CONNECTTIMEOUT, 20); + $ctx->{curlobj}->setopt(CURLOPT_TIMEOUT, 150); + $ctx->{curlobj}->setopt(CURLOPT_CAPATH, "/etc/ssl/certs/"); + $ctx->{curlobj}->setopt(CURLOPT_SSL_VERIFYHOST, 2); + $ctx->{curlobj}->setopt(CURLOPT_SSL_VERIFYPEER, 1); + + + printLog($ctx, "debug2", "SEND DATA to URI: $url:", 1, 0); + printLog($ctx, "debug2", "$data", 1, 0); + printLog($ctx, "info", "SEND DATA to URI: $url:", 0, 1); + printLog($ctx, "info", "$data", 0, 1); - $ENV{HTTPS_CA_DIR} = "/etc/ssl/certs/"; - - # uncomment, if you want SSL debuging - #$ENV{HTTPS_DEBUG} = 1; - - { - package RequestAgent; - @RequestAgent::ISA = qw(LWP::UserAgent); + open (my $fileb, ">", \$content); + $ctx->{curlobj}->setopt(CURLOPT_WRITEDATA,$fileb); - sub new - { - my($class, $puser, $ppass, %cnf) = @_; + open (my $headerb, ">", \$header); + $ctx->{curlobj}->setopt(CURLOPT_WRITEHEADER,$headerb); - my $self = $class->SUPER::new(%cnf); + my $retcode = $ctx->{curlobj}->perform; - bless { - puser => $puser, - ppass => $ppass - }, $class; - } + close $fileb; + close $headerb; - sub get_basic_credentials - { - my($self, $realm, $uri, $proxy) = @_; - - if($proxy) - { - if(defined $self->{puser} && defined $self->{ppass}) - { - return ($self->{puser}, $self->{ppass}); - } - } - return (undef, undef); - } + if ($retcode != 0) + { + logPrintError($ctx, "ERROR: ".$ctx->{curlobj}->strerror($retcode).": ($retcode)\n", 2); + logPrintError($ctx, "ERROR: $header\n", 2); + #printLog($ctx, "debug2", $@, 1, 0); + #printLog($ctx, "error", $@, 0, 1); + return undef; } - my $ua = RequestAgent->new($user, $pass); - - $ua->protocols_allowed( [ 'https' ] ); - $ua->default_headers->push_header('Content-Type' => 'text/xml'); - - # required to workaround a bug in LWP::UserAgent - $ua->no_proxy(); - - #if(defined $httpProxy) - #{ - # $ua->proxy("http", $httpProxy); - #} - - $ua->max_redirect(2); - - # set timeout to the same value as the iChain timeout - $ua->timeout(130); - - my %params = ('Content' => $data); - #$params{':content_file'} = $destfile; + my $response_code = $ctx->{curlobj}->getinfo(CURLINFO_RESPONSE_CODE); + $header{code} = $response_code; - printLog($ctx, "debug2", "SEND DATA to URI: $url:", 1, 0); - printLog($ctx, "debug2", "$data", 1, 0); - printLog($ctx, "info", "SEND DATA to URI: $url:", 0, 1); - printLog($ctx, "info", "$data", 0, 1); - - eval - { - $res = $ua->post( $url, {}, %params); - }; - if($@) + foreach my $line (split(/\n/, $header)) { - printLog($ctx, "error", "Request failed: '$url'"); - if($@ =~ /SSL negotiation failed:\s+[^:]*:[^:]*:[^:]*:[^:]*:(.*) at / && - defined $1 && $1 ne "") + if($line =~ /^HTTP\/([\d.]+)\s+$response_code\s+(.+)\s*$/) { - printLog($ctx, "error", "$1", 0, 1); - $ctx->{errorcode} = 16; - $ctx->{errormsg} = "$1"; + $header{httpversion} = $1; + $header{message} = $2; } - elsif($@ =~ /SSL negotiation failed/) + elsif($line =~ /^([^:]+):\s*(.+)\s*$/) { - printLog($ctx, "error", "SSL negotiation failed", 0, 1); - $ctx->{errorcode} = 16; - $ctx->{errormsg} = "SSL negotiation failed"; + $header{lc($1)} = $2; } - else - { - $ctx->{errorcode} = 16; - $ctx->{errormsg} = "Cannot contact the registration server. Request failed."; - } - - printLog($ctx, "debug2", $@, 1, 0); - printLog($ctx, "error", $@, 0, 1); - - printLog($ctx, "info", indent($ctx)."END: sendData:".(tv_interval($t0))) if($ctx->{time}); - $ctx->{timeindent}--; - return undef; - } - - $content = $res->decoded_content(); + } - printLog($ctx, "debug2", "CODE: ".$res->code." MESSAGE: ".$res->message, 1, 0); + $mess = $header{message} if(exists $header{message}); + + printLog($ctx, "debug2", "CODE: ".$response_code." MESSAGE: $mess", 1, 0); printLog($ctx, "debug2", "RECEIVED DATA:", 1, 0); - printLog($ctx, "debug2", $res->as_string, 1, 0); + printLog($ctx, "debug2", "$header\n$content", 1, 0); - printLog($ctx, "info", "CODE: ".$res->code." MESSAGE: ".$res->message,0,1); + printLog($ctx, "info", "CODE: ".$response_code." MESSAGE: $mess",0,1); printLog($ctx, "info", "RECEIVED DATA:", 0, 1); - printLog($ctx, "info", $res->as_string(), 0, 1); + printLog($ctx, "info", "$header\n$content", 0, 1); - $mess = $res->message; - - if ($res->code >= 300 && $res->code < 400) + if( $response_code == 301 || $response_code == 302) { if ($ctx->{redirects} > 5) { @@ -1097,17 +1064,15 @@ } $ctx->{redirects}++; - my $loc = $res->header("location"); - + my $loc = $header{location}; local $/ = "\r\n"; chomp($loc); local $/ = "\n"; - + #print STDERR "sendData(redirect): ".(tv_interval($t0))."\n" if($ctx->{time}); - $content = sendData($ctx, $loc, $data); } - elsif($res->code < 200 || $res->code >= 300) + elsif($response_code < 200 || $response_code >= 300) { my $b = ""; my @c = (); @@ -1136,9 +1101,9 @@ $out .= "$err\n"; } } - $out .= "$mess\n"; + $out .= "$response_code $mess\n"; - logPrintError($ctx, "ERROR: ".$res->code.": $out\n", 2); + logPrintError($ctx, "ERROR: ".$response_code.": $out\n", 2); $content = undef; } @@ -2269,8 +2234,8 @@ my $err = ""; my $code = 0; - my $lang = $ENV{LANG}; - my $language = $ENV{LANGUAGE}; + my $lang = $ENV{LANG}||""; + my $language = $ENV{LANGUAGE}||""; $lang = undef if($lang =~ /^en_/); $language = undef if($language =~ /^en_/); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/suseRegister-1.3/suse_register new/suseRegister-1.4/suse_register --- old/suseRegister-1.3/suse_register 2009-05-14 16:49:24.000000000 +0200 +++ new/suseRegister-1.4/suse_register 2009-07-15 16:29:01.000000000 +0200 @@ -4,10 +4,10 @@ # Copyright (c) 2006,2007,2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # -BEGIN -{ - push @INC, "."; -} +#BEGIN +#{ +# unshift @INC, "."; +#} use strict; use Data::Dumper; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org