From: Maniacikarus Date: Sun, 14 Sep 2008 11:22:55 +0000 (+0200) Subject: Finaly the Updbooster should work now X-Git-Tag: v2.3-beta4~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c69191276cc6dc41f1dfe76b1f08e2d22f34239e;p=ipfire-2.x.git Finaly the Updbooster should work now --- diff --git a/config/updxlrator/download b/config/updxlrator/download index 4330fcd4bc..de356c4be3 100644 --- a/config/updxlrator/download +++ b/config/updxlrator/download @@ -18,7 +18,6 @@ my $repository='/var/updatecache'; my $login=''; my $dlrate=''; my $uuid=''; -my $wget="$apphome/bin/wget"; my $useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"; my %xlratorsettings=(); my %proxysettings=(); @@ -44,8 +43,9 @@ $vendorid =~ tr/A-Z/a-z/; unless (-d "$repository/download/$vendorid") { - system("mkdir $repository/download/$vendorid"); - system("$apphome/bin/setperms download/$vendorid"); + system("mkdir -p $repository/download/$vendorid"); + system("chown -R nobody.squid $repository/download/$vendorid"); + system("chmod 775 $repository/download/$vendorid"); } exit if (-e "$repository/download/$vendorid/$updatefile"); @@ -94,7 +94,7 @@ if ($xlratorsettings{'MAX_DOWNLOAD_RATE'} eq '') } $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; -@http_header = `$wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`; +@http_header = `wget $login --user-agent="$useragent" --spider -S $sourceurl 2>&1`; $ENV{'http_proxy'} = ''; foreach (@http_header) @@ -106,7 +106,7 @@ foreach (@http_header) $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'}; unlink "$repository/download/$vendorid/$updatefile"; -$_ = system("$wget $login $dlrate --user-agent=\"$useragent\" -q -nc -P $repository/download/$vendorid $sourceurl"); +$_ = system("wget $login $dlrate --user-agent=\"$useragent\" -q -nc -P $repository/download/$vendorid $sourceurl"); $ENV{'http_proxy'} = ''; if ($_ == 0) @@ -115,14 +115,16 @@ if ($_ == 0) unless (-d "$repository/$vendorid") { - system("mkdir $repository/$vendorid"); - system("$apphome/bin/setperms $vendorid"); + system("mkdir -p $repository/$vendorid"); + system("chown -R nobody.squid $repository/$vendorid"); + system("chmod 775 $repository/$vendorid"); } unless (-d "$repository/$vendorid/$uuid") { - system("mkdir $repository/$vendorid/$uuid"); - system("$apphome/bin/setperms $vendorid/$uuid"); + system("mkdir -p $repository/$vendorid/$uuid"); + system("chown -R nobody.squid $repository/$vendorid/$uuid"); + system("chmod 775 $repository/$vendorid/$uuid"); } &writelog("Moving file to the cache directory: $vendorid/$uuid"); @@ -137,7 +139,8 @@ if ($_ == 0) &setcachestatus("$repository/$vendorid/$uuid/checkup.log",time); &setcachestatus("$repository/$vendorid/$uuid/access.log",time); - system("$apphome/bin/setperms $vendorid/$uuid/*"); + system("chown -R nobody.squid $repository/$vendorid/$uuid/*"); + system("chmod 775 $repository/$vendorid/$uuid/*"); } else { &writelog("Download finished with result code: ERROR"); @@ -180,7 +183,7 @@ sub readhash sub writelog { if ($logging) - { + { open (LOGFILE,">>$logfile"); my @now = localtime(time); printf LOGFILE "%04d-%02d-%02d %02d:%02d:%02d [%d] %s\n",$now[5]+1900,$now[4]+1,$now[3],$now[2],$now[1],$now[0],$$,$_[0]; diff --git a/config/updxlrator/setperms b/config/updxlrator/setperms deleted file mode 100644 index 9ffe011de1..0000000000 Binary files a/config/updxlrator/setperms and /dev/null differ diff --git a/config/updxlrator/updxlrator b/config/updxlrator/updxlrator index 62aee1bf59..c1408a2123 100644 --- a/config/updxlrator/updxlrator +++ b/config/updxlrator/updxlrator @@ -361,7 +361,7 @@ sub check_cache &debuglog("File exists in cache and is up to date"); &debuglog("Retrieving file from cache ($updsource)"); &setcachestatus("$updcachedir/$vendorid/$uuid/access.log",time); - system("$apphome/bin/setperms $vendorid/$uuid/access.log"); + system("chown nobody.squid $vendorid/$uuid/access.log"); $cacheurl="http://$netsettings{'GREEN_ADDRESS'}:$http_port/updatecache/$vendorid/$uuid/$updfile"; } else