Hello,

I created patch for apt-mirror. I sent it to maintainers of apt-mirror, but 
nobody response. So I'm resending it to Ubuntu. Can be this patch included in 
ubuntu version of apt-mirror?

On Friday 26 August 2011 12:49:39 Pali Rohár wrote:
> Hello,
> 
> New wget version do not automatically send Basic HTTP authentication
> information (plaintext username and password) for all requests when
> specified username and password (old version Wget 1.10.2 and prior did
> it). In new version of wget was introduced param --auth-no-challenge
> which switch to old wget behaviour (see man 1 wget). Some apt servers
> (like server for Maemo 5 N900: https://downloads.maemo.nokia.com)
> needs to always receive Basic HTTP authentication. So I patched
> apt-mirror to added support for these servers with new version of
> wget. Patch adds new config variable auth_no_challenge (with 0 or 1)
> and apt-mirror exec wget with --auth-no-challenge if config is 1.
> 
> With this patch I'm able to mirror apt server
> https://downloads.maemo.nokia.com (with correct username and
> password).
> 
> Patch is against apt-mirror from ubuntu natty, version 0.4.8-3ubuntu1
> 

-- 
Pali Rohár
[email protected]
--- apt-mirror.orig	2011-08-26 12:14:47.029789974 +0200
+++ apt-mirror	2011-09-04 12:58:44.456720783 +0200
@@ -68,6 +68,15 @@ deb-powerpc http://example.com/debian st
 HTTP and FTP Auth or non-standard port:
 deb http://user:[email protected]:8080/debian stable main contrib non-free
 
+HTTPS with sending Basic HTTP authentication information (plaintext username and password) for all requests:
+(this was default behaviour of Wget 1.10.2 and prior and is needed for some servers with new version of Wget)
+set auth_no_challenge 1
+deb https://user:[email protected]:443/debian stable main contrib non-free
+
+HTTPS without checking certificate:
+set no-check-certificate 1
+deb https://example.com:443/debian stable main contrib non-free
+
 Source Mirroring:
 deb-src http://example.com/debian stable main contrib non-free
 
@@ -99,9 +108,11 @@ my %config_variables = (
     "cleanscript" => '$var_path/clean.sh',
     "_contents"   => 1,
     "_autoclean"  => 0,
-    "_tilde"	  => 0,
+    "_tilde"      => 0,
     "limit_rate"  => '100m',
     "run_postmirror" => 1,
+    "auth_no_challenge" => 0,
+    "no-check-certificate" => 0,
     "postmirror_script" => '$var_path/postmirror.sh'
 );
 
@@ -198,11 +209,15 @@ sub download_urls {
     my $i = 0;
     my $pid;
     my $nthreads = get_variable("nthreads");
+    my @args = ();
     local $| = 1;
 
     @urls = @_;
     $nthreads = @urls if @urls < $nthreads;
 
+    if(get_variable("auth_no_challenge") == 1) { push(@args, "--auth-no-challenge"); }
+    if(get_variable("no-check-certificate") == 1) { push(@args, "--no-check-certificate"); }
+
     print "Downloading " . scalar(@urls) . " $stage files using $nthreads threads...\n";
     
     while(scalar @urls) {
@@ -216,7 +231,7 @@ sub download_urls {
 	die("apt-mirror: can't do fork in download_urls") if $pid < 0;
 	
 	if($pid == 0) {
-	    exec 'wget', '--no-cache', '--limit-rate='.get_variable("limit_rate"), '-t', '5', '-r', '-N', '-l', 'inf', '-o', get_variable("var_path") . "/$stage-log.$i", '-i', get_variable("var_path") . "/$stage-urls.$i";
+	    exec 'wget', '--no-cache', '--limit-rate='.get_variable("limit_rate"), '-t', '5', '-r', '-N', '-l', 'inf', '-o', get_variable("var_path") . "/$stage-log.$i", '-i', get_variable("var_path") . "/$stage-urls.$i", @args;
 	    # shouldn't reach this unless exec fails
 	    die("\n\nCould not run wget, please make sure its installed and in your path\n\n");
 	}

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 
ubuntu-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel

Reply via email to